]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Extensions/Visualization/MPRActors.h
d46fa48f68ba664699ca37d365a9c2cc0ec40aa4
[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 #include <vtkImageMapToWindowLevelColors.h>
10
11 class vtkRenderer;
12
13 namespace cpPlugins
14 {
15   namespace Extensions
16   {
17     namespace Visualization
18     {
19       /**
20        */
21       class cpPlugins_Extensions_EXPORT MPRActors
22         : public vtkPropCollection
23       {
24       public:
25         typedef MPRActors Self;
26
27       public:
28         vtkTypeMacro( MPRActors, vtkPropCollection );
29
30         cpPlugins_ImageSliceActors( ImageOutline, vtkImageActor );
31
32       public:
33         // Creation
34         static MPRActors* New( );
35
36         ImageSliceActors* GetSliceActors( const int& i ) const;
37         void SetInputData( vtkImageData* image );
38         void SetSegmentationData( vtkImageData* segmentation );
39
40         void PushDataInto(
41           vtkRenderer* x,
42           vtkRenderer* y,
43           vtkRenderer* z,
44           vtkRenderer* w
45           );
46         void PopDataFrom(
47           vtkRenderer* x,
48           vtkRenderer* y,
49           vtkRenderer* z,
50           vtkRenderer* w
51           );
52
53         // Window/Level
54         double GetMinWindow( ) const;
55         double GetMaxWindow( ) const;
56         double GetMinLevel( ) const;
57         double GetMaxLevel( ) const;
58         double GetWindow( ) const;
59         double GetLevel( ) const;
60         void SetWindow( const double& w );
61         void SetLevel( const double& l );
62         void SetWindowLevel( const double& w, const double& l );
63         void ResetWindowLevel( );
64
65         // Slice access
66         vtkPlane* GetSlicePlane( const int& axis ) const;
67         int GetSliceNumberMinValue( const int& axis ) const;
68         int GetSliceNumberMaxValue( const int& axis ) const;
69         int GetSlice( const int& axis ) const;
70         void SetSlice( const int& axis, const int& slice );
71         void SetSlice( const int& axis, const double& slice );
72         void ResetSlices( );
73
74         // General accessors 
75         void GetImageBounds( double bounds[ 6 ] ) const;
76
77       protected:
78         MPRActors( );
79         virtual ~MPRActors( );
80
81       private:
82         // Purposely not implemented
83         MPRActors( const Self& );
84         Self& operator=( const Self& );
85
86       protected:
87         vtkImageData* Image;
88         vtkImageData* Segmentation;
89
90         vtkSmartPointer< vtkImageMapToWindowLevelColors > ImageToWindowLevel;
91         vtkSmartPointer< vtkImageMapToColors >            SegmentationToColors;
92
93         vtkSmartPointer< vtkActor > ImageOutlineActor;
94
95         typedef cpPlugins::Extensions::Visualization::ImageSliceActors TSlice;
96         vtkSmartPointer< TSlice > Slices[ 3 ];
97
98         unsigned int ImageOutlineActorIndex;
99       };
100
101     } // ecapseman
102
103   } // ecapseman
104
105 } // ecapseman
106
107 #endif //  __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRACTORS__H__
108
109 // eof - $RCSfile$