]> Creatis software - clitk.git/commitdiff
image fusion now display colour legend too
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Wed, 18 Apr 2012 14:11:27 +0000 (16:11 +0200)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Wed, 18 Apr 2012 14:11:27 +0000 (16:11 +0200)
- even the alpha threshold

vv/vvSlicer.cxx
vv/vvSlicerManager.cxx

index d2a6ba71a24b842dae55db5ad2f6baaf09ee1dc7..714d3d97568743c8bd7e8313bb31249fafe24f54 100644 (file)
@@ -1241,8 +1241,14 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, doubl
 //----------------------------------------------------------------------------
 void vvSlicer::Render()
 {
-  if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion) {
+  if (this->mFusion) {
+    legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable());
+    legend->UseOpacityOn();
+    legend->SetVisibility(1);
+  }
+  else if (this->GetWindowLevel()->GetLookupTable()) {// && !this->mOverlay && !this->mFusion) {
     legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());
+    legend->UseOpacityOff();
     legend->SetVisibility(1);
   } else legend->SetVisibility(0);
 
index d9ed42e2deb448f541eaf97993db3f0eb6b1c483..2373abab970f69a17df88871a0051470ebe371a9 100644 (file)
@@ -1236,15 +1236,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++) {