]> Creatis software - clitk.git/blobdiff - vv/vvSlicerManager.cxx
Removed QVTKWidget, added installed libs for win
[clitk.git] / vv / vvSlicerManager.cxx
index 9b3d61e4cca0a33b802235be8bd7798359969556..4aa48cf562d8d92e36ec2aacbce888062bb0a6dd 100644 (file)
@@ -1,10 +1,7 @@
 /*=========================================================================
 
 Program:   vv
-Module:    $RCSfile: vvSlicerManager.cxx,v $
 Language:  C++
-Date:      $Date: 2010/01/06 13:31:57 $
-Version:   $Revision: 1.1 $
 Author :   Pierre Seroul (pierre.seroul@gmail.com)
 
 Copyright (C) 2008
@@ -404,7 +401,7 @@ void vvSlicerManager::SetPreviousTSlice(int originating_slicer)
 
 void vvSlicerManager::ToggleInterpolation()
 {
-    bool interpolate=not (mSlicers[0]->GetImageActor()->GetInterpolate());
+    bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate());
     for ( unsigned int i = 0; i < mSlicers.size(); i++)
     {
         mSlicers[i]->GetImageActor()->SetInterpolate(interpolate);
@@ -610,6 +607,26 @@ void vvSlicerManager::Reload()
     }
 }
 
+void vvSlicerManager::ReloadFusion()
+{
+    mFusionReader->Update();
+    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+    {
+        mSlicers[i]->SetFusion(mFusionReader->GetOutput());
+        mSlicers[i]->Render();
+    }
+}
+
+void vvSlicerManager::ReloadOverlay()
+{
+    mOverlayReader->Update();
+    for ( unsigned int i = 0; i < mSlicers.size(); i++)
+    {
+        mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
+        mSlicers[i]->Render();
+    }
+}
+
 void vvSlicerManager::ReloadVF()
 {
     mVectorReader->Update(VECTORFIELD); //deletes the old images through the VF::Init() function
@@ -839,7 +856,7 @@ void vvSlicerManager::SetPreset(int preset)
         break;
     case 7:
         window=1.;
-        level=1;
+        level=0.;
         break;
     }
     mPreset = preset;
@@ -851,6 +868,10 @@ void vvSlicerManager::SetPreset(int preset)
     //    SetColorMap(-1);
     //}
 }
+void vvSlicerManager::SetColorMap()
+{
+    SetColorMap(mColorMap);
+}
 
 void vvSlicerManager::SetColorMap(int colormap)
 {
@@ -865,8 +886,6 @@ void vvSlicerManager::SetColorMap(int colormap)
     switch (colormap)
     {
     case -1:
-        if (LUT)
-            LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
         break;
     case 0:
         LUT = NULL;
@@ -874,7 +893,6 @@ void vvSlicerManager::SetColorMap(int colormap)
     case 1:
         if (LUT == NULL)
             LUT = vtkLookupTable::New();
-        LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
         LUT->SetValueRange(0,1);
         LUT->SetSaturationRange(1,1);
         LUT->SetHueRange(0,0.18);
@@ -882,7 +900,6 @@ void vvSlicerManager::SetColorMap(int colormap)
     case 2:
         if (LUT == NULL)
             LUT = vtkLookupTable::New();
-        LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
         LUT->SetValueRange(0,1);
         LUT->SetSaturationRange(1,1);
         LUT->SetHueRange(0.4,0.80);
@@ -890,7 +907,6 @@ void vvSlicerManager::SetColorMap(int colormap)
     case 3:
         if (LUT == NULL)
             LUT = vtkLookupTable::New();
-        LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
         LUT->SetValueRange(0,1);
         LUT->SetSaturationRange(1,1);
         LUT->SetHueRange(0,1);
@@ -905,7 +921,10 @@ void vvSlicerManager::SetColorMap(int colormap)
         break;
     }
     if (LUT)
+    {
+        LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
         LUT->Build();
+    }
     vtkLookupTable* fusLUT = NULL;
     if (mSlicers[0]->GetFusion())
     {
@@ -949,9 +968,9 @@ void vvSlicerManager::SetColorMap(int colormap)
         }
         else if (mSlicers[i]->GetOverlay())
         {
-            dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-                ->SetWindowLevelMode(false);
-            mSlicers[i]->GetWindowLevel()->SetLookupTable(NULL);
+            //dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
+                //->SetWindowLevelMode(false);
+            mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
         }
         else
         {