From: Romulo Pinho Date: Fri, 27 Jan 2012 15:09:09 +0000 (+0100) Subject: corrected bug in fusion opacity with double values X-Git-Tag: v1.3.0~109 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9794609d9607a3bc76aec1d10fb58bcb9aed4357;p=clitk.git corrected bug in fusion opacity with double values --- diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index e739eef..813ba22 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -1232,15 +1232,18 @@ void vvSlicerManager::SetColorMap(int colormap) } fusLUT->ForceBuild(); + double v[4]; // set color table transparency - double alpha_range_end = frange[0] + (double)mFusionThresOpacity*(frange[1] - frange[0])/100; - for (double i = frange[0]; i < alpha_range_end; i++) { - double v[4]; - vtkIdType index = fusLUT->GetIndex(i); - fusLUT->GetTableValue(index, v); + double range_end = frange[0] + (double)mFusionThresOpacity*(frange[1] - frange[0])/100; + double curr_value = frange[0]; + int nvalues = fusLUT->GetNumberOfTableValues(); + //for (double i = frange[0]; i <= alpha_range_end; i++) { + for (double i = 0; curr_value < range_end; i++) { + fusLUT->GetTableValue(i, v); v[3] = 0; - fusLUT->SetTableValue(index, v); + fusLUT->SetTableValue(i, v); + curr_value += (frange[1] - frange[0])/nvalues; } } for ( unsigned int i = 0; i < mSlicers.size(); i++) {