]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Interaction/ImageSliceStyle.cxx
...
[cpPlugins.git] / lib / cpExtensions / Interaction / ImageSliceStyle.cxx
index a4770c08a0288ae8bce8d8735d8f898bbfe7a513..93cb1eb2d3f21fc4d0e2b472ae5d627e478af995 100644 (file)
@@ -1,6 +1,7 @@
 #include <cpExtensions/Utility.h>
 #include <cpExtensions/Interaction/ImageSliceStyle.h>
 #include <cpExtensions/Visualization/CursorActors.h>
+#include <cpExtensions/Visualization/LUTImageActor.h>
 #include <cpExtensions/Visualization/WindowLevelImageActor.h>
 #include <vtkAssemblyPath.h>
 #include <vtkImageData.h>
@@ -93,6 +94,8 @@ OnMouseWheelForward( )
   s += ( this->Interactor->GetShiftKey( ) == 1 )? 10: 1;
   this->m_WLActor->SetSliceNumber( s );
   s = this->m_WLActor->GetSliceNumber( );
+  if( this->m_LUTActor.GetPointer( ) != NULL )
+    this->m_LUTActor->SetSliceNumber( s );
   this->InvokeEvent( vtkCommand::UserEvent + 2, &s );
   this->Interactor->Render( );
   this->OnMouseMove( );
@@ -109,6 +112,8 @@ OnMouseWheelBackward( )
   s -= ( this->Interactor->GetShiftKey( ) == 1 )? 10: 1;
   this->m_WLActor->SetSliceNumber( s );
   s = this->m_WLActor->GetSliceNumber( );
+  if( this->m_LUTActor.GetPointer( ) != NULL )
+    this->m_LUTActor->SetSliceNumber( s );
   this->InvokeEvent( vtkCommand::UserEvent + 2, &s );
   this->Interactor->Render( );
   this->OnMouseMove( );
@@ -307,6 +312,13 @@ _PickPointOnImageActor( int idx[ 2 ], double pnt[ 3 ] )
     this->m_PropPicker->GetPickList( )->RemoveAllItems( );
     this->m_PropPicker->AddPickList( curr_actor );
 
+    auto props = this->CurrentRenderer->GetViewProps( );
+    this->m_LUTActor = NULL;
+    props->InitTraversal( );
+    vtkProp* prop;
+    while( ( ( prop = props->GetNextProp( ) ) != NULL ) && ( this->m_LUTActor.GetPointer( ) == NULL ) )
+      this->m_LUTActor = dynamic_cast< TLUTActor* >( prop );
+
     this->m_Cursor->SetImageBounds( curr_actor->GetImage( )->GetBounds( ) );
     this->m_Cursor->SetImageOrientation( curr_actor->GetOrientation( ) );
     this->m_Cursor->InitTraversal( );