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