VTK
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();};
64  virtual void SetInputConnection(vtkAlgorithmOutput* input) {
65  this->ImageMapper->SetInputConnection(input);};
67 
69 
72  int GetWholeZMin() {return this->ImageMapper->GetWholeZMin();};
73  int GetWholeZMax() {return this->ImageMapper->GetWholeZMax();};
75 
77 
80  int GetZSlice() {return this->ImageMapper->GetZSlice();};
81  void SetZSlice(int s) {this->ImageMapper->SetZSlice(s);};
83 
85 
88  double GetColorWindow() {return this->ImageMapper->GetColorWindow();};
89  double GetColorLevel() {return this->ImageMapper->GetColorLevel();};
90  void SetColorWindow(double s) {this->ImageMapper->SetColorWindow(s);};
91  void SetColorLevel(double s) {this->ImageMapper->SetColorLevel(s);};
93 
95 
98  void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
99  void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
100  void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
102 
104 
107  int *GetPosition() VTK_SIZEHINT(2) {return this->RenderWindow->GetPosition();};
108  void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
109  virtual void SetPosition(int a[2]);
111 
113 
116  int *GetSize() VTK_SIZEHINT(2) {return this->RenderWindow->GetSize();};
117  void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
118  virtual void SetSize(int a[2]);
120 
122 
125  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
126  void SetRenderWindow(vtkRenderWindow* renWin);
127  vtkGetObjectMacro(Renderer, vtkRenderer);
128  vtkGetObjectMacro(ImageMapper,vtkImageMapper);
129  vtkGetObjectMacro(Actor2D,vtkActor2D);
131 
135  void SetupInteractor(vtkRenderWindowInteractor *);
136 
138 
143  void SetOffScreenRendering(int);
144  int GetOffScreenRendering();
145  void OffScreenRenderingOn();
146  void OffScreenRenderingOff();
148 
149 protected:
150  vtkImageViewer();
151  ~vtkImageViewer() override;
152 
160 
161  friend class vtkImageViewerCallback;
162  vtkAlgorithm* GetInputAlgorithm();
163 
164 private:
165  vtkImageViewer(const vtkImageViewer&) = delete;
166  void operator=(const vtkImageViewer&) = delete;
167 };
168 
169 #endif
int GetZSlice()
Set/Get the current Z Slice to display.
abstract base class for most VTK objects
Definition: vtkObject.h:53
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:39
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:57
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
void SetPosition(int a, int b)
Set/Get the position in screen coordinates of the rendering window.
platform-independent render window interaction including picking and frame rate control.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
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:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
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()
Set/Get the position in screen coordinates of the rendering window.
void SetSize(int a, int b)
Set/Get the size of the window in screen coordinates in pixels.
int * GetSize()
Set/Get the size of the 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.