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 =========================================================================*/
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);
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();};
70  virtual void SetInputConnection(vtkAlgorithmOutput* input) {
71  this->ImageMapper->SetInputConnection(input);};
73 
75 
78  int GetWholeZMin() {return this->ImageMapper->GetWholeZMin();};
79  int GetWholeZMax() {return this->ImageMapper->GetWholeZMax();};
81 
83 
86  int GetZSlice() {return this->ImageMapper->GetZSlice();};
87  void SetZSlice(int s) {this->ImageMapper->SetZSlice(s);};
89 
91 
94  double GetColorWindow() {return this->ImageMapper->GetColorWindow();};
95  double GetColorLevel() {return this->ImageMapper->GetColorLevel();};
96  void SetColorWindow(double s) {this->ImageMapper->SetColorWindow(s);};
97  void SetColorLevel(double s) {this->ImageMapper->SetColorLevel(s);};
99 
101 
104  void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
105  void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
106  void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
108 
110 
113  int *GetPosition() {return this->RenderWindow->GetPosition();};
114  void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
115  virtual void SetPosition(int a[2]);
117 
119 
122  int *GetSize() {return this->RenderWindow->GetSize();};
123  void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
124  virtual void SetSize(int a[2]);
126 
128 
131  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
132  vtkGetObjectMacro(Renderer, vtkRenderer);
133  vtkGetObjectMacro(ImageMapper,vtkImageMapper);
134  vtkGetObjectMacro(Actor2D,vtkActor2D);
136 
141 
143 
153 
154 protected:
157 
165 
166  friend class vtkImageViewerCallback;
168 
169 private:
170  vtkImageViewer(const vtkImageViewer&) VTK_DELETE_FUNCTION;
171  void operator=(const vtkImageViewer&) VTK_DELETE_FUNCTION;
172 };
173 
174 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
Proxy object to connect input/output ports.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
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)
void SetPosition(int a, int b)
vtkImageMapper * ImageMapper
vtkImageData * GetInput()
vtkAlgorithm * GetInputAlgorithm()
void OffScreenRenderingOff()
void SetSize(int a, int b)
vtkInteractorStyleImage * InteractorStyle
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
int * GetSize()
Set/Get the size of the window in screen coordinates in pixels.
void OffScreenRenderingOn()
int * GetPosition()
Set/Get the position in screen coordinates of the rendering window.
double GetColorLevel()
static vtkImageViewer * New()
int GetOffScreenRendering()
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.
virtual void Render(void)
Render the resulting image.
vtkRenderer * Renderer
int GetZSlice()
Set/Get the current Z Slice to display.
void SetOffScreenRendering(int)
Create a window in memory instead of on the screen.
int GetWholeZMin()
What is the possible Min/ Max z slices available.
vtkActor2D * Actor2D
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:40
interactive manipulation of the camera specialized for images
abstract base class for most VTK objects
Definition: vtkObject.h:60
platform-independent render window interaction including picking and frame rate control.
create a window for renderers to draw into
virtual void SetParentId(void *)=0
virtual void SetWindowId(void *)=0
virtual void SetDisplayId(void *)=0
Dummy stubs for vtkWindow API.
abstract specification for renderers
Definition: vtkRenderer.h:64
virtual int * GetSize()
Set/Get the size of the window in screen coordinates in pixels.
virtual void SetPosition(int, int)
virtual int * GetPosition()
Set/Get the position in screen coordinates of the rendering window.
virtual void SetSize(int, int)
virtual char * GetWindowName()
Get name of rendering window.