VTK  9.2.6
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 =========================================================================*/
61 #ifndef vtkImageViewer2_h
62 #define vtkImageViewer2_h
63 
64 #include "vtkInteractionImageModule.h" // For export macro
65 #include "vtkObject.h"
66 
67 class vtkAlgorithm;
68 class vtkAlgorithmOutput;
69 class vtkImageActor;
70 class vtkImageData;
72 class vtkInformation;
74 class vtkRenderWindow;
75 class vtkRenderer;
77 
78 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject
79 {
80 public:
81  static vtkImageViewer2* New();
82  vtkTypeMacro(vtkImageViewer2, vtkObject);
83  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
88  virtual const char* GetWindowName();
89 
93  virtual void Render(void);
94 
96 
99  virtual void SetInputData(vtkImageData* in);
100  virtual vtkImageData* GetInput();
101  virtual void SetInputConnection(vtkAlgorithmOutput* input);
103 
108  enum
109  {
110  SLICE_ORIENTATION_YZ = 0,
111  SLICE_ORIENTATION_XZ = 1,
112  SLICE_ORIENTATION_XY = 2
113  };
114 
115  vtkGetMacro(SliceOrientation, int);
116  virtual void SetSliceOrientation(int orientation);
117  virtual void SetSliceOrientationToXY()
118  {
119  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY);
120  }
121  virtual void SetSliceOrientationToYZ()
122  {
123  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ);
124  }
125  virtual void SetSliceOrientationToXZ()
126  {
127  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ);
128  }
129 
131 
135  vtkGetMacro(Slice, int);
136  virtual void SetSlice(int s);
138 
151  virtual void UpdateDisplayExtent();
152 
154 
158  virtual int GetSliceMin();
159  virtual int GetSliceMax();
160  virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
161  virtual void GetSliceRange(int& min, int& max);
162  virtual int* GetSliceRange();
164 
166 
169  virtual double GetColorWindow();
170  virtual double GetColorLevel();
171  virtual void SetColorWindow(double s);
172  virtual void SetColorLevel(double s);
174 
176 
179  virtual void SetDisplayId(void* a);
180  virtual void SetWindowId(void* a);
181  virtual void SetParentId(void* a);
183 
185 
189  virtual int* GetPosition() VTK_SIZEHINT(2);
190 
196  virtual void SetPosition(int x, int y);
197  virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
199 
201 
205  virtual int* GetSize() VTK_SIZEHINT(2);
206 
215  virtual void SetSize(int width, int height);
216  virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
218 
220 
224  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
225  vtkGetObjectMacro(Renderer, vtkRenderer);
226  vtkGetObjectMacro(ImageActor, vtkImageActor);
227  vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
228  vtkGetObjectMacro(InteractorStyle, vtkInteractorStyleImage);
230 
232 
235  virtual void SetRenderWindow(vtkRenderWindow* arg);
236  virtual void SetRenderer(vtkRenderer* arg);
238 
242  virtual void SetupInteractor(vtkRenderWindowInteractor*);
243 
245 
250  virtual void SetOffScreenRendering(vtkTypeBool);
251  virtual vtkTypeBool GetOffScreenRendering();
252  vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
254 
255 protected:
256  vtkImageViewer2();
257  ~vtkImageViewer2() override;
258 
259  virtual void InstallPipeline();
260  virtual void UnInstallPipeline();
261 
268 
271  int Slice;
272 
273  virtual void UpdateOrientation();
274 
275  vtkAlgorithm* GetInputAlgorithm();
276  vtkInformation* GetInputInformation();
277 
278  friend class vtkImageViewer2Callback;
279 
280 private:
281  vtkImageViewer2(const vtkImageViewer2&) = delete;
282  void operator=(const vtkImageViewer2&) = delete;
283 };
284 
285 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:72
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:69
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:62
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:48
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
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()