]> Creatis software - clitk.git/blobdiff - vv/vvSlicerManager.cxx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / vv / vvSlicerManager.cxx
index 9331bf1ab78a859dcfaf96c4b092c8f4ce3f7454..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;
         }
         
@@ -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);