]> Creatis software - clitk.git/blobdiff - vv/vvSlicerManager.cxx
Added support for ESRF reconstructions
[clitk.git] / vv / vvSlicerManager.cxx
index 9ff163eb1990e519bb1a2668b80cc5c54b0539ef..b175c46ccc642665487641e20c102b2e8c8e5d37 100644 (file)
@@ -23,7 +23,6 @@
 #include "vvInteractorStyleNavigator.h"
 #include "vvLandmarks.h"
 #include "vvMesh.h"
-#include "vvImageMapToWLColors.h"
 #include "vvBlendImageActor.h"
 
 #include <vtkImageActor.h>
@@ -418,6 +417,23 @@ void vvSlicerManager::LeftButtonReleaseEvent(int slicer)
 }
 //----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
+void vvSlicerManager::EmitMousePositionUpdated(int slicer)
+{
+  emit MousePositionUpdatedSignal(slicer);
+}
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+void vvSlicerManager::EmitKeyPressed(std::string KeyPress)
+{
+  emit KeyPressedSignal(KeyPress);
+}
+//----------------------------------------------------------------------------
+
+
 //----------------------------------------------------------------------------
 void vvSlicerManager::SetSliceOrientation(int slicer, int orientation)
 {
@@ -642,18 +658,18 @@ void vvSlicerManager::UpdateViews(int current,int slicer)
         }
         switch (mSlicers[i]->GetSliceOrientation()) {
         case vtkImageViewer2::SLICE_ORIENTATION_XY:
-          if (mSlicers[i]->GetSlice() != (int)floor(z))
-            mSlicers[i]->SetSlice((int)floor(z));
+          if (mSlicers[i]->GetSlice() != (int)lrint(z))
+            mSlicers[i]->SetSlice((int)lrint(z));
           break;
 
         case vtkImageViewer2::SLICE_ORIENTATION_XZ:
-          if (mSlicers[i]->GetSlice() != (int)floor(y))
-            mSlicers[i]->SetSlice((int)floor(y));
+          if (mSlicers[i]->GetSlice() != (int)lrint(y))
+            mSlicers[i]->SetSlice((int)lrint(y));
           break;
 
         case vtkImageViewer2::SLICE_ORIENTATION_YZ:
-          if (mSlicers[i]->GetSlice() != (int)floor(x))
-            mSlicers[i]->SetSlice((int)floor(x));
+          if (mSlicers[i]->GetSlice() != (int)lrint(x))
+            mSlicers[i]->SetSlice((int)lrint(x));
           break;
         }
         
@@ -737,7 +753,7 @@ void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagat
 //----------------------------------------------------------------------------
 
 //----------------------------------------------------------------------------
-double vvSlicerManager::GetColorWindow()
+double vvSlicerManager::GetColorWindow() const
 {
   if (mSlicers.size())
     return mSlicers[0]->GetColorWindow();
@@ -747,7 +763,7 @@ double vvSlicerManager::GetColorWindow()
 
 
 //----------------------------------------------------------------------------
-double vvSlicerManager::GetColorLevel()
+double vvSlicerManager::GetColorLevel() const
 {
   if (mSlicers.size())
     return mSlicers[0]->GetColorLevel();
@@ -1305,15 +1321,11 @@ void vvSlicerManager::SetColorMap(int colormap)
       invLUT->SetSaturationRange(1,1);
       invLUT->SetHueRange(double((mOverlayColor+180)%360)/360,double((mOverlayColor+180)%360)/360);
       invLUT->Build();
-      dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-        ->SetWindowLevelMode(true);
       mSlicers[i]->GetWindowLevel()->SetLookupTable(supLUT);
       mSlicers[i]->GetOverlayMapper()->SetLookupTable(invLUT);
       invLUT->Delete();
       supLUT->Delete();
     } else if (mSlicers[i]->GetOverlay()) {
-      //dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-      //->SetWindowLevelMode(false);
       mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
     } else {
       mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);