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 =========================================================================*/
58 #ifndef vtkImageViewer2_h
59 #define vtkImageViewer2_h
60 
61 #include "vtkInteractionImageModule.h" // For export macro
62 #include "vtkObject.h"
63 
64 class vtkAlgorithm;
65 class vtkAlgorithmOutput;
66 class vtkImageActor;
67 class vtkImageData;
69 class vtkInformation;
71 class vtkRenderWindow;
72 class vtkRenderer;
74 
75 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject
76 {
77 public:
78  static vtkImageViewer2 *New();
79  vtkTypeMacro(vtkImageViewer2,vtkObject);
80  void PrintSelf(ostream& os, vtkIndent indent) override;
81 
85  virtual const char *GetWindowName();
86 
90  virtual void Render(void);
91 
93 
96  virtual void SetInputData(vtkImageData *in);
97  virtual vtkImageData *GetInput();
98  virtual void SetInputConnection(vtkAlgorithmOutput* input);
100 
105  enum
106  {
107  SLICE_ORIENTATION_YZ = 0,
108  SLICE_ORIENTATION_XZ = 1,
109  SLICE_ORIENTATION_XY = 2
110  };
111 
112  vtkGetMacro(SliceOrientation, int);
113  virtual void SetSliceOrientation(int orientation);
114  virtual void SetSliceOrientationToXY()
115  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY); };
116  virtual void SetSliceOrientationToYZ()
117  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ); };
118  virtual void SetSliceOrientationToXZ()
119  { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ); };
120 
122 
126  vtkGetMacro(Slice, int);
127  virtual void SetSlice(int s);
129 
142  virtual void UpdateDisplayExtent();
143 
145 
149  virtual int GetSliceMin();
150  virtual int GetSliceMax();
151  virtual void GetSliceRange(int range[2])
152  { this->GetSliceRange(range[0], range[1]); }
153  virtual void GetSliceRange(int &min, int &max);
154  virtual int* GetSliceRange();
156 
158 
161  virtual double GetColorWindow();
162  virtual double GetColorLevel();
163  virtual void SetColorWindow(double s);
164  virtual void SetColorLevel(double s);
166 
168 
171  virtual void SetDisplayId(void *a);
172  virtual void SetWindowId(void *a);
173  virtual void SetParentId(void *a);
175 
177 
180  virtual int* GetPosition() VTK_SIZEHINT(2);
181  virtual void SetPosition(int a,int b);
182  virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); }
184 
186 
189  virtual int* GetSize() VTK_SIZEHINT(2);
190  virtual void SetSize(int a, int b);
191  virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); }
193 
195 
199  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
200  vtkGetObjectMacro(Renderer, vtkRenderer);
201  vtkGetObjectMacro(ImageActor,vtkImageActor);
202  vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
203  vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage);
205 
207 
210  virtual void SetRenderWindow(vtkRenderWindow *arg);
211  virtual void SetRenderer(vtkRenderer *arg);
213 
217  virtual void SetupInteractor(vtkRenderWindowInteractor*);
218 
220 
225  virtual void SetOffScreenRendering(vtkTypeBool);
226  virtual vtkTypeBool GetOffScreenRendering();
227  vtkBooleanMacro(OffScreenRendering,vtkTypeBool);
229 
230 protected:
231  vtkImageViewer2();
232  ~vtkImageViewer2() override;
233 
234  virtual void InstallPipeline();
235  virtual void UnInstallPipeline();
236 
243 
246  int Slice;
247 
248  virtual void UpdateOrientation();
249 
250  vtkAlgorithm* GetInputAlgorithm();
251  vtkInformation* GetInputInformation();
252 
253  friend class vtkImageViewer2Callback;
254 
255 private:
256  vtkImageViewer2(const vtkImageViewer2&) = delete;
257  void operator=(const vtkImageViewer2&) = delete;
258 };
259 
260 #endif
vtkImageViewer2::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkImageViewer2.h:241
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkX3D::range
Definition: vtkX3D.h:238
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkImageViewer2
Display a 2D image.
Definition: vtkImageViewer2.h:75
vtkInteractorStyleImage
interactive manipulation of the camera specialized for images
Definition: vtkInteractorStyleImage.h:78
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkImageViewer2::WindowLevel
vtkImageMapToWindowLevelColors * WindowLevel
Definition: vtkImageViewer2.h:237
vtkImageViewer2::SetSliceOrientationToXY
virtual void SetSliceOrientationToXY()
Definition: vtkImageViewer2.h:114
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
vtkImageViewer2::FirstRender
int FirstRender
Definition: vtkImageViewer2.h:245
vtkImageMapToWindowLevelColors
Map an image through a lookup table and/or a window/level.
Definition: vtkImageMapToWindowLevelColors.h:49
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageViewer2::SetPosition
virtual void SetPosition(int a[2])
Definition: vtkImageViewer2.h:182
vtkImageViewer2::SetSliceOrientationToXZ
virtual void SetSliceOrientationToXZ()
Definition: vtkImageViewer2.h:118
vtkImageViewer2::ImageActor
vtkImageActor * ImageActor
Definition: vtkImageViewer2.h:240
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageViewer2::SLICE_ORIENTATION_XZ
Definition: vtkImageViewer2.h:108
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:72
vtkImageViewer2::SetSize
virtual void SetSize(int a[2])
Definition: vtkImageViewer2.h:191
vtkImageViewer2::InteractorStyle
vtkInteractorStyleImage * InteractorStyle
Definition: vtkImageViewer2.h:242
vtkObject.h
vtkImageViewer2::Slice
int Slice
Definition: vtkImageViewer2.h:246
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkImageViewer2::SLICE_ORIENTATION_XY
Definition: vtkImageViewer2.h:109
vtkImageViewer2::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkImageViewer2.h:238
vtkX3D::orientation
Definition: vtkX3D.h:262
vtkImageViewer2::SliceOrientation
int SliceOrientation
Definition: vtkImageViewer2.h:244
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:57
vtkImageActor
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:43
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:81
vtkImageViewer2::SetSliceOrientationToYZ
virtual void SetSliceOrientationToYZ()
Definition: vtkImageViewer2.h:116
vtkImageViewer2::GetSliceRange
virtual void GetSliceRange(int range[2])
Definition: vtkImageViewer2.h:151
vtkImageViewer2::SLICE_ORIENTATION_YZ
Definition: vtkImageViewer2.h:107
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageViewer2::Renderer
vtkRenderer * Renderer
Definition: vtkImageViewer2.h:239