VTK  9.3.1
vtkImageViewer2.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
49 #ifndef vtkImageViewer2_h
50 #define vtkImageViewer2_h
51 
52 #include "vtkInteractionImageModule.h" // For export macro
53 #include "vtkObject.h"
54 
55 VTK_ABI_NAMESPACE_BEGIN
56 class vtkAlgorithm;
57 class vtkAlgorithmOutput;
58 class vtkImageActor;
59 class vtkImageData;
61 class vtkInformation;
63 class vtkRenderWindow;
64 class vtkRenderer;
66 
67 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject
68 {
69 public:
70  static vtkImageViewer2* New();
71  vtkTypeMacro(vtkImageViewer2, vtkObject);
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
77  virtual const char* GetWindowName();
78 
82  virtual void Render();
83 
85 
88  virtual void SetInputData(vtkImageData* in);
89  virtual vtkImageData* GetInput();
90  virtual void SetInputConnection(vtkAlgorithmOutput* input);
92 
97  enum
98  {
99  SLICE_ORIENTATION_YZ = 0,
100  SLICE_ORIENTATION_XZ = 1,
101  SLICE_ORIENTATION_XY = 2
102  };
103 
104  vtkGetMacro(SliceOrientation, int);
105  virtual void SetSliceOrientation(int orientation);
106  virtual void SetSliceOrientationToXY()
107  {
108  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY);
109  }
110  virtual void SetSliceOrientationToYZ()
111  {
112  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ);
113  }
114  virtual void SetSliceOrientationToXZ()
115  {
116  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ);
117  }
118 
120 
124  vtkGetMacro(Slice, int);
125  virtual void SetSlice(int s);
127 
140  virtual void UpdateDisplayExtent();
141 
143 
147  virtual int GetSliceMin();
148  virtual int GetSliceMax();
149  virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
150  virtual void GetSliceRange(int& min, int& max);
151  virtual int* GetSliceRange();
153 
155 
158  virtual double GetColorWindow();
159  virtual double GetColorLevel();
160  virtual void SetColorWindow(double s);
161  virtual void SetColorLevel(double s);
163 
165 
168  virtual void SetDisplayId(void* a);
169  virtual void SetWindowId(void* a);
170  virtual void SetParentId(void* a);
172 
174 
178  virtual int* GetPosition() VTK_SIZEHINT(2);
179 
185  virtual void SetPosition(int x, int y);
186  virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
188 
190 
194  virtual int* GetSize() VTK_SIZEHINT(2);
195 
204  virtual void SetSize(int width, int height);
205  virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
207 
209 
213  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
214  vtkGetObjectMacro(Renderer, vtkRenderer);
215  vtkGetObjectMacro(ImageActor, vtkImageActor);
216  vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
217  vtkGetObjectMacro(InteractorStyle, vtkInteractorStyleImage);
219 
221 
224  virtual void SetRenderWindow(vtkRenderWindow* arg);
225  virtual void SetRenderer(vtkRenderer* arg);
227 
231  virtual void SetupInteractor(vtkRenderWindowInteractor*);
232 
234 
239  virtual void SetOffScreenRendering(vtkTypeBool);
240  virtual vtkTypeBool GetOffScreenRendering();
241  vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
243 
244 protected:
245  vtkImageViewer2();
246  ~vtkImageViewer2() override;
247 
248  virtual void InstallPipeline();
249  virtual void UnInstallPipeline();
250 
257 
260  int Slice;
261 
262  virtual void UpdateOrientation();
263 
264  vtkAlgorithm* GetInputAlgorithm();
265  vtkInformation* GetInputInformation();
266 
267  friend class vtkImageViewer2Callback;
268 
269 private:
270  vtkImageViewer2(const vtkImageViewer2&) = delete;
271  void operator=(const vtkImageViewer2&) = delete;
272 };
273 
274 VTK_ABI_NAMESPACE_END
275 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkImageMapToWindowLevelColors * WindowLevel
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetSliceOrientationToXY()
Store vtkAlgorithm input/output information.
vtkRenderWindowInteractor * Interactor
Map an image through a lookup table and/or a window/level.
Display a 2D image.
abstract specification for renderers
Definition: vtkRenderer.h:61
virtual void SetPosition(int a[2])
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
Proxy object to connect input/output ports.
interactive manipulation of the camera specialized for images
int vtkTypeBool
Definition: vtkABI.h:64
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:51
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:37
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
virtual void SetSize(int a[2])
Get the size (width and height) of the rendering window in screen coordinates (in pixels)...
#define VTK_SIZEHINT(...)
create a window for renderers to draw into
vtkRenderWindow * RenderWindow
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GetSliceRange(int range[2])
Return the minimum and maximum slice values (depending on the orientation this can be in X...
vtkRenderer * Renderer
virtual void SetSliceOrientationToXZ()
#define max(a, b)
vtkInteractorStyleImage * InteractorStyle
virtual void SetSliceOrientationToYZ()