]> Creatis software - clitk.git/blobdiff - vv/vvSlicerManager.cxx
fusion legend is now an option
[clitk.git] / vv / vvSlicerManager.cxx
index d9ed42e2deb448f541eaf97993db3f0eb6b1c483..7cce9dd77f3b0cc5a9c2529d77a94a5f1a386d75 100644 (file)
@@ -62,7 +62,8 @@ vvSlicerManager::vvSlicerManager(int numberOfSlicers)
   mFusionColorMap = 3;
   mFusionWindow = 1000;
   mFusionLevel = 1000;
-
+  mFusionShowLegend = true;
+  
   mLandmarks = NULL;
   mLinkedId.resize(0);
 
@@ -1236,15 +1237,17 @@ void vvSlicerManager::SetColorMap(int colormap)
     double v[4];
     
     // set color table transparency
+    double alpha_range=(double)mFusionThresOpacity/10;
     double range_end = frange[0] + (double)mFusionThresOpacity*(frange[1] - frange[0])/100;
-    double curr_value = frange[0];
+    double curr_value = fusRange[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;
+      //if (curr_value >= -alpha_range && curr_value <= alpha_range) v[3] = pow(fabs(curr_value/alpha_range),2);
+      //else v[3] = 1;
       fusLUT->SetTableValue(i, v);
-      curr_value += (frange[1] - frange[0])/nvalues;
+      curr_value += (fusRange[1] - fusRange[0])/nvalues;
     }
   }
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {
@@ -1277,6 +1280,7 @@ void vvSlicerManager::SetColorMap(int colormap)
     }
     
     if (mSlicers[i]->GetFusion()) {
+      mSlicers[i]->ShowFusionLegend(mFusionShowLegend);
       mSlicers[i]->GetFusionMapper()->SetLookupTable(fusLUT);
       mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100);
     }