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=========================================================================*/
70#ifndef vtkImageViewer2_h
71#define vtkImageViewer2_h
72
73#include "vtkInteractionImageModule.h" // For export macro
74#include "vtkObject.h"
75
76class vtkAlgorithm;
78class vtkImageActor;
79class vtkImageData;
81class vtkInformation;
83class vtkRenderWindow;
84class vtkRenderer;
86
87class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject
88{
89public:
91 vtkTypeMacro(vtkImageViewer2, vtkObject);
92 void PrintSelf(ostream& os, vtkIndent indent) override;
93
97 virtual const char* GetWindowName();
98
102 virtual void Render(void);
103
105
108 virtual void SetInputData(vtkImageData* in);
112
117 enum
118 {
119 SLICE_ORIENTATION_YZ = 0,
120 SLICE_ORIENTATION_XZ = 1,
121 SLICE_ORIENTATION_XY = 2
122 };
123
124 vtkGetMacro(SliceOrientation, int);
125 virtual void SetSliceOrientation(int orientation);
127 {
128 this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY);
129 }
131 {
132 this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ);
133 }
135 {
136 this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ);
137 }
138
140
144 vtkGetMacro(Slice, int);
145 virtual void SetSlice(int s);
147
160 virtual void UpdateDisplayExtent();
161
163
167 virtual int GetSliceMin();
168 virtual int GetSliceMax();
169 virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
170 virtual void GetSliceRange(int& min, int& max);
171 virtual int* GetSliceRange();
173
175
178 virtual double GetColorWindow();
179 virtual double GetColorLevel();
180 virtual void SetColorWindow(double s);
181 virtual void SetColorLevel(double s);
183
185
188 virtual void SetDisplayId(void* a);
189 virtual void SetWindowId(void* a);
190 virtual void SetParentId(void* a);
192
194
198 virtual int* GetPosition() VTK_SIZEHINT(2);
199
205 virtual void SetPosition(int x, int y);
206 virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
208
210
214 virtual int* GetSize() VTK_SIZEHINT(2);
215
224 virtual void SetSize(int width, int height);
225 virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
227
229
233 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
234 vtkGetObjectMacro(Renderer, vtkRenderer);
235 vtkGetObjectMacro(ImageActor, vtkImageActor);
236 vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
237 vtkGetObjectMacro(InteractorStyle, vtkInteractorStyleImage);
239
241
245 virtual void SetRenderer(vtkRenderer* arg);
247
252
254
261 vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
263
264protected:
267
268 virtual void InstallPipeline();
269 virtual void UnInstallPipeline();
270
277
280 int Slice;
281
282 virtual void UpdateOrientation();
283
286
287 friend class vtkImageViewer2Callback;
288
289private:
290 vtkImageViewer2(const vtkImageViewer2&) = delete;
291 void operator=(const vtkImageViewer2&) = delete;
292};
293
294#endif
Proxy object to connect input/output ports.
Superclass for all sources, filters, and sinks in VTK.
draw an image in a rendered 3D scene
topologically and geometrically regular array of data
Map an image through a lookup table and/or a window/level.
Display a 2D image.
vtkAlgorithm * GetInputAlgorithm()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetDisplayId(void *a)
These are here when using a Tk window.
virtual int GetSliceMin()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
virtual void SetSliceOrientation(int orientation)
virtual int * GetSliceRange()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
virtual void SetColorLevel(double s)
Set window and level for mapping pixels to colors.
virtual void UnInstallPipeline()
virtual const char * GetWindowName()
Get the name of rendering window.
virtual int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
virtual void UpdateDisplayExtent()
Update the display extent manually so that the proper slice for the given orientation is displayed.
virtual void SetWindowId(void *a)
These are here when using a Tk window.
virtual void SetOffScreenRendering(vtkTypeBool)
Create a window in memory instead of on the screen.
vtkRenderer * Renderer
virtual void SetSlice(int s)
Set/Get the current slice to display (depending on the orientation this can be in X,...
virtual void SetSliceOrientationToXZ()
virtual int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void GetSliceRange(int &min, int &max)
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
vtkImageActor * ImageActor
virtual void SetupInteractor(vtkRenderWindowInteractor *)
Attach an interactor for the internal render window.
virtual void SetSize(int a[2])
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
virtual void SetPosition(int a[2])
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual double GetColorLevel()
Set window and level for mapping pixels to colors.
virtual void SetInputConnection(vtkAlgorithmOutput *input)
Set/Get the input image to the viewer.
virtual void SetSliceOrientationToYZ()
~vtkImageViewer2() override
virtual void GetSliceRange(int range[2])
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
virtual vtkImageData * GetInput()
Set/Get the input image to the viewer.
vtkInformation * GetInputInformation()
virtual int GetSliceMax()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
virtual double GetColorWindow()
Set window and level for mapping pixels to colors.
virtual void SetRenderWindow(vtkRenderWindow *arg)
Set your own renderwindow and renderer.
virtual vtkTypeBool GetOffScreenRendering()
Create a window in memory instead of on the screen.
vtkRenderWindow * RenderWindow
virtual void SetColorWindow(double s)
Set window and level for mapping pixels to colors.
virtual void Render(void)
Render the resulting image.
virtual void SetParentId(void *a)
These are here when using a Tk window.
vtkRenderWindowInteractor * Interactor
virtual void SetSliceOrientationToXY()
static vtkImageViewer2 * New()
virtual void SetRenderer(vtkRenderer *arg)
Set your own renderwindow and renderer.
virtual void SetInputData(vtkImageData *in)
Set/Get the input image to the viewer.
vtkImageMapToWindowLevelColors * WindowLevel
vtkInteractorStyleImage * InteractorStyle
virtual void InstallPipeline()
virtual void UpdateOrientation()
a simple class to control print indentation
Definition vtkIndent.h:49
Store vtkAlgorithm input/output information.
interactive manipulation of the camera specialized for images
abstract base class for most VTK objects
Definition vtkObject.h:72
platform-independent render window interaction including picking and frame rate control.
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:82
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SIZEHINT(...)
#define max(a, b)