1 /* =======================================================================
2 * @author: Leonardo Florez-Valencia
3 * @email: florez-l@javeriana.edu.co
4 * =======================================================================
7 #ifndef __ivq__VTK__ImageViewer__h__
8 #define __ivq__VTK__ImageViewer__h__
10 #include <ivq/ivq_export.h>
12 #include <vtkSmartPointer.h>
13 #include <vtkObject.h>
16 class vtkAlgorithmOutput;
17 class vtkCornerAnnotation;
23 class vtkRenderWindow;
24 class vtkRenderWindowInteractor;
31 class InteractorStyleImage;
36 class IVQ_EXPORT ImageViewer
40 typedef ImageViewer Self;
43 vtkTypeMacro( ImageViewer, vtkObject );
45 vtkGetMacro( SliceOrientation, int );
46 vtkGetMacro( Slice, int );
47 vtkBooleanMacro( OffScreenRendering, int );
52 virtual vtkRenderWindow* GetRenderWindow( );
53 virtual vtkRenderer* GetRenderer( );
54 virtual ivq::VTK::ImageActor* GetImageActor( );
55 virtual ivq::VTK::InteractorStyleImage* GetInteractorStyle( );
57 virtual const char* GetWindowName( );
58 virtual void Render( );
60 virtual void SetInputData( vtkImageData* in );
61 virtual vtkImageData* GetInput( );
62 virtual void SetInputConnection( vtkAlgorithmOutput* input );
66 SLICE_ORIENTATION_YZ = 0,
67 SLICE_ORIENTATION_XZ = 1,
68 SLICE_ORIENTATION_XY = 2
70 virtual void SetSliceOrientation( int orientation );
71 virtual void SetSliceOrientationToXY( );
72 virtual void SetSliceOrientationToYZ( );
73 virtual void SetSliceOrientationToXZ( );
75 virtual void SetSlice( int s );
77 virtual void UpdateDisplayExtent( );
79 virtual int GetSliceMin( );
80 virtual int GetSliceMax( );
81 virtual void GetSliceRange( int range[ 2 ] );
82 virtual void GetSliceRange( int& min, int& max );
83 virtual int* GetSliceRange( );
85 virtual double GetColorWindow( );
86 virtual double GetColorLevel( );
87 virtual void SetColorWindow( double s );
88 virtual void SetColorLevel( double s );
90 virtual void SetDisplayId( void* a );
91 virtual void SetWindowId( void* a );
92 virtual void SetParentId( void* a );
94 virtual int* GetPosition( );
95 virtual void SetPosition( int a, int b );
96 virtual void SetPosition( int a[ 2 ] );
98 virtual int* GetSize( );
99 virtual void SetSize( int a, int b );
100 virtual void SetSize( int a[ 2 ] );
102 virtual void SetRenderWindow( vtkRenderWindow* win );
103 virtual void SetRenderer( vtkRenderer* ren );
104 virtual void SetupInteractor( );
105 virtual void SetupInteractor( vtkRenderWindowInteractor* rwi );
107 virtual void SetOffScreenRendering( int v );
108 virtual int GetOffScreenRendering( );
110 virtual void ResetCamera( );
111 virtual void Initialize( );
112 virtual void Start( );
114 virtual void GetFocalPoint( double point[ 3 ], int ijk[ 3 ] );
118 virtual ~ImageViewer( );
120 virtual void _InstallPipeline( );
121 virtual void _UnInstallPipeline( );
122 virtual void _UpdateOrientation( );
124 vtkAlgorithm* _GetInputAlgorithm( );
125 vtkInformation* _GetInputInformation( );
128 // Purposely not implemented.
129 ImageViewer( const ImageViewer& other );
130 void operator=( const ImageViewer& other );
133 vtkSmartPointer< vtkRenderWindow > RenderWindow;
134 vtkSmartPointer< vtkRenderer > Renderer;
135 vtkSmartPointer< ivq::VTK::ImageActor > ImageActor;
136 vtkSmartPointer< vtkRenderWindowInteractor > Interactor;
137 vtkSmartPointer< ivq::VTK::InteractorStyleImage > InteractorStyle;
139 int SliceOrientation;
143 vtkSmartPointer< vtkPropPicker > PropPicker;
144 vtkSmartPointer< vtkCornerAnnotation > CornerAnnotation;
146 vtkSmartPointer< vtkCursor3D > CursorSource;
147 vtkSmartPointer< ivq::VTK::PolyDataActor > CursorActor;
149 static const double CursorColors[ 3 ][ 3 ];
151 friend class ImageViewerCallback;
158 #endif // __ivq__VTK__ImageViewer__h__