vtkgdcm
vtkImageColorViewer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
56 #ifndef VTKIMAGECOLORVIEWER_H
57 #define VTKIMAGECOLORVIEWER_H
58 
59 #include "vtkObject.h"
60 #include "vtkVersion.h"
61 
62 class vtkAlgorithm;
63 class vtkAlgorithmOutput;
64 class vtkImageActor;
65 class vtkImageData;
67 class vtkInformation;
68 class vtkInteractorStyleImage;
69 class vtkRenderWindow;
70 class vtkRenderer;
71 class vtkRenderWindowInteractor;
72 class vtkPolyData;
73 
74 class VTK_EXPORT vtkImageColorViewer : public vtkObject
75 {
76 public:
77  static vtkImageColorViewer *New();
78  vtkTypeMacro(vtkImageColorViewer,vtkObject);
79  void PrintSelf(ostream& os, vtkIndent indent);
80 
84  virtual const char *GetWindowName();
85 
89  virtual void Render(void);
90 
92 
95 #if (VTK_MAJOR_VERSION >= 6)
96  virtual void SetInputData(vtkImageData *in);
97 #else
98  virtual void SetInput(vtkImageData *in);
99 #endif
100  virtual vtkImageData *GetInput();
101  virtual void SetInputConnection(vtkAlgorithmOutput* input);
102  virtual void AddInputConnection(vtkAlgorithmOutput* input);
103  virtual void AddInput(vtkImageData * input);
104  //virtual void AddInput(vtkPolyData * input);
106 
107  double GetOverlayVisibility();
108  void SetOverlayVisibility(double vis);
109 
111 
115  enum
116  {
117  SLICE_ORIENTATION_YZ = 0,
118  SLICE_ORIENTATION_XZ = 1,
119  SLICE_ORIENTATION_XY = 2
120  };
121  //ETX
122  vtkGetMacro(SliceOrientation, int);
123  virtual void SetSliceOrientation(int orientation);
124  virtual void SetSliceOrientationToXY()
125  { this->SetSliceOrientation(vtkImageColorViewer::SLICE_ORIENTATION_XY); };
126  virtual void SetSliceOrientationToYZ()
127  { this->SetSliceOrientation(vtkImageColorViewer::SLICE_ORIENTATION_YZ); };
128  virtual void SetSliceOrientationToXZ()
129  { this->SetSliceOrientation(vtkImageColorViewer::SLICE_ORIENTATION_XZ); };
131 
133 
137  vtkGetMacro(Slice, int);
138  virtual void SetSlice(int s);
140 
153  virtual void UpdateDisplayExtent();
154 
156 
160  virtual int GetSliceMin();
161  virtual int GetSliceMax();
162  virtual void GetSliceRange(int range[2])
163  { this->GetSliceRange(range[0], range[1]); }
164  virtual void GetSliceRange(int &min, int &max);
165  virtual int* GetSliceRange();
167 
169 
172  virtual double GetColorWindow();
173  virtual double GetColorLevel();
174  virtual void SetColorWindow(double s);
175  virtual void SetColorLevel(double s);
177 
179 
182  virtual void SetDisplayId(void *a);
183  virtual void SetWindowId(void *a);
184  virtual void SetParentId(void *a);
186 
188 
191  virtual int* GetPosition();
192  virtual void SetPosition(int a,int b);
193  virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); }
195 
197 
200  virtual int* GetSize();
201  virtual void SetSize(int a, int b);
202  virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); }
204 
206 
210  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
211  vtkGetObjectMacro(Renderer, vtkRenderer);
212  vtkGetObjectMacro(ImageActor,vtkImageActor);
213  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors2);
214  vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage);
216 
218 
221  virtual void SetRenderWindow(vtkRenderWindow *arg);
222  virtual void SetRenderer(vtkRenderer *arg);
224 
228  virtual void SetupInteractor(vtkRenderWindowInteractor*);
229 
231 
236  virtual void SetOffScreenRendering(int);
237  virtual int GetOffScreenRendering();
238  vtkBooleanMacro(OffScreenRendering,int);
240 
244  VTK_LEGACY(int GetWholeZMin());
245 
249  VTK_LEGACY(int GetWholeZMax());
250 
254  VTK_LEGACY(int GetZSlice());
255 
259  VTK_LEGACY(void SetZSlice(int));
260 
261 protected:
264 
265  virtual void InstallPipeline();
266  virtual void UnInstallPipeline();
267 
269  vtkRenderWindow *RenderWindow;
270  vtkRenderer *Renderer;
271  vtkImageActor *ImageActor;
272  vtkImageActor *OverlayImageActor;
273  vtkRenderWindowInteractor *Interactor;
274  vtkInteractorStyleImage *InteractorStyle;
275 
278  int Slice;
279 
280  virtual void UpdateOrientation();
281 
282 #if (VTK_MAJOR_VERSION >= 6)
283  vtkAlgorithm* GetInputAlgorithm();
284  vtkInformation* GetInputInformation();
285 #endif
286 
287  friend class vtkImageColorViewerCallback;
288 
289 private:
290  vtkImageColorViewer(const vtkImageColorViewer&); // Not implemented.
291  void operator=(const vtkImageColorViewer&); // Not implemented.
292 };
293 
294 #endif
vtkImageColorViewer::SetSliceOrientationToXY
virtual void SetSliceOrientationToXY()
Definition: vtkImageColorViewer.h:124
vtkImageColorViewer::GetSliceRange
virtual void GetSliceRange(int range[2])
Definition: vtkImageColorViewer.h:162
vtkImageColorViewer::SetPosition
virtual void SetPosition(int a[2])
Definition: vtkImageColorViewer.h:193
vtkImageColorViewer
Display a 2D image.
Definition: vtkImageColorViewer.h:74
vtkImageColorViewer::SetSliceOrientationToXZ
virtual void SetSliceOrientationToXZ()
Definition: vtkImageColorViewer.h:128
vtkImageColorViewer::SliceOrientation
int SliceOrientation
Definition: vtkImageColorViewer.h:276
vtkImageColorViewer::Renderer
vtkRenderer * Renderer
Definition: vtkImageColorViewer.h:270
vtkImageColorViewer::OverlayImageActor
vtkImageActor * OverlayImageActor
Definition: vtkImageColorViewer.h:272
vtkImageColorViewer::SLICE_ORIENTATION_XY
Definition: vtkImageColorViewer.h:119
vtkImageColorViewer::SetSize
virtual void SetSize(int a[2])
Definition: vtkImageColorViewer.h:202
vtkImageColorViewer::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkImageColorViewer.h:273
vtkImageColorViewer::InteractorStyle
vtkInteractorStyleImage * InteractorStyle
Definition: vtkImageColorViewer.h:274
vtkImageColorViewer::Slice
int Slice
Definition: vtkImageColorViewer.h:278
vtkImageColorViewer::WindowLevel
vtkImageMapToWindowLevelColors2 * WindowLevel
Definition: vtkImageColorViewer.h:268
vtkImageColorViewer::ImageActor
vtkImageActor * ImageActor
Definition: vtkImageColorViewer.h:271
vtkImageMapToWindowLevelColors2
map the input image through a lookup table and window / level it
Definition: vtkImageMapToWindowLevelColors2.h:51
vtkImageColorViewer::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkImageColorViewer.h:269
vtkImageColorViewer::SetSliceOrientationToYZ
virtual void SetSliceOrientationToYZ()
Definition: vtkImageColorViewer.h:126
vtkImageColorViewer::SLICE_ORIENTATION_XZ
Definition: vtkImageColorViewer.h:118
vtkImageColorViewer::SLICE_ORIENTATION_YZ
Definition: vtkImageColorViewer.h:117
vtkImageColorViewer::FirstRender
int FirstRender
Definition: vtkImageColorViewer.h:277