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