VTK  9.1.0
vtkImageViewer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageViewer.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 =========================================================================*/
78 #ifndef vtkImageViewer_h
79 #define vtkImageViewer_h
80 
81 #include "vtkInteractionImageModule.h" // For export macro
82 #include "vtkObject.h"
83 
84 #include "vtkImageMapper.h" // For all the inline methods
85 #include "vtkRenderWindow.h" // For all the inline methods
86 
88 
89 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
90 {
91 public:
92  static vtkImageViewer* New();
93 
94  vtkTypeMacro(vtkImageViewer, vtkObject);
95  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
100  char* GetWindowName() { return this->RenderWindow->GetWindowName(); }
101 
105  virtual void Render(void);
106 
108 
111  void SetInputData(vtkImageData* in) { this->ImageMapper->SetInputData(in); }
112  vtkImageData* GetInput() { return this->ImageMapper->GetInput(); }
114  {
115  this->ImageMapper->SetInputConnection(input);
116  }
118 
120 
123  int GetWholeZMin() { return this->ImageMapper->GetWholeZMin(); }
124  int GetWholeZMax() { return this->ImageMapper->GetWholeZMax(); }
126 
128 
131  int GetZSlice() { return this->ImageMapper->GetZSlice(); }
132  void SetZSlice(int s) { this->ImageMapper->SetZSlice(s); }
134 
136 
139  double GetColorWindow() { return this->ImageMapper->GetColorWindow(); }
140  double GetColorLevel() { return this->ImageMapper->GetColorLevel(); }
141  void SetColorWindow(double s) { this->ImageMapper->SetColorWindow(s); }
142  void SetColorLevel(double s) { this->ImageMapper->SetColorLevel(s); }
144 
146 
149  void SetDisplayId(void* a) { this->RenderWindow->SetDisplayId(a); }
150  void SetWindowId(void* a) { this->RenderWindow->SetWindowId(a); }
151  void SetParentId(void* a) { this->RenderWindow->SetParentId(a); }
153 
155 
159  int* GetPosition() VTK_SIZEHINT(2) { return this->RenderWindow->GetPosition(); }
160 
166  void SetPosition(int x, int y) { this->RenderWindow->SetPosition(x, y); }
167  virtual void SetPosition(int a[2]);
169 
171 
175  int* GetSize() VTK_SIZEHINT(2) { return this->RenderWindow->GetSize(); }
176 
185  void SetSize(int width, int height) { this->RenderWindow->SetSize(width, height); }
186  virtual void SetSize(int a[2]);
188 
190 
193  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
195  vtkGetObjectMacro(Renderer, vtkRenderer);
196  vtkGetObjectMacro(ImageMapper, vtkImageMapper);
197  vtkGetObjectMacro(Actor2D, vtkActor2D);
199 
204 
206 
216 
217 protected:
219  ~vtkImageViewer() override;
220 
228 
229  friend class vtkImageViewerCallback;
231 
232 private:
233  vtkImageViewer(const vtkImageViewer&) = delete;
234  void operator=(const vtkImageViewer&) = delete;
235 };
236 
237 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:149
Proxy object to connect input/output ports.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:114
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
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
vtkImageData * GetInput()
Set/Get the input to the viewer.
vtkAlgorithm * GetInputAlgorithm()
void SetRenderWindow(vtkRenderWindow *renWin)
Get the internal objects.
void OffScreenRenderingOff()
Create a window in memory instead of on the screen.
vtkInteractorStyleImage * InteractorStyle
int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
void OffScreenRenderingOn()
Create a window in memory instead of on the screen.
int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
void SetOffScreenRendering(vtkTypeBool)
Create a window in memory instead of on the screen.
double GetColorLevel()
Sets window/level for mapping pixels to colors.
static vtkImageViewer * New()
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.
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).
virtual void Render(void)
Render the resulting image.
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.
int GetWholeZMax()
What is the possible Min/ Max z slices available.
vtkRenderWindowInteractor * Interactor
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
char * GetWindowName()
Get name of rendering window.
a simple class to control print indentation
Definition: vtkIndent.h:113
interactive manipulation of the camera specialized for images
abstract base class for most VTK objects
Definition: vtkObject.h:73
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:173
@ height
Definition: vtkX3D.h:260
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)