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 =========================================================================*/
60 #ifndef vtkImageViewer2_h
61 #define vtkImageViewer2_h
62 
63 #include "vtkInteractionImageModule.h" // For export macro
64 #include "vtkObject.h"
65 
66 class vtkAlgorithm;
67 class vtkAlgorithmOutput;
68 class vtkImageActor;
69 class vtkImageData;
71 class vtkInformation;
73 class vtkRenderWindow;
74 class vtkRenderer;
76 
78 {
79 public:
80  static vtkImageViewer2 *New();
81  vtkTypeMacro(vtkImageViewer2,vtkObject);
82  void PrintSelf(ostream& os, vtkIndent indent);
83 
85  virtual const char *GetWindowName();
86 
88  virtual void Render(void);
89 
91 
92  virtual void SetInputData(vtkImageData *in);
93  virtual vtkImageData *GetInput();
94  virtual void SetInputConnection(vtkAlgorithmOutput* input);
96 
98 
99  enum
100  {
101  SLICE_ORIENTATION_YZ = 0,
102  SLICE_ORIENTATION_XZ = 1,
103  SLICE_ORIENTATION_XY = 2
104  };
105  //ETX
106  vtkGetMacro(SliceOrientation, int);
107  virtual void SetSliceOrientation(int orientation);
108  virtual void SetSliceOrientationToXY()
109  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY); };
110  virtual void SetSliceOrientationToYZ()
111  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ); };
112  virtual void SetSliceOrientationToXZ()
113  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ); };
115 
117 
119  vtkGetMacro(Slice, int);
120  virtual void SetSlice(int s);
122 
132  virtual void UpdateDisplayExtent();
133 
135 
137  virtual int GetSliceMin();
138  virtual int GetSliceMax();
139  virtual void GetSliceRange(int range[2])
140  { this->GetSliceRange(range[0], range[1]); }
141  virtual void GetSliceRange(int &min, int &max);
142  virtual int* GetSliceRange();
144 
146 
147  virtual double GetColorWindow();
148  virtual double GetColorLevel();
149  virtual void SetColorWindow(double s);
150  virtual void SetColorLevel(double s);
152 
154 
155  virtual void SetDisplayId(void *a);
156  virtual void SetWindowId(void *a);
157  virtual void SetParentId(void *a);
159 
161 
162  virtual int* GetPosition();
163  virtual void SetPosition(int a,int b);
164  virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); }
166 
168 
169  virtual int* GetSize();
170  virtual void SetSize(int a, int b);
171  virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); }
173 
175 
177  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
178  vtkGetObjectMacro(Renderer, vtkRenderer);
179  vtkGetObjectMacro(ImageActor,vtkImageActor);
180  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
181  vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage);
183 
185 
186  virtual void SetRenderWindow(vtkRenderWindow *arg);
187  virtual void SetRenderer(vtkRenderer *arg);
189 
191  virtual void SetupInteractor(vtkRenderWindowInteractor*);
192 
194 
197  virtual void SetOffScreenRendering(int);
198  virtual int GetOffScreenRendering();
199  vtkBooleanMacro(OffScreenRendering,int);
201 
202 protected:
203  vtkImageViewer2();
204  ~vtkImageViewer2();
205 
206  virtual void InstallPipeline();
207  virtual void UnInstallPipeline();
208 
215 
218  int Slice;
219 
220  virtual void UpdateOrientation();
221 
222  vtkAlgorithm* GetInputAlgorithm();
223  vtkInformation* GetInputInformation();
224 
225  friend class vtkImageViewer2Callback;
226 
227 private:
228  vtkImageViewer2(const vtkImageViewer2&); // Not implemented.
229  void operator=(const vtkImageViewer2&); // Not implemented.
230 };
231 
232 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkImageMapToWindowLevelColors * WindowLevel
virtual void SetSliceOrientationToXY()
Store vtkAlgorithm input/output information.
vtkRenderWindowInteractor * Interactor
map the input image through a lookup table and window / level it
Display a 2D image.
virtual void SetRenderWindow(vtkRenderWindow *renwin)
abstract specification for renderers
Definition: vtkRenderer.h:62
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
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTKINTERACTIONIMAGE_EXPORT
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:48
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual void SetSize(int a[2])
vtkWeakPointer< vtkRenderWindow > RenderWindow
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()