VTK
vtkImageViewer2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageViewer2.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
59 #ifndef __vtkImageViewer2_h
60 #define __vtkImageViewer2_h
61 
62 #include "vtkObject.h"
63 
64 class vtkAlgorithmOutput;
65 class vtkImageActor;
66 class vtkImageData;
69 class vtkRenderWindow;
70 class vtkRenderer;
72 
74 {
75 public:
76  static vtkImageViewer2 *New();
77  vtkTypeMacro(vtkImageViewer2,vtkObject);
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
81  virtual const char *GetWindowName();
82 
84  virtual void Render(void);
85 
87 
88  virtual void SetInput(vtkImageData *in);
89  virtual vtkImageData *GetInput();
90  virtual void SetInputConnection(vtkAlgorithmOutput* input);
92 
94 
95  enum
96  {
97  SLICE_ORIENTATION_YZ = 0,
98  SLICE_ORIENTATION_XZ = 1,
99  SLICE_ORIENTATION_XY = 2
100  };
101  //ETX
102  vtkGetMacro(SliceOrientation, int);
103  virtual void SetSliceOrientation(int orientation);
104  virtual void SetSliceOrientationToXY()
105  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY); };
106  virtual void SetSliceOrientationToYZ()
107  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ); };
108  virtual void SetSliceOrientationToXZ()
109  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ); };
111 
113 
115  vtkGetMacro(Slice, int);
116  virtual void SetSlice(int s);
118 
128  virtual void UpdateDisplayExtent();
129 
131 
133  virtual int GetSliceMin();
134  virtual int GetSliceMax();
135  virtual void GetSliceRange(int range[2])
136  { this->GetSliceRange(range[0], range[1]); }
137  virtual void GetSliceRange(int &min, int &max);
138  virtual int* GetSliceRange();
140 
142 
143  virtual double GetColorWindow();
144  virtual double GetColorLevel();
145  virtual void SetColorWindow(double s);
146  virtual void SetColorLevel(double s);
148 
150 
151  virtual void SetDisplayId(void *a);
152  virtual void SetWindowId(void *a);
153  virtual void SetParentId(void *a);
155 
157 
158  virtual int* GetPosition();
159  virtual void SetPosition(int a,int b);
160  virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); }
162 
164 
165  virtual int* GetSize();
166  virtual void SetSize(int a, int b);
167  virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); }
169 
171 
173  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
174  vtkGetObjectMacro(Renderer, vtkRenderer);
175  vtkGetObjectMacro(ImageActor,vtkImageActor);
176  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
177  vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage);
179 
181 
182  virtual void SetRenderWindow(vtkRenderWindow *arg);
183  virtual void SetRenderer(vtkRenderer *arg);
185 
187  virtual void SetupInteractor(vtkRenderWindowInteractor*);
188 
190 
193  virtual void SetOffScreenRendering(int);
194  virtual int GetOffScreenRendering();
195  vtkBooleanMacro(OffScreenRendering,int);
197 
199  VTK_LEGACY(int GetWholeZMin());
200 
202  VTK_LEGACY(int GetWholeZMax());
203 
205  VTK_LEGACY(int GetZSlice());
206 
208  VTK_LEGACY(void SetZSlice(int));
209 
210 protected:
211  vtkImageViewer2();
212  ~vtkImageViewer2();
213 
214  virtual void InstallPipeline();
215  virtual void UnInstallPipeline();
216 
223 
226  int Slice;
227 
228  virtual void UpdateOrientation();
229 
230 private:
231  vtkImageViewer2(const vtkImageViewer2&); // Not implemented.
232  void operator=(const vtkImageViewer2&); // Not implemented.
233 };
234 
235 #endif
236 
237 
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkImageMapToWindowLevelColors * WindowLevel
virtual void SetSliceOrientationToXY()
vtkRenderWindowInteractor * Interactor
map the input image through a lookup table and window / level it
Display a 2D image.
abstract specification for renderers
Definition: vtkRenderer.h:69
virtual void SetPosition(int a[2])
Proxy object to connect input/output ports.
interactive manipulation of the camera specialized for images
platform-independent render window interaction including picking and frame rate control.
vtkImageActor * ImageActor
virtual void PrintSelf(ostream &os, vtkIndent indent)
draw an image (data & properties) in a rendered 3D scene
Definition: vtkImageActor.h:49
a simple class to control print indentation
Definition: vtkIndent.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
virtual void SetSize(int a[2])
#define VTK_RENDERING_EXPORT
create a window for renderers to draw into
vtkRenderWindow * RenderWindow
static vtkObject * New()
virtual void GetSliceRange(int range[2])
vtkRenderer * Renderer
virtual void SetSliceOrientationToXZ()
#define max(a, b)
vtkInteractorStyleImage * InteractorStyle
virtual void SetSliceOrientationToYZ()