VTK  9.0.1
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 =========================================================================*/
29 #ifndef vtkImageViewer_h
30 #define vtkImageViewer_h
31 
32 #include "vtkInteractionImageModule.h" // For export macro
33 #include "vtkObject.h"
34 
35 #include "vtkImageMapper.h" // For all the inline methods
36 #include "vtkRenderWindow.h" // For all the inline methods
37 
39 
40 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
41 {
42 public:
43  static vtkImageViewer* New();
44 
45  vtkTypeMacro(vtkImageViewer, vtkObject);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  char* GetWindowName() { return this->RenderWindow->GetWindowName(); }
52 
56  virtual void Render(void);
57 
59 
62  void SetInputData(vtkImageData* in) { this->ImageMapper->SetInputData(in); }
63  vtkImageData* GetInput() { return this->ImageMapper->GetInput(); }
65  {
66  this->ImageMapper->SetInputConnection(input);
67  }
69 
71 
74  int GetWholeZMin() { return this->ImageMapper->GetWholeZMin(); }
75  int GetWholeZMax() { return this->ImageMapper->GetWholeZMax(); }
77 
79 
82  int GetZSlice() { return this->ImageMapper->GetZSlice(); }
83  void SetZSlice(int s) { this->ImageMapper->SetZSlice(s); }
85 
87 
90  double GetColorWindow() { return this->ImageMapper->GetColorWindow(); }
91  double GetColorLevel() { return this->ImageMapper->GetColorLevel(); }
92  void SetColorWindow(double s) { this->ImageMapper->SetColorWindow(s); }
93  void SetColorLevel(double s) { this->ImageMapper->SetColorLevel(s); }
95 
97 
100  void SetDisplayId(void* a) { this->RenderWindow->SetDisplayId(a); }
101  void SetWindowId(void* a) { this->RenderWindow->SetWindowId(a); }
102  void SetParentId(void* a) { this->RenderWindow->SetParentId(a); }
104 
106 
110  int* GetPosition() VTK_SIZEHINT(2) { return this->RenderWindow->GetPosition(); }
111 
117  void SetPosition(int x, int y) { this->RenderWindow->SetPosition(x, y); }
118  virtual void SetPosition(int a[2]);
120 
122 
126  int* GetSize() VTK_SIZEHINT(2) { return this->RenderWindow->GetSize(); }
127 
136  void SetSize(int width, int height) { this->RenderWindow->SetSize(width, height); }
137  virtual void SetSize(int a[2]);
139 
141 
144  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
146  vtkGetObjectMacro(Renderer, vtkRenderer);
147  vtkGetObjectMacro(ImageMapper, vtkImageMapper);
148  vtkGetObjectMacro(Actor2D, vtkActor2D);
150 
155 
157 
167 
168 protected:
170  ~vtkImageViewer() override;
171 
179 
180  friend class vtkImageViewerCallback;
182 
183 private:
184  vtkImageViewer(const vtkImageViewer&) = delete;
185  void operator=(const vtkImageViewer&) = delete;
186 };
187 
188 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
Proxy object to connect input/output ports.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:63
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
2D image display
Display a 2d image.
void SetColorLevel(double s)
virtual void SetInputConnection(vtkAlgorithmOutput *input)
void SetInputData(vtkImageData *in)
Set/Get the input to the viewer.
void SetZSlice(int s)
vtkImageMapper * ImageMapper
vtkImageData * GetInput()
vtkAlgorithm * GetInputAlgorithm()
void SetRenderWindow(vtkRenderWindow *renWin)
void OffScreenRenderingOff()
vtkInteractorStyleImage * InteractorStyle
int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
void OffScreenRenderingOn()
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()
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)
void SetParentId(void *a)
void SetWindowId(void *a)
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()
void SetupInteractor(vtkRenderWindowInteractor *)
Create and attach an interactor for this window.
vtkRenderWindowInteractor * Interactor
virtual void SetPosition(int a[2])
virtual void SetSize(int a[2])
vtkRenderWindow * RenderWindow
char * GetWindowName()
Get name of rendering window.
a simple class to control print indentation
Definition: vtkIndent.h:34
interactive manipulation of the camera specialized for images
abstract base class for most VTK objects
Definition: vtkObject.h:63
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
@ height
Definition: vtkX3D.h:260
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)