]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Extensions/Visualization/MPRActors.h
e7af3ff3e4b957bcfc4c59a8186eee108e5682b1
[cpPlugins.git] / lib / cpPlugins / Extensions / Visualization / MPRActors.h
1 #ifndef __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRACTORS__H__
2 #define __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRACTORS__H__
3
4 #include <cpPlugins/Extensions/cpPlugins_Extensions_Export.h>
5 #include <cpPlugins/Extensions/Visualization/ImageSliceActors.h>
6
7 #include <vtkActor.h>
8 #include <vtkImageMapToColors.h>
9
10 // -------------------------------------------------------------------------
11 class vtkAlgorithmOutput;
12 class vtkImageData;
13 class vtkRenderer;
14 class vtkScalarsToColors;
15 class vtkWindowLevelLookupTable;
16
17 // -------------------------------------------------------------------------
18 namespace cpPlugins
19 {
20   namespace Extensions
21   {
22     namespace Visualization
23     {
24       /**
25        */
26       class cpPlugins_Extensions_EXPORT MPRActors
27         : public vtkPropCollection
28       {
29       public:
30         typedef MPRActors Self;
31
32       public:
33         vtkTypeMacro( MPRActors, vtkPropCollection );
34
35         cpPlugins_ImageSliceActors( ImageOutline, vtkImageActor );
36
37       public:
38         // Creation
39         static MPRActors* New( );
40
41         ImageSliceActors* GetSliceActors( const int& i ) const;
42         void SetInputConnection( vtkAlgorithmOutput* aout );
43         void SetInputData( vtkImageData* image );
44
45         void PushDataInto(
46           vtkRenderer* x,
47           vtkRenderer* y,
48           vtkRenderer* z,
49           vtkRenderer* w
50           );
51         void PopDataFrom(
52           vtkRenderer* x,
53           vtkRenderer* y,
54           vtkRenderer* z,
55           vtkRenderer* w
56           );
57
58         // Lookup table methods
59         vtkScalarsToColors* GetLookupTable( ) const;
60         void SetLookupTable( vtkScalarsToColors* lut );
61
62         // Grayscale window/level lookup
63         vtkWindowLevelLookupTable* GetLookupTableAsWindowLevel( ) const;
64         void SetLookupTableToWindowLevel( );
65         double GetMinWindow( ) const;
66         double GetMaxWindow( ) const;
67         double GetMinLevel( ) const;
68         double GetMaxLevel( ) const;
69         double GetWindow( ) const;
70         double GetLevel( ) const;
71         void SetWindow( const double& w );
72         void SetLevel( const double& l );
73         void SetWindowLevel( const double& w, const double& l );
74         void ResetWindowLevel( );
75
76         // Slice access
77         int GetSliceNumberMinValue( const int& axis ) const;
78         int GetSliceNumberMaxValue( const int& axis ) const;
79         int GetSlice( const int& axis ) const;
80         void SetSlice( const int& axis, const int& slice );
81         void SetSlice( const int& axis, const double& slice );
82         void ResetSlices( );
83
84         // General accessors 
85         void GetImageBounds( double bounds[ 6 ] ) const;
86
87       protected:
88         MPRActors( );
89         virtual ~MPRActors( );
90
91         vtkImageData* _InputImage( ) const;
92         void _UpdateSlices( );
93
94       private:
95         // Purposely not implemented
96         MPRActors( const Self& );
97         Self& operator=( const Self& );
98
99       protected:
100         vtkSmartPointer< vtkImageMapToColors > ImageMapToColors;
101         vtkSmartPointer< vtkActor >            ImageOutlineActor;
102
103         typedef
104           cpPlugins::Extensions::Visualization::ImageSliceActors
105           _TSlice;
106         vtkSmartPointer< _TSlice > Slices[ 3 ];
107
108         unsigned int ImageOutlineActorIndex;
109       };
110
111     } // ecapseman
112
113   } // ecapseman
114
115 } // ecapseman
116
117 #endif //  __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRACTORS__H__
118
119 // eof - $RCSfile$