]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/QT/ImageWidget.h
Raster filter updated. LUT image visualization strange bug :-(
[cpPlugins.git] / lib / cpExtensions / QT / ImageWidget.h
1 #ifndef __cpExtensions__QT__ImageWidget__h__
2 #define __cpExtensions__QT__ImageWidget__h__
3
4 #include <cpExtensions/QT/RendererWidget.h>
5
6 #ifdef cpExtensions_QT4
7
8 // -------------------------------------------------------------------------
9 class vtkDataSet;
10
11 // -------------------------------------------------------------------------
12 namespace cpExtensions
13 {
14   namespace Visualization
15   {
16     class OutlineSource;
17     class LUTImageActor;
18     class WindowLevelImageActor;
19     class MeshActor;
20   }
21   namespace Interaction { class ImageSliceStyle; }
22
23   namespace QT
24   {
25     /**
26      */
27     class cpExtensions_EXPORT ImageWidget
28       : public RendererWidget
29     {
30       Q_OBJECT;
31
32     public:
33       typedef ImageWidget    Self;
34       typedef RendererWidget Superclass;
35
36       typedef cpExtensions::Visualization::OutlineSource         TOutline;
37       typedef cpExtensions::Visualization::MeshActor             TActor;
38       typedef cpExtensions::Visualization::LUTImageActor         TLUTActor;
39       typedef cpExtensions::Visualization::WindowLevelImageActor TWLActor;
40       typedef cpExtensions::Interaction::ImageSliceStyle         TStyle;
41
42     public:
43       explicit ImageWidget( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
44       virtual ~ImageWidget( );
45
46       void Clear( );
47       void SetImage(
48         vtkImageData* image, int orientation, const std::string& name
49         );
50       void Add( vtkDataSet* data, const std::string& name );
51       virtual void ResetCamera( ) cpExtensions_OVERRIDE;
52
53       TWLActor* GetImageActor( );
54       const TWLActor* GetImageActor( ) const;
55
56       void SetColor( const std::string& name, double r, double g, double b );
57       void SetLineWidth( const std::string& name, double w );
58
59       /* TODO
60          void SetImage(
61          vtkImageData* image, int orientation, const std::string& name
62          );
63
64          // TODO: std::vector< vtkProp* > GetActors( const std::string& name ) const;
65          int GetOrientation( ) const;
66          void SetSliceNumber( int slice );
67
68
69          void GetScalarRange( double r[ 2 ] ) const;
70          void GetWindowLevel( double wl[ 2 ] ) const;
71          double GetImageOpacity( ) const;
72          unsigned char GetImageInterpolation( ) const;
73
74          void SetScalarRange( double r[ 2 ] );
75          void SetWindowLevel( double wl[ 2 ] );
76          void SetImageOpacity( double o );
77          void SetImageInterpolation( unsigned char i );
78
79          vtkProp* GetImageActor( );
80          const vtkProp* GetImageActor( ) const;
81       */
82
83     protected:
84       std::string m_ImageName;
85
86       vtkSmartPointer< TWLActor > m_WLActor;
87       vtkSmartPointer< TLUTActor > m_LUTActor;
88       vtkSmartPointer< TOutline > m_Outline;
89       TActor* m_OutlineActor;
90       std::vector< TActor* > m_Actors;
91
92       vtkSmartPointer< TStyle > m_Style;
93
94       /* TODO
95          protected:
96          vtkSmartPointer< cpExtensions::Visualization::ImageViewerActors >
97          m_ImageViewerActors;
98          vtkSmartPointer< cpExtensions::Interaction::ImageSliceStyle >
99          m_ImageSliceStyle;
100          std::string m_ImageName;
101       */
102     };
103
104   } // ecapseman
105
106 } // ecapseman
107
108 #endif // cpExtensions_QT4
109
110 #endif // __cpExtensions__QT__ImageWidget__h__
111
112 // eof - $RCSfile$