]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageSliceActors.h
Parameters are now part of the pipeline update process
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageSliceActors.h
index 962c8f2b0cf0b2388981f949b1be19f85d768236..22bfe6a7f39ee551158ffbe80cfa67066676c559 100644 (file)
@@ -22,6 +22,7 @@
 // -------------------------------------------------------------------------
 class vtkAlgorithmOutput;
 class vtkImageData;
+class vtkLookupTable;
 
 // -------------------------------------------------------------------------
 namespace cpExtensions
@@ -41,26 +42,17 @@ namespace cpExtensions
     public:
       vtkTypeMacro( ImageSliceActors, vtkPropCollection );
 
-      enum LUTType
-      {
-        LUTType_None = 0,
-        LUTType_WindowLevel,
-        LUTType_Colors
-      };
+      vtkGetMacro( MinWindow, double );
+      vtkGetMacro( MaxWindow, double );
+      vtkGetMacro( MinLevel, double );
+      vtkGetMacro( MaxLevel, double );
 
     public:
       // Creation
       static ImageSliceActors* New( );
 
-      void AddInputConnection(
-        vtkAlgorithmOutput* aout,
-        int axis = 2,
-        LUTType lut = Self::LUTType_None
-        );
-      void AddInputData(
-        vtkImageData* data,
-        int axis = 2,
-        LUTType lut = Self::LUTType_None );
+      void AddInputConnection( vtkAlgorithmOutput* aout, int axis = 2 );
+      void AddInputData( vtkImageData* data, int axis = 2 );
       void Clear( );
 
       void AssociateSlice( Self* other );
@@ -97,12 +89,17 @@ namespace cpExtensions
       vtkImageMapToColors* GetImageMap( unsigned int id );
       const vtkImageMapToColors* GetImageMap( unsigned int id ) const;
 
-      double GetWindow( unsigned int id ) const;
-      double GetLevel( unsigned int id ) const;
-      void SetWindow( unsigned int id, double w );
-      void SetLevel( unsigned int id, double l );
-      void SetWindowLevel( unsigned int id, double w, double l );
-      void ResetWindowLevel( unsigned int id );
+      double GetWindow( ) const;
+      double GetLevel( ) const;
+      void SetWindow( double w );
+      void SetLevel( double l );
+      void SetWindowLevel( double w, double l );
+      void ResetWindowLevel( );
+
+      void SetLookupTable( unsigned int id, vtkLookupTable* lut );
+      void SetLookupTableAsColor(
+        unsigned int id, double r, double g, double b
+        );
 
       int GetAxis( ) const;
       int GetSliceNumber( ) const;
@@ -118,7 +115,7 @@ namespace cpExtensions
       ImageSliceActors( );
       virtual ~ImageSliceActors( );
 
-      void _ConfigureNewLUT( vtkImageData* data, LUTType lut_t );
+      void _ConfigureNewLUT( vtkImageData* data );
       void _ConfigureNewInput( int axis );
 
       // Events
@@ -160,6 +157,10 @@ namespace cpExtensions
       std::vector< vtkSmartPointer< vtkImageActor > >       ImageActors;
       bool Interpolate;
 
+      // Window-Level values
+      double MinWindow, MaxWindow;
+      double MinLevel, MaxLevel;
+
       // Other associated slices
       std::vector< vtkSmartPointer< Self > > AssociatedSlices;
       TCursorCommand SlicesCommand;
@@ -175,7 +176,7 @@ namespace cpExtensions
       vtkSmartPointer< vtkPolyDataMapper > CursorMapper;
       vtkSmartPointer< vtkActor >          CursorActor;
       vtkSmartPointer< vtkPlane >          PlaneFunction;
-      vtkSmartPointer< vtkPolyData >       PlaneSource;
+      vtkSmartPointer< vtkPolyData >       Plane;
       vtkSmartPointer< vtkPolyDataMapper > PlaneMapper;
       char                                 TextBuffer[ 1024 ];
       vtkSmartPointer< vtkTextActor >      TextActor;