VTK  9.3.0
vtkImageViewer.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
32#ifndef vtkImageViewer_h
33#define vtkImageViewer_h
34
35#include "vtkInteractionImageModule.h" // For export macro
36#include "vtkObject.h"
37
38#include "vtkImageMapper.h" // For all the inline methods
39#include "vtkRenderWindow.h" // For all the inline methods
40
41VTK_ABI_NAMESPACE_BEGIN
43
44class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
45{
46public:
48
49 vtkTypeMacro(vtkImageViewer, vtkObject);
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
55 char* GetWindowName() { return this->RenderWindow->GetWindowName(); }
56
60 virtual void Render();
61
63
66 void SetInputData(vtkImageData* in) { this->ImageMapper->SetInputData(in); }
67 vtkImageData* GetInput() { return this->ImageMapper->GetInput(); }
69 {
70 this->ImageMapper->SetInputConnection(input);
71 }
73
75
78 int GetWholeZMin() { return this->ImageMapper->GetWholeZMin(); }
79 int GetWholeZMax() { return this->ImageMapper->GetWholeZMax(); }
81
83
86 int GetZSlice() { return this->ImageMapper->GetZSlice(); }
87 void SetZSlice(int s) { this->ImageMapper->SetZSlice(s); }
89
91
94 double GetColorWindow() { return this->ImageMapper->GetColorWindow(); }
95 double GetColorLevel() { return this->ImageMapper->GetColorLevel(); }
96 void SetColorWindow(double s) { this->ImageMapper->SetColorWindow(s); }
97 void SetColorLevel(double s) { this->ImageMapper->SetColorLevel(s); }
99
101
104 void SetDisplayId(void* a) { this->RenderWindow->SetDisplayId(a); }
105 void SetWindowId(void* a) { this->RenderWindow->SetWindowId(a); }
106 void SetParentId(void* a) { this->RenderWindow->SetParentId(a); }
108
110
114 int* GetPosition() VTK_SIZEHINT(2) { return this->RenderWindow->GetPosition(); }
115
121 void SetPosition(int x, int y) { this->RenderWindow->SetPosition(x, y); }
122 virtual void SetPosition(int a[2]);
124
126
130 int* GetSize() VTK_SIZEHINT(2) { return this->RenderWindow->GetSize(); }
131
140 void SetSize(int width, int height) { this->RenderWindow->SetSize(width, height); }
141 virtual void SetSize(int a[2]);
143
145
148 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
150 vtkGetObjectMacro(Renderer, vtkRenderer);
151 vtkGetObjectMacro(ImageMapper, vtkImageMapper);
152 vtkGetObjectMacro(Actor2D, vtkActor2D);
154
159
161
171
172protected:
174 ~vtkImageViewer() override;
175
183
184 friend class vtkImageViewerCallback;
186
187private:
188 vtkImageViewer(const vtkImageViewer&) = delete;
189 void operator=(const vtkImageViewer&) = delete;
190};
191
192VTK_ABI_NAMESPACE_END
193#endif
a actor that draws 2D data
Definition vtkActor2D.h:44
Proxy object to connect input/output ports.
Superclass for all sources, filters, and sinks in VTK.
topologically and geometrically regular array of data
2D image display
Display a 2d image.
void SetColorLevel(double s)
Sets window/level for mapping pixels to colors.
virtual void SetInputConnection(vtkAlgorithmOutput *input)
Set/Get the input to the viewer.
void SetInputData(vtkImageData *in)
Set/Get the input to the viewer.
void SetZSlice(int s)
Set/Get the current Z Slice to display.
vtkImageMapper * ImageMapper
void SetRenderWindow(vtkRenderWindow *renWin)
Get the internal objects.
vtkImageData * GetInput()
Set/Get the input to the viewer.
void OffScreenRenderingOff()
Create a window in memory instead of on the screen.
vtkInteractorStyleImage * InteractorStyle
static vtkImageViewer * New()
void OffScreenRenderingOn()
Create a window in memory instead of on the screen.
virtual void Render()
Render the resulting image.
void SetOffScreenRendering(vtkTypeBool)
Create a window in memory instead of on the screen.
double GetColorLevel()
Sets window/level for mapping pixels to colors.
void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
void SetColorWindow(double s)
Sets window/level for mapping pixels to colors.
void SetParentId(void *a)
These are here for using a tk window.
void SetWindowId(void *a)
These are here for using a tk window.
void SetDisplayId(void *a)
These are here for using a tk window.
double GetColorWindow()
Sets window/level for mapping pixels to colors.
void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkRenderer * Renderer
int GetZSlice()
Set/Get the current Z Slice to display.
int GetWholeZMin()
What is the possible Min/ Max z slices available.
~vtkImageViewer() override
vtkActor2D * Actor2D
vtkTypeBool GetOffScreenRendering()
Create a window in memory instead of on the screen.
void SetupInteractor(vtkRenderWindowInteractor *)
Create and attach an interactor for this window.
char * GetWindowName()
Get name of rendering window.
int GetWholeZMax()
What is the possible Min/ Max z slices available.
vtkAlgorithm * GetInputAlgorithm()
vtkRenderWindowInteractor * Interactor
int * GetSize()
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 void SetSize(int a[2])
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkRenderWindow * RenderWindow
a simple class to control print indentation
Definition vtkIndent.h:38
interactive manipulation of the camera specialized for images
abstract base class for most VTK objects
Definition vtkObject.h:58
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:68
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)