]> Creatis software - cpPlugins.git/commitdiff
Minor refactoring and errors solved
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Thu, 15 Oct 2015 23:23:38 +0000 (18:23 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Thu, 15 Oct 2015 23:23:38 +0000 (18:23 -0500)
appli/examples/CMakeLists.txt
appli/examples/example_BaseInteractorStyle.cxx
appli/examples/example_Test_async.cxx
appli/examples/example_View2DImage.cxx
lib/cpExtensions/Visualization/ImageSliceActors.cxx
lib/cpExtensions/Visualization/ImageSliceActors.h
lib/cpExtensions/Visualization/MPRActors.cxx
lib/cpExtensions/Visualization/MPRActors.h

index b76208835a521e9393bf14002c4629e94d4a51f0..25b7d3c766e7e1b9e166d9c160847302fdf0975c 100644 (file)
@@ -28,7 +28,7 @@ SET(
   EXAMPLES_PROGRAMS_WITH_PLUGINS
   #example_ReadWriteImage
   #example_MPR
-  #example_View2DImage
+  example_View2DImage
   ##example_MarchingCubes
   ##example_OtsuFilter
   ##example_RGBImageToHSVChannels
index 922511abed03b96da51e24dc9006ebd61179b326..a8515d274f06035337cde916925d5bf9418aa3b8 100644 (file)
@@ -59,6 +59,11 @@ protected:
   virtual ~example_BaseInteractorStyle( )
     { }
 
+  virtual bool _PickPosition( double pos[ 3 ] )
+    {
+      return( true ); // Just testing...
+    }
+
 private:
   // Purposely not implemented
   example_BaseInteractorStyle( const Self& );
index e3cfd99f1d0d24dc5f9bba30c04fc7678396f54c..fcd54cf11ecf564ba8a5b6144f2b872e9d5ea40f 100644 (file)
@@ -1,8 +1,10 @@
 #include <future>
 #include <iostream>
+#include <vector>
 #ifdef WIN32
 #include <windows.h>
 #else
+#include <unistd.h>
 #endif
 
 #ifdef WIN32
@@ -73,4 +75,4 @@ int main() {
 
   return 0;
 
-}
\ No newline at end of file
+}
index c18ca50afb3b98e83fe87cdf0bc038b3b9124772..4e7733b0ac3ebb4b58cfa0c4fb67dea3e03da9d4 100644 (file)
@@ -58,10 +58,9 @@ int main( int argc, char* argv[] )
   } // fi
 
   // Configure reader
-  TParameters reader_params = reader->GetDefaultParameters( );
+  TParameters* reader_params = reader->GetParameters( );
   for( int i = 2; i < argc; ++i )
-    reader_params.AddValueToStringList( "FileNames", argv[ i ] );
-  reader->SetParameters( reader_params );
+    reader_params->AddToStringList( "FileNames", argv[ i ] );
 
   // Execute pipeline
   std::string err = reader->Update( );
@@ -71,7 +70,7 @@ int main( int argc, char* argv[] )
     return( 1 );
 
   } // fi
-  TImage* image = reader->GetOutput< TImage >( 0 );
+  TImage* image = reader->GetOutput< TImage >( "Output" );
 
   // Configure visualization objects
   vtkSmartPointer< vtkRenderer > renderer =
@@ -91,10 +90,7 @@ int main( int argc, char* argv[] )
   // Create slice actors
   vtkSmartPointer< TSliceActors > image_actors =
     vtkSmartPointer< TSliceActors >::New( );
-  image_actors->AddInputData(
-    image->GetVTK< vtkImageData >( ), 2,
-    TSliceActors::LUTType_WindowLevel
-    );
+  image_actors->AddInputData( image->GetVTK< vtkImageData >( ), 2 );
   image_actors->PushActorsInto( window );
 
   // Begin interaction
index 676f297427dad8219cf368b31d4ce1ada91c795e..5892fe14b90ec4b9028a90efaa075e86b87a7fbb 100644 (file)
@@ -29,9 +29,19 @@ New( )
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
-AddCursorCommand( TCursorCommand command, void* data )
+AddSlicesCommand( TCursorCommand command, void* data )
 {
-  this->m_CursorCommands.push_back(
+  this->m_SlicesCommands.push_back(
+    std::pair< TCursorCommand, void* >( command, data )
+    );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+AddSeedCommand( TCursorCommand command, void* data )
+{
+  this->m_SeedCommands.push_back(
     std::pair< TCursorCommand, void* >( command, data )
     );
   this->Modified( );
@@ -209,15 +219,6 @@ AssociateSlice( Self* other )
   this->Modified( );
 }
 
-// -------------------------------------------------------------------------
-void cpExtensions::Visualization::ImageSliceActors::
-SetSlicesCommand( TCursorCommand cmd, void* data )
-{
-  this->SlicesCommand = cmd;
-  this->SlicesData = data;
-  this->Modified( );
-}
-
 // -------------------------------------------------------------------------
 vtkInteractorStyle* cpExtensions::Visualization::ImageSliceActors::
 GetStyle( )
@@ -244,23 +245,15 @@ PushActorsInto( vtkRenderWindow* window, bool force_style )
     return;
   
   // Update style
-  if( force_style )
-  {
-    this->_ConfigureStyle( );
+  if( this->m_Style.GetPointer( ) != NULL && force_style )
     rwi->SetInteractorStyle( this->m_Style );
 
-  } // fi
-
   // Update actors
-# error USE vtkActorCollection interface
-  /* TODO
-     for( unsigned int n = 0; n < this->GetNumberOfImageActors( ); ++n )
-     renderer->AddActor( this->GetImageActor( n ) );
-     renderer->AddActor( this->m_CursorActor );
-     renderer->AddActor( this->m_PlaneActor );
-     renderer->AddActor( this->m_TextActor );
-     renderer->Modified( );
-  */
+  vtkProp* prop;
+  this->InitTraversal( );
+  while( prop = this->GetNextProp( ) )
+    renderer->AddViewProp( prop );
+  renderer->Modified( );
 
   // Configure camera
   vtkCamera* camera = renderer->GetActiveCamera( );
@@ -302,15 +295,11 @@ PopActorsFrom( vtkRenderWindow* window )
   if( renderer != NULL )
   {
     // Update actors
-# error USE vtkActorCollection interface
-    /* TODO
-       for( unsigned int n = 0; n < this->GetNumberOfImageActors( ); ++n )
-       renderer->RemoveActor( this->GetImageActor( n ) );
-       renderer->RemoveActor( this->m_CursorActor );
-       renderer->RemoveActor( this->m_PlaneActor );
-       renderer->RemoveActor( this->m_TextActor );
-       renderer->Modified( );
-    */
+    vtkProp* prop;
+    this->InitTraversal( );
+    while( prop = this->GetNextProp( ) )
+      renderer->RemoveViewProp( prop );
+    renderer->Modified( );
 
   } // fi
   if( rwi != NULL )
@@ -405,11 +394,11 @@ AddActor( vtkActor* actor )
 void cpExtensions::Visualization::ImageSliceActors::
 SetInterpolate( bool v )
 {
-  if( this->Interpolate != v )
+  if( this->m_Interpolate != v )
   {
     for( unsigned int i = 0; i < this->m_ImageActors.size( ); ++i )
       this->m_ImageActors[ i ]->SetInterpolate( v );
-    this->Interpolate = v;
+    this->m_Interpolate = v;
     this->Modified( );
 
   } // fi
@@ -535,26 +524,49 @@ GetImageMap( unsigned int id ) const
     return( NULL );
 }
 
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMinWindow( ) const
+{
+  return( this->m_MinWindow );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMaxWindow( ) const
+{
+  return( this->m_MaxWindow );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMinLevel( ) const
+{
+  return( this->m_MinLevel );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMaxLevel( ) const
+{
+  return( this->m_MaxLevel );
+}
+
 // -------------------------------------------------------------------------
 double cpExtensions::Visualization::ImageSliceActors::
 GetWindow( ) const
 {
-  if( this->m_ImageMaps.size( ) > 0 )
-  {
-    if( this->m_ImageMaps[ 0 ].GetPointer( ) != NULL )
-    {
-      vtkWindowLevelLookupTable* lut =
-        dynamic_cast< vtkWindowLevelLookupTable* >(
-          this->m_ImageMaps[ 0 ]->GetLookupTable( )
-          );
-      if( lut != NULL )
-        return( lut->GetWindow( ) );
-      else
-        return( double( 0 ) );
-    }
-    else
-      return( double( 0 ) );
-  }
+  if( this->m_ImageMaps.size( ) == 0 )
+    return( double( 0 ) );
+  if( this->m_ImageMaps[ 0 ].GetPointer( ) == NULL )
+    return( double( 0 ) );
+
+  vtkWindowLevelLookupTable* lut =
+    dynamic_cast< vtkWindowLevelLookupTable* >(
+      this->m_ImageMaps[ 0 ]->GetLookupTable( )
+      );
+  if( lut != NULL )
+    return( lut->GetWindow( ) );
   else
     return( double( 0 ) );
 }
@@ -563,22 +575,17 @@ GetWindow( ) const
 double cpExtensions::Visualization::ImageSliceActors::
 GetLevel( ) const
 {
-  if( this->m_ImageMaps.size( ) > 0 )
-  {
-    if( this->m_ImageMaps[ 0 ].GetPointer( ) != NULL )
-    {
-      vtkWindowLevelLookupTable* lut =
-        dynamic_cast< vtkWindowLevelLookupTable* >(
-          this->m_ImageMaps[ 0 ]->GetLookupTable( )
-          );
-      if( lut != NULL )
-        return( lut->GetLevel( ) );
-      else
-        return( double( 0 ) );
-    }
-    else
-      return( double( 0 ) );
-  }
+  if( this->m_ImageMaps.size( ) == 0 )
+    return( double( 0 ) );
+  if( this->m_ImageMaps[ 0 ].GetPointer( ) == NULL )
+    return( double( 0 ) );
+
+  vtkWindowLevelLookupTable* lut =
+    dynamic_cast< vtkWindowLevelLookupTable* >(
+      this->m_ImageMaps[ 0 ]->GetLookupTable( )
+      );
+  if( lut != NULL )
+    return( lut->GetLevel( ) );
   else
     return( double( 0 ) );
 }
@@ -587,114 +594,96 @@ GetLevel( ) const
 void cpExtensions::Visualization::ImageSliceActors::
 SetWindow( double w )
 {
-  if( this->m_ImageMaps.size( ) > 0 )
-  {
-    if( this->m_ImageMaps[ 0 ].GetPointer( ) != NULL )
-    {
-      vtkWindowLevelLookupTable* lut =
-        dynamic_cast< vtkWindowLevelLookupTable* >(
-          this->m_ImageMaps[ 0 ]->GetLookupTable( )
-          );
-      if( lut != NULL )
-      {
-        /* TODO: Min and Max values are assigned 0!!!
-           if( w < this->MinWindow )
-           w = this->MinWindow;
-           if( w > this->MaxWindow )
-           w = this->MaxWindow;
-        */
-        lut->SetWindow( w );
-        lut->Build( );
-        this->m_ImageMaps[ 0 ]->Modified( );
-        this->Modified( );
-
-      } // fi
-
-    } // fi
+  if( this->m_ImageMaps.size( ) == 0 )
+    return;
+  if( this->m_ImageMaps[ 0 ].GetPointer( ) == NULL )
+    return;
+  vtkWindowLevelLookupTable* lut =
+    dynamic_cast< vtkWindowLevelLookupTable* >(
+      this->m_ImageMaps[ 0 ]->GetLookupTable( )
+      );
+  if( lut == NULL )
+    return;
 
-  } // fi
+  /* TODO: Min and Max values are assigned 0!!!
+     if( w < this->MinWindow )
+     w = this->MinWindow;
+     if( w > this->MaxWindow )
+     w = this->MaxWindow;
+  */
+  lut->SetWindow( w );
+  lut->Build( );
+  this->m_ImageMaps[ 0 ]->Modified( );
+  this->Modified( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
 SetLevel( double l )
 {
-  if( this->m_ImageMaps.size( ) > 0 )
-  {
-    if( this->m_ImageMaps[ 0 ].GetPointer( ) != NULL )
-    {
-      vtkWindowLevelLookupTable* lut =
-        dynamic_cast< vtkWindowLevelLookupTable* >(
-          this->m_ImageMaps[ 0 ]->GetLookupTable( )
-          );
-      if( lut != NULL )
-      {
-        /* TODO: Min and Max values are assigned 0!!!
-           if( l < this->MinLevel )
-           l = this->MinLevel;
-           if( l > this->MaxLevel )
-           l = this->MaxLevel;
-        */
-        lut->SetLevel( l );
-        lut->Build( );
-        this->m_ImageMaps[ 0 ]->Modified( );
-        this->Modified( );
-
-      } // fi
-
-    } // fi
+  if( this->m_ImageMaps.size( ) == 0 )
+    return;
+  if( this->m_ImageMaps[ 0 ].GetPointer( ) == NULL )
+    return;
+  vtkWindowLevelLookupTable* lut =
+    dynamic_cast< vtkWindowLevelLookupTable* >(
+      this->m_ImageMaps[ 0 ]->GetLookupTable( )
+      );
+  if( lut == NULL )
+    return;
 
-  } // fi
+  /* TODO: Min and Max values are assigned 0!!!
+     if( l < this->MinLevel )
+     l = this->MinLevel;
+     if( l > this->MaxLevel )
+     l = this->MaxLevel;
+  */
+  lut->SetLevel( l );
+  lut->Build( );
+  this->m_ImageMaps[ 0 ]->Modified( );
+  this->Modified( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
 SetWindowLevel( double w, double l )
 {
-  if( this->m_ImageMaps.size( ) > 0 )
-  {
-    if( this->m_ImageMaps[ 0 ].GetPointer( ) != NULL )
-    {
-      vtkWindowLevelLookupTable* lut =
-        dynamic_cast< vtkWindowLevelLookupTable* >(
-          this->m_ImageMaps[ 0 ]->GetLookupTable( )
-          );
-      if( lut != NULL )
-      {
-        /* TODO: Min and Max values are assigned 0!!!
-           std::cout << this->MinWindow << " " << this->MaxWindow << std::endl;
-           std::cout << this->MinLevel << " " << this->MaxLevel << std::endl;
-           std::cout << w << " " << l << " <-> " << std::ends;
-           if( w < this->MinWindow )
-           w = this->MinWindow;
-           if( w > this->MaxWindow )
-           w = this->MaxWindow;
-           if( l < this->MinLevel )
-           l = this->MinLevel;
-           if( l > this->MaxLevel )
-           l = this->MaxLevel;
-           std::cout << w << " " << l << std::endl;
-        */
-        lut->SetWindow( w );
-        lut->SetLevel( l );
-        lut->Build( );
-        this->m_ImageMaps[ 0 ]->Modified( );
-        this->Modified( );
-
-      } // fi
-
-    } // fi
+  if( this->m_ImageMaps.size( ) == 0 )
+    return;
+  if( this->m_ImageMaps[ 0 ].GetPointer( ) == NULL )
+    return;
+  vtkWindowLevelLookupTable* lut =
+    dynamic_cast< vtkWindowLevelLookupTable* >(
+      this->m_ImageMaps[ 0 ]->GetLookupTable( )
+      );
+  if( lut == NULL )
+    return;
 
-  } // fi
+  /* TODO: Min and Max values are assigned 0!!!
+     if( w < this->MinWindow )
+     w = this->MinWindow;
+     if( w > this->MaxWindow )
+     w = this->MaxWindow;
+     if( l < this->MinLevel )
+     l = this->MinLevel;
+     if( l > this->MaxLevel )
+     l = this->MaxLevel;
+  */
+  lut->SetWindow( w );
+  lut->SetLevel( l );
+  lut->Build( );
+  this->m_ImageMaps[ 0 ]->Modified( );
+  this->UpdateText( w, l );
+  this->Modified( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
 ResetWindowLevel( )
 {
+  static const double _2 = double( 2 );
   this->SetWindowLevel(
-    this->MaxWindow,
-    ( this->MaxLevel + this->MinLevel ) / double( 2 )
+    this->m_MaxWindow, ( this->m_MaxLevel + this->m_MinLevel ) / _2
     );
 }
 
@@ -997,7 +986,6 @@ UpdateText( )
 void cpExtensions::Visualization::ImageSliceActors::
 UpdateText( double pos[ 3 ] )
 {
-  /* TODO
   if( this->m_SliceMappers.size( ) > 0 )
   {
     char axis;
@@ -1054,7 +1042,6 @@ UpdateText( double pos[ 3 ] )
   this->m_TextActor->SetInput( this->m_TextBuffer );
   this->m_TextActor->Modified( );
   this->Modified( );
-  */
 }
 
 // -------------------------------------------------------------------------
@@ -1085,11 +1072,10 @@ UpdateText( const double& w, const double& l )
 cpExtensions::Visualization::ImageSliceActors::
 ImageSliceActors( )
   : Superclass( ),
-    Interpolate( false )
+    m_Interpolate( false )
 {
   this->Clear( );
-
-  this->SlicesCommand = NULL;
+  this->_ConfigureStyle( );
 }
 
 // -------------------------------------------------------------------------
@@ -1143,10 +1129,10 @@ _ConfigureNewLUT( vtkImageData* data )
     lut->Build( );
     this->m_ImageMaps[ 0 ]->SetLookupTable( lut );
 
-    this->MinWindow = double( 0 );
-    this->MaxWindow = range[ 1 ] - range[ 0 ];
-    this->MinLevel = range[ 0 ];
-    this->MaxLevel = range[ 1 ];
+    this->m_MinWindow = double( 0 );
+    this->m_MaxWindow = range[ 1 ] - range[ 0 ];
+    this->m_MinLevel = range[ 0 ];
+    this->m_MaxLevel = range[ 1 ];
   }
   else
     this->SetLookupTableAsColor( nImgs, 1, 0, 0 );
@@ -1171,7 +1157,7 @@ _ConfigureNewInput( int axis )
     vtkSmartPointer< vtkImageActor >::New( );
   this->m_ImageActors.push_back( actor );
   actor->SetMapper( mapper );
-  actor->SetInterpolate( this->Interpolate );
+  actor->SetInterpolate( this->m_Interpolate );
   actor->Modified( );
 
   if( nImages == 0 )
@@ -1180,6 +1166,8 @@ _ConfigureNewInput( int axis )
 
   if( nImages > 1 )
     this->SetSliceNumber( this->GetSliceNumber( ) );
+  else
+    this->SetSliceNumber( this->GetSliceNumberMaxValue( ) );
   this->Modified( );
 }
 
@@ -1197,12 +1185,22 @@ _MouseMoveCommand(
 
   if( btn == ImageInteractorStyle::ButtonID_None )
   {
+    actors->SetCursor( pos );
     actors->UpdateText( pos );
+    actors->GetStyle( )->GetInteractor( )->Render( );
   }
   else if( btn == ImageInteractorStyle::ButtonID_Left )
   {
-    if( !alt && ctr && !sft && actors->SlicesCommand != NULL )
-      actors->SlicesCommand( pos, actors->GetAxis( ), actors->SlicesData );
+    unsigned int nC = actors->m_SlicesCommands.size( );
+    if( !alt && ctr && !sft && nC > 0 )
+    {
+      for( unsigned int i = 0; i < nC; ++i )
+        actors->m_SlicesCommands[ i ].first(
+          pos, actors->GetAxis( ), actors->m_SlicesCommands[ i ].second
+          );
+      actors->GetStyle( )->GetInteractor( )->Render( );
+
+    } // fi
   }
   else if( btn == ImageInteractorStyle::ButtonID_Middle )
   {
@@ -1217,17 +1215,18 @@ _MouseMoveCommand(
       int a0 = actors->GetAxis( );
       int a1 = ( a0 + 1 ) % 3;
       int a2 = ( a0 + 2 ) % 3;
-      double dx = pos[ a1 ] - actors->StartWindowLevelPos[ a1 ];
-      double dy = pos[ a2 ] - actors->StartWindowLevelPos[ a2 ];
+      double dx = pos[ a1 ] - actors->m_StartWindowLevelPos[ a1 ];
+      double dy = pos[ a2 ] - actors->m_StartWindowLevelPos[ a2 ];
       dx /= bounds[ ( a1 << 1 ) + 1 ] - bounds[ a1 << 1 ];
       dy /= bounds[ ( a2 << 1 ) + 1 ] - bounds[ a2 << 1 ];
 
-      dx *= actors->StartWindowLevel[ 0 ];
-      dy *= actors->StartWindowLevel[ 1 ];
+      dx *= actors->m_StartWindowLevel[ 0 ];
+      dy *= actors->m_StartWindowLevel[ 1 ];
       actors->SetWindowLevel(
-        actors->StartWindowLevel[ 0 ] + dx,
-        actors->StartWindowLevel[ 1 ] + dy
+        actors->m_StartWindowLevel[ 0 ] + dx,
+        actors->m_StartWindowLevel[ 1 ] + dy
         );
+      actors->GetStyle( )->GetInteractor( )->Render( );
 
     } // fi
 
@@ -1246,11 +1245,11 @@ _MouseClickCommand(
   if( actors == NULL )
     return;
 
-  actors->StartWindowLevelPos[ 0 ] = pos[ 0 ];
-  actors->StartWindowLevelPos[ 1 ] = pos[ 1 ];
-  actors->StartWindowLevelPos[ 2 ] = pos[ 2 ];
-  actors->StartWindowLevel[ 0 ] = actors->GetWindow( );
-  actors->StartWindowLevel[ 1 ] = actors->GetLevel( );
+  actors->m_StartWindowLevelPos[ 0 ] = pos[ 0 ];
+  actors->m_StartWindowLevelPos[ 1 ] = pos[ 1 ];
+  actors->m_StartWindowLevelPos[ 2 ] = pos[ 2 ];
+  actors->m_StartWindowLevel[ 0 ] = actors->GetWindow( );
+  actors->m_StartWindowLevel[ 1 ] = actors->GetLevel( );
 }
 
 // -------------------------------------------------------------------------
@@ -1267,17 +1266,14 @@ _MouseDoubleClickCommand(
 
   if( btn == ImageInteractorStyle::ButtonID_Left )
   {
-    if( !alt && !ctr && !sft )
-      actors->SetCursor( pos );
-    else if( !alt && ctr && !sft && actors->SlicesCommand != NULL )
+    unsigned int nC = actors->m_SeedCommands.size( );
+    if( !alt && ctr && !sft && nC > 0 )
     {
-      actors->SlicesCommand( pos, actors->GetAxis( ), actors->SlicesData );
-      for( unsigned int i = 0; i < actors->m_CursorCommands.size( ); ++i )
-        actors->m_CursorCommands[ i ].first(
-          pos,
-          actors->GetAxis( ),
-          actors->m_CursorCommands[ i ].second
+      for( unsigned int i = 0; i < nC; ++i )
+        actors->m_SeedCommands[ i ].first(
+          pos, actors->GetAxis( ), actors->m_SeedCommands[ i ].second
           );
+      actors->GetStyle( )->GetInteractor( )->Render( );
 
     } // fi
   }
@@ -1303,20 +1299,19 @@ _MouseWheelCommand(
   if( !alt && !ctr && !sft )
   {
     actors->SetSliceNumber( actors->GetSliceNumber( ) + dir );
+    actors->GetStyle( )->GetInteractor( )->Render( );
   }
   else if( !alt && !ctr && sft )
   {
     actors->SetSliceNumber( actors->GetSliceNumber( ) + ( dir * 10 ) );
+    actors->GetStyle( )->GetInteractor( )->Render( );
 
   } // fi
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
-_KeyCommand(
-  void* data,
-  const char& key
-  )
+_KeyCommand( void* data, const char& key )
 {
 }
 
index 21eef1e3d5f30a701ee2b4568dcdc29c9e12297e..96d4550c52039613aaf8b96109d6afce535e75a8 100644 (file)
@@ -46,23 +46,18 @@ namespace cpExtensions
     public:
       vtkTypeMacro( ImageSliceActors, vtkPropCollection );
 
-      vtkGetMacro( MinWindow, double );
-      vtkGetMacro( MaxWindow, double );
-      vtkGetMacro( MinLevel, double );
-      vtkGetMacro( MaxLevel, double );
-
     public:
       // Creation
       static ImageSliceActors* New( );
 
-      void AddCursorCommand( TCursorCommand command, void* data );
+      void AddSlicesCommand( TCursorCommand command, void* data );
+      void AddSeedCommand( TCursorCommand command, void* data );
 
       void AddInputConnection( vtkAlgorithmOutput* aout, int axis = 2 );
       void AddInputData( vtkImageData* data, int axis = 2 );
       void Clear( );
 
       void AssociateSlice( Self* other );
-      void SetSlicesCommand( TCursorCommand cmd, void* data );
 
       vtkInteractorStyle* GetStyle( );
       const vtkInteractorStyle* GetStyle( ) const;
@@ -95,6 +90,10 @@ namespace cpExtensions
       vtkImageMapToColors* GetImageMap( unsigned int id );
       const vtkImageMapToColors* GetImageMap( unsigned int id ) const;
 
+      double GetMinWindow( ) const;
+      double GetMaxWindow( ) const;
+      double GetMinLevel( ) const;
+      double GetMaxLevel( ) const;
       double GetWindow( ) const;
       double GetLevel( ) const;
       void SetWindow( double w );
@@ -172,7 +171,8 @@ namespace cpExtensions
       std::vector< vtkSmartPointer< Self > > m_AssociatedSlices;
 
       // Associated commands
-      std::vector< std::pair< TCursorCommand, void* > > m_CursorCommands;
+      std::vector< std::pair< TCursorCommand, void* > > m_SlicesCommands;
+      std::vector< std::pair< TCursorCommand, void* > > m_SeedCommands;
 
       // Other associated actors
       typedef std::pair< vtkAlgorithm*, vtkActor* > TAssociatedActor;
index a02c8bc28d52ad37ff20848e333a3a5d4f1606a8..f755e455eac540902d650b5e40bc65d6471c11b3 100644 (file)
@@ -244,15 +244,17 @@ PushActorsInto(
 
   for( unsigned int j = 0; j < 3; ++j )
   {
-    ImageInteractorStyle* st =
-      dynamic_cast< ImageInteractorStyle* >( this->Slices[ 0 ][ j ]->GetStyle( ) );
-    if( w != NULL )
-      st->AssociateInteractor( w->GetInteractor( ) );
-    for( unsigned int l = 0; l < 3; ++l )
-      if( j != l )
-        st->AssociateInteractor(
-          this->Slices[ 0 ][ l ]->GetStyle( )->GetInteractor( )
-          );
+    /* TODO
+       ImageInteractorStyle* st =
+       dynamic_cast< ImageInteractorStyle* >( this->Slices[ 0 ][ j ]->GetStyle( ) );
+       if( w != NULL )
+       st->AssociateInteractor( w->GetInteractor( ) );
+       for( unsigned int l = 0; l < 3; ++l )
+       if( j != l )
+       st->AssociateInteractor(
+       this->Slices[ 0 ][ l ]->GetStyle( )->GetInteractor( )
+       );
+    */
 
   } // rof
 }
@@ -407,9 +409,11 @@ MPRActors( )
   this->Slices[ 0 ][ 1 ]->AssociateSlice( this->Slices[ 1 ][ 1 ] );
   this->Slices[ 0 ][ 2 ]->AssociateSlice( this->Slices[ 1 ][ 2 ] );
 
-  this->Slices[ 0 ][ 0 ]->SetSlicesCommand( Self::_SetSlices, this );
-  this->Slices[ 0 ][ 1 ]->SetSlicesCommand( Self::_SetSlices, this );
-  this->Slices[ 0 ][ 2 ]->SetSlicesCommand( Self::_SetSlices, this );
+  /* TODO
+     this->Slices[ 0 ][ 0 ]->SetSlicesCommand( Self::_SetSlices, this );
+     this->Slices[ 0 ][ 1 ]->SetSlicesCommand( Self::_SetSlices, this );
+     this->Slices[ 0 ][ 2 ]->SetSlicesCommand( Self::_SetSlices, this );
+  */
 }
 
 // -------------------------------------------------------------------------
index 8b88fdc2687ca93e7ff32ddd36a0f0c095c26dbc..24967800a36e80ab093e91bdb64913e2c2f1807a 100644 (file)
@@ -32,9 +32,9 @@ namespace cpExtensions
 
       void AddCursorCommand( TCursorCommand command, void* data )
       {
-        this->Slices[ 0 ][ 0 ]->AddCursorCommand( command, data );
-        this->Slices[ 0 ][ 1 ]->AddCursorCommand( command, data );
-        this->Slices[ 0 ][ 2 ]->AddCursorCommand( command, data );
+        this->Slices[ 0 ][ 0 ]->AddSlicesCommand( command, data );
+        this->Slices[ 0 ][ 1 ]->AddSlicesCommand( command, data );
+        this->Slices[ 0 ][ 2 ]->AddSlicesCommand( command, data );
       }
 
       ImageSliceActors* GetSliceActors( const int& i ) const;