VTK  9.2.6
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 =========================================================================*/
35 #ifndef vtkImageViewer_h
36 #define vtkImageViewer_h
37 
38 #include "vtkInteractionImageModule.h" // For export macro
39 #include "vtkObject.h"
40 
41 #include "vtkImageMapper.h" // For all the inline methods
42 #include "vtkRenderWindow.h" // For all the inline methods
43 
45 
46 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
47 {
48 public:
49  static vtkImageViewer* New();
50 
51  vtkTypeMacro(vtkImageViewer, vtkObject);
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  char* GetWindowName() { return this->RenderWindow->GetWindowName(); }
58 
62  virtual void Render(void);
63 
65 
68  void SetInputData(vtkImageData* in) { this->ImageMapper->SetInputData(in); }
69  vtkImageData* GetInput() { return this->ImageMapper->GetInput(); }
71  {
72  this->ImageMapper->SetInputConnection(input);
73  }
75 
77 
80  int GetWholeZMin() { return this->ImageMapper->GetWholeZMin(); }
81  int GetWholeZMax() { return this->ImageMapper->GetWholeZMax(); }
83 
85 
88  int GetZSlice() { return this->ImageMapper->GetZSlice(); }
89  void SetZSlice(int s) { this->ImageMapper->SetZSlice(s); }
91 
93 
96  double GetColorWindow() { return this->ImageMapper->GetColorWindow(); }
97  double GetColorLevel() { return this->ImageMapper->GetColorLevel(); }
98  void SetColorWindow(double s) { this->ImageMapper->SetColorWindow(s); }
99  void SetColorLevel(double s) { this->ImageMapper->SetColorLevel(s); }
101 
103 
106  void SetDisplayId(void* a) { this->RenderWindow->SetDisplayId(a); }
107  void SetWindowId(void* a) { this->RenderWindow->SetWindowId(a); }
108  void SetParentId(void* a) { this->RenderWindow->SetParentId(a); }
110 
112 
116  int* GetPosition() VTK_SIZEHINT(2) { return this->RenderWindow->GetPosition(); }
117 
123  void SetPosition(int x, int y) { this->RenderWindow->SetPosition(x, y); }
124  virtual void SetPosition(int a[2]);
126 
128 
132  int* GetSize() VTK_SIZEHINT(2) { return this->RenderWindow->GetSize(); }
133 
142  void SetSize(int width, int height) { this->RenderWindow->SetSize(width, height); }
143  virtual void SetSize(int a[2]);
145 
147 
150  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
151  void SetRenderWindow(vtkRenderWindow* renWin);
152  vtkGetObjectMacro(Renderer, vtkRenderer);
153  vtkGetObjectMacro(ImageMapper, vtkImageMapper);
154  vtkGetObjectMacro(Actor2D, vtkActor2D);
156 
160  void SetupInteractor(vtkRenderWindowInteractor*);
161 
163 
168  void SetOffScreenRendering(vtkTypeBool);
169  vtkTypeBool GetOffScreenRendering();
170  void OffScreenRenderingOn();
171  void OffScreenRenderingOff();
173 
174 protected:
175  vtkImageViewer();
176  ~vtkImageViewer() override;
177 
185 
186  friend class vtkImageViewerCallback;
187  vtkAlgorithm* GetInputAlgorithm();
188 
189 private:
190  vtkImageViewer(const vtkImageViewer&) = delete;
191  void operator=(const vtkImageViewer&) = delete;
192 };
193 
194 #endif
int GetZSlice()
Set/Get the current Z Slice to display.
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:45
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:72
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:69
platform-independent render window interaction including picking and frame rate control.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
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:39
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:53
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)...