VTK
vtkImageViewer2.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageViewer2.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=========================================================================*/
61#ifndef vtkImageViewer2_h
62#define vtkImageViewer2_h
63
64#include "vtkInteractionImageModule.h" // For export macro
65#include "vtkObject.h"
66
67class vtkAlgorithm;
69class vtkImageActor;
70class vtkImageData;
72class vtkInformation;
74class vtkRenderWindow;
75class vtkRenderer;
77
78class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject
79{
80public:
83 void PrintSelf(ostream& os, vtkIndent indent);
84
88 virtual const char *GetWindowName();
89
93 virtual void Render(void);
94
96
99 virtual void SetInputData(vtkImageData *in);
103
108 enum
109 {
110 SLICE_ORIENTATION_YZ = 0,
111 SLICE_ORIENTATION_XZ = 1,
112 SLICE_ORIENTATION_XY = 2
113 };
114
115 vtkGetMacro(SliceOrientation, int);
118 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY); };
120 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ); };
122 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ); };
123
125
129 vtkGetMacro(Slice, int);
130 virtual void SetSlice(int s);
132
145 virtual void UpdateDisplayExtent();
146
148
152 virtual int GetSliceMin();
153 virtual int GetSliceMax();
154 virtual void GetSliceRange(int range[2])
155 { this->GetSliceRange(range[0], range[1]); }
156 virtual void GetSliceRange(int &min, int &max);
157 virtual int* GetSliceRange();
159
161
164 virtual double GetColorWindow();
165 virtual double GetColorLevel();
166 virtual void SetColorWindow(double s);
167 virtual void SetColorLevel(double s);
169
171
174 virtual void SetDisplayId(void *a);
175 virtual void SetWindowId(void *a);
176 virtual void SetParentId(void *a);
178
180
183 virtual int* GetPosition();
184 virtual void SetPosition(int a,int b);
185 virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); }
187
189
192 virtual int* GetSize();
193 virtual void SetSize(int a, int b);
194 virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); }
196
198
202 vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
203 vtkGetObjectMacro(Renderer, vtkRenderer);
204 vtkGetObjectMacro(ImageActor,vtkImageActor);
205 vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
206 vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage);
208
210
214 virtual void SetRenderer(vtkRenderer *arg);
216
221
223
228 virtual void SetOffScreenRendering(int);
230 vtkBooleanMacro(OffScreenRendering,int);
232
233protected:
236
237 virtual void InstallPipeline();
238 virtual void UnInstallPipeline();
239
246
249 int Slice;
250
251 virtual void UpdateOrientation();
252
255
256 friend class vtkImageViewer2Callback;
257
258private:
259 vtkImageViewer2(const vtkImageViewer2&) VTK_DELETE_FUNCTION;
260 void operator=(const vtkImageViewer2&) VTK_DELETE_FUNCTION;
261};
262
263#endif
Proxy object to connect input/output ports.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:50
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
map the input image through a lookup table and window / level it
Display a 2D image.
vtkAlgorithm * GetInputAlgorithm()
virtual void SetDisplayId(void *a)
These are here when using a Tk window.
virtual int GetSliceMin()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
virtual void SetSliceOrientation(int orientation)
virtual int * GetSliceRange()
virtual void SetColorLevel(double s)
virtual void UnInstallPipeline()
virtual const char * GetWindowName()
Get the name of rendering window.
virtual int * GetSize()
Set/Get the size of the window in screen coordinates in pixels.
virtual void UpdateDisplayExtent()
Update the display extent manually so that the proper slice for the given orientation is displayed.
virtual void SetWindowId(void *a)
vtkRenderer * Renderer
virtual void SetSlice(int s)
virtual void SetSliceOrientationToXZ()
virtual int * GetPosition()
Set/Get the position in screen coordinates of the rendering window.
virtual void GetSliceRange(int &min, int &max)
vtkImageActor * ImageActor
virtual void SetupInteractor(vtkRenderWindowInteractor *)
Attach an interactor for the internal render window.
virtual void SetSize(int a[2])
virtual void SetPosition(int a[2])
virtual double GetColorLevel()
virtual void SetInputConnection(vtkAlgorithmOutput *input)
virtual void SetSliceOrientationToYZ()
virtual void SetSize(int a, int b)
virtual void GetSliceRange(int range[2])
virtual vtkImageData * GetInput()
virtual void SetOffScreenRendering(int)
Create a window in memory instead of on the screen.
vtkInformation * GetInputInformation()
virtual int GetSliceMax()
virtual double GetColorWindow()
Set window and level for mapping pixels to colors.
virtual void SetRenderWindow(vtkRenderWindow *arg)
Set your own renderwindow and renderer.
vtkRenderWindow * RenderWindow
virtual void SetColorWindow(double s)
virtual void Render(void)
Render the resulting image.
virtual void SetParentId(void *a)
vtkRenderWindowInteractor * Interactor
virtual void SetSliceOrientationToXY()
static vtkImageViewer2 * New()
virtual void SetRenderer(vtkRenderer *arg)
virtual int GetOffScreenRendering()
virtual void SetInputData(vtkImageData *in)
Set/Get the input image to the viewer.
vtkImageMapToWindowLevelColors * WindowLevel
vtkInteractorStyleImage * InteractorStyle
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetPosition(int a, int b)
virtual void InstallPipeline()
virtual void UpdateOrientation()
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
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
abstract specification for renderers
Definition: vtkRenderer.h:64
@ orientation
Definition: vtkX3D.h:262
@ range
Definition: vtkX3D.h:238
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define max(a, b)