VTK  9.3.1
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
23 #ifndef vtkImageViewer_h
24 #define vtkImageViewer_h
25 
26 #include "vtkInteractionImageModule.h" // For export macro
27 #include "vtkObject.h"
28 
29 #include "vtkImageMapper.h" // For all the inline methods
30 #include "vtkRenderWindow.h" // For all the inline methods
31 
32 VTK_ABI_NAMESPACE_BEGIN
34 
35 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
36 {
37 public:
38  static vtkImageViewer* New();
39 
40  vtkTypeMacro(vtkImageViewer, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  char* GetWindowName() { return this->RenderWindow->GetWindowName(); }
47 
51  virtual void Render();
52 
54 
57  void SetInputData(vtkImageData* in) { this->ImageMapper->SetInputData(in); }
58  vtkImageData* GetInput() { return this->ImageMapper->GetInput(); }
60  {
61  this->ImageMapper->SetInputConnection(input);
62  }
64 
66 
69  int GetWholeZMin() { return this->ImageMapper->GetWholeZMin(); }
70  int GetWholeZMax() { return this->ImageMapper->GetWholeZMax(); }
72 
74 
77  int GetZSlice() { return this->ImageMapper->GetZSlice(); }
78  void SetZSlice(int s) { this->ImageMapper->SetZSlice(s); }
80 
82 
85  double GetColorWindow() { return this->ImageMapper->GetColorWindow(); }
86  double GetColorLevel() { return this->ImageMapper->GetColorLevel(); }
87  void SetColorWindow(double s) { this->ImageMapper->SetColorWindow(s); }
88  void SetColorLevel(double s) { this->ImageMapper->SetColorLevel(s); }
90 
92 
95  void SetDisplayId(void* a) { this->RenderWindow->SetDisplayId(a); }
96  void SetWindowId(void* a) { this->RenderWindow->SetWindowId(a); }
97  void SetParentId(void* a) { this->RenderWindow->SetParentId(a); }
99 
101 
105  int* GetPosition() VTK_SIZEHINT(2) { return this->RenderWindow->GetPosition(); }
106 
112  void SetPosition(int x, int y) { this->RenderWindow->SetPosition(x, y); }
113  virtual void SetPosition(int a[2]);
115 
117 
121  int* GetSize() VTK_SIZEHINT(2) { return this->RenderWindow->GetSize(); }
122 
131  void SetSize(int width, int height) { this->RenderWindow->SetSize(width, height); }
132  virtual void SetSize(int a[2]);
134 
136 
139  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
140  void SetRenderWindow(vtkRenderWindow* renWin);
141  vtkGetObjectMacro(Renderer, vtkRenderer);
142  vtkGetObjectMacro(ImageMapper, vtkImageMapper);
143  vtkGetObjectMacro(Actor2D, vtkActor2D);
145 
149  void SetupInteractor(vtkRenderWindowInteractor*);
150 
152 
157  void SetOffScreenRendering(vtkTypeBool);
158  vtkTypeBool GetOffScreenRendering();
159  void OffScreenRenderingOn();
160  void OffScreenRenderingOff();
162 
163 protected:
164  vtkImageViewer();
165  ~vtkImageViewer() override;
166 
174 
175  friend class vtkImageViewerCallback;
176  vtkAlgorithm* GetInputAlgorithm();
177 
178 private:
179  vtkImageViewer(const vtkImageViewer&) = delete;
180  void operator=(const vtkImageViewer&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #endif
int GetZSlice()
Set/Get the current Z Slice to display.
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a actor that draws 2D data
Definition: vtkActor2D.h:34
vtkImageMapper * ImageMapper
vtkRenderWindowInteractor * Interactor
void SetColorWindow(double s)
Sets window/level for mapping pixels to colors.
void SetWindowId(void *a)
These are here for using a tk window.
abstract specification for renderers
Definition: vtkRenderer.h:61
void SetParentId(void *a)
These are here for using a tk window.
vtkInteractorStyleImage * InteractorStyle
vtkRenderer * Renderer
Display a 2d image.
double GetColorWindow()
Sets window/level for mapping pixels to colors.
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.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:51
vtkImageData * GetInput()
Set/Get the input to the viewer.
void SetColorLevel(double s)
Sets window/level for mapping pixels to colors.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
void SetZSlice(int s)
Set/Get the current Z Slice to display.
char * GetWindowName()
Get name of rendering window.
int GetWholeZMin()
What is the possible Min/ Max z slices available.
int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
int * GetSize()
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
double GetColorLevel()
Sets window/level for mapping pixels to colors.
vtkRenderWindow * RenderWindow
virtual void SetInputConnection(vtkAlgorithmOutput *input)
Set/Get the input to the viewer.
2D image display
int GetWholeZMax()
What is the possible Min/ Max z slices available.
vtkActor2D * Actor2D
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetInputData(vtkImageData *in)
Set/Get the input to the viewer.
void SetDisplayId(void *a)
These are here for using a tk window.
void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...