]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageSliceActors.h
...
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageSliceActors.h
index 3991ab39419309ec5f7399ea3e3a7381128cf2a7..25f81f6fae52a849e86019fe9a2b2c84e6b1dfcd 100644 (file)
@@ -1,98 +1,74 @@
-#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
-#define __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
+#ifndef __cpExtensions__Visualization__ImageSliceActors__h__
+#define __cpExtensions__Visualization__ImageSliceActors__h__
 
-#include <cpExtensions/cpExtensions_Export.h>
-
-#include <vtkActor.h>
-#include <vtkImageActor.h>
-#include <vtkImageSliceMapper.h>
-#include <vtkPolyData.h>
-#include <vtkPolyDataMapper.h>
+#include <cpExtensions/Config.h>
 #include <vtkPropCollection.h>
 #include <vtkSmartPointer.h>
-#include <vtkTextActor.h>
-
-// -------------------------------------------------------------------------
-#define cpPlugins_ImageSliceActors( name, type )                        \
-  inline type* Get##name##Actor( ) const                                \
-  {                                                                     \
-    return(                                                             \
-      dynamic_cast< type* >(                                            \
-        const_cast< Self* >( this )->                                   \
-        GetItemAsObject( this->name##ActorIndex )                       \
-        )                                                               \
-      );                                                                \
-  }
 
 // -------------------------------------------------------------------------
-class vtkAlgorithmOutput;
 class vtkImageData;
 
 // -------------------------------------------------------------------------
 namespace cpExtensions
+{
+  namespace Visualization
   {
-    namespace Visualization
+    class ImageOutlineActor;
+    class LUTImageActor;
+    class WindowLevelImageActor;
+
+    /**
+     */
+    class cpExtensions_EXPORT ImageSliceActors
+      : public vtkPropCollection
     {
-      /**
-       */
-      class cpExtensions_EXPORT ImageSliceActors
-        : public vtkPropCollection
-      {
-      public:
-        typedef ImageSliceActors Self;
-
-      public:
-        vtkTypeMacro( ImageSliceActors, vtkPropCollection );
-
-        cpPlugins_ImageSliceActors( Image, vtkImageActor );
-        cpPlugins_ImageSliceActors( Text, vtkTextActor );
-        cpPlugins_ImageSliceActors( Plane, vtkActor );
-
-      public:
-        // Creation
-        static ImageSliceActors* New( );
-
-        void SetInputConnection( vtkAlgorithmOutput* aout, int axis );
-        void SetInputData( vtkImageData* data, int axis );
-
-        double* GetDisplayBounds( ) const;
-        void GetDisplayBounds( double bounds[ 6 ] ) const;
-
-        int GetAxis( ) const;
-        int GetSliceNumber( ) const;
-        int GetSliceNumberMinValue( ) const;
-        int GetSliceNumberMaxValue( ) const;
-        void SetSliceNumber( const int& slice );
-        void UpdateText( );
-
-      protected:
-        ImageSliceActors( );
-        virtual ~ImageSliceActors( );
-
-      private:
-        // Purposely not implemented
-        ImageSliceActors( const Self& );
-        Self& operator=( const Self& );
-
-      protected:
-        vtkSmartPointer< vtkImageSliceMapper > SliceMapper;
-        vtkSmartPointer< vtkPolyData >         PlaneSource;
-        vtkSmartPointer< vtkPolyDataMapper >   PlaneMapper;
-        char                                   TextBuffer[ 1024 ];
-
-        vtkSmartPointer< vtkImageActor > ImageActor;
-        vtkSmartPointer< vtkTextActor >  TextActor;
-        vtkSmartPointer< vtkActor >      PlaneActor;
-
-        unsigned int ImageActorIndex;
-        unsigned int TextActorIndex;
-        unsigned int PlaneActorIndex;
-      };
-
-    } // ecapseman
+    public:
+      typedef ImageSliceActors Self;
+
+    public:
+      vtkTypeMacro( ImageSliceActors, vtkPropCollection );
+
+    public:
+      static Self* New( );
+
+      vtkImageData* GetImage( );
+      const vtkImageData* GetImage( ) const;
+
+      WindowLevelImageActor* GetWindowLevelImageActor( );
+      const WindowLevelImageActor* GetWindowLevelImageActor( ) const;
+
+      LUTImageActor* GetLUTImageActor( );
+      const LUTImageActor* GetLUTImageActor( ) const;
+
+      ImageOutlineActor* GetImageOutlineActor( );
+      const ImageOutlineActor* GetImageOutlineActor( ) const;
+
+      int GetOrientation( ) const;
+
+      int GetSliceNumber( ) const;
+      virtual void SetImage( vtkImageData* image, int orientation );
+      virtual unsigned int AddLUTImage( vtkImageData* image );
+      virtual void SetSliceNumber( int slice );
+
+    protected:
+      ImageSliceActors( );
+      virtual ~ImageSliceActors( );
+
+    private:
+      // Purposely not implemented
+      ImageSliceActors( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      vtkSmartPointer< ImageOutlineActor >     m_ImageOutlineActor;
+      vtkSmartPointer< LUTImageActor >         m_LUTImageActor;
+      vtkSmartPointer< WindowLevelImageActor > m_WindowLevelImageActor;
+    };
+
+  } // ecapseman
 
 } // ecapseman
 
-#endif //  __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
+#endif // __cpExtensions__Visualization__ImageSliceActors__h__
 
 // eof - $RCSfile$