VTK  9.1.0
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 =========================================================================*/
167 #ifndef vtkImageViewer2_h
168 #define vtkImageViewer2_h
169 
170 #include "vtkInteractionImageModule.h" // For export macro
171 #include "vtkObject.h"
172 
173 class vtkAlgorithm;
174 class vtkAlgorithmOutput;
175 class vtkImageActor;
176 class vtkImageData;
178 class vtkInformation;
180 class vtkRenderWindow;
181 class vtkRenderer;
183 
184 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject
185 {
186 public:
187  static vtkImageViewer2* New();
188  vtkTypeMacro(vtkImageViewer2, vtkObject);
189  void PrintSelf(ostream& os, vtkIndent indent) override;
190 
194  virtual const char* GetWindowName();
195 
199  virtual void Render(void);
200 
202 
205  virtual void SetInputData(vtkImageData* in);
206  virtual vtkImageData* GetInput();
209 
214  enum
215  {
216  SLICE_ORIENTATION_YZ = 0,
217  SLICE_ORIENTATION_XZ = 1,
218  SLICE_ORIENTATION_XY = 2
219  };
220 
221  vtkGetMacro(SliceOrientation, int);
222  virtual void SetSliceOrientation(int orientation);
223  virtual void SetSliceOrientationToXY()
224  {
225  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY);
226  }
227  virtual void SetSliceOrientationToYZ()
228  {
229  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ);
230  }
231  virtual void SetSliceOrientationToXZ()
232  {
233  this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ);
234  }
235 
237 
241  vtkGetMacro(Slice, int);
242  virtual void SetSlice(int s);
244 
257  virtual void UpdateDisplayExtent();
258 
260 
264  virtual int GetSliceMin();
265  virtual int GetSliceMax();
266  virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
267  virtual void GetSliceRange(int& min, int& max);
268  virtual int* GetSliceRange();
270 
272 
275  virtual double GetColorWindow();
276  virtual double GetColorLevel();
277  virtual void SetColorWindow(double s);
278  virtual void SetColorLevel(double s);
280 
282 
285  virtual void SetDisplayId(void* a);
286  virtual void SetWindowId(void* a);
287  virtual void SetParentId(void* a);
289 
291 
295  virtual int* GetPosition() VTK_SIZEHINT(2);
296 
302  virtual void SetPosition(int x, int y);
303  virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
305 
307 
311  virtual int* GetSize() VTK_SIZEHINT(2);
312 
321  virtual void SetSize(int width, int height);
322  virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
324 
326 
330  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
331  vtkGetObjectMacro(Renderer, vtkRenderer);
332  vtkGetObjectMacro(ImageActor, vtkImageActor);
333  vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors);
334  vtkGetObjectMacro(InteractorStyle, vtkInteractorStyleImage);
336 
338 
341  virtual void SetRenderWindow(vtkRenderWindow* arg);
342  virtual void SetRenderer(vtkRenderer* arg);
344 
349 
351 
358  vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
360 
361 protected:
363  ~vtkImageViewer2() override;
364 
365  virtual void InstallPipeline();
366  virtual void UnInstallPipeline();
367 
374 
377  int Slice;
378 
379  virtual void UpdateOrientation();
380 
383 
384  friend class vtkImageViewer2Callback;
385 
386 private:
387  vtkImageViewer2(const vtkImageViewer2&) = delete;
388  void operator=(const vtkImageViewer2&) = delete;
389 };
390 
391 #endif
vtkImageViewer2::GetSliceMax
virtual int GetSliceMax()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
vtkImageViewer2::SetParentId
virtual void SetParentId(void *a)
These are here when using a Tk window.
vtkImageViewer2::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkImageViewer2.h:372
vtkImageViewer2::Render
virtual void Render(void)
Render the resulting image.
vtkImageViewer2::SLICE_ORIENTATION_XY
@ SLICE_ORIENTATION_XY
Definition: vtkImageViewer2.h:218
vtkImageViewer2::SetRenderer
virtual void SetRenderer(vtkRenderer *arg)
Set your own renderwindow and renderer.
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
vtkImageViewer2::SetWindowId
virtual void SetWindowId(void *a)
These are here when using a Tk window.
vtkImageViewer2::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageViewer2::SetSliceOrientation
virtual void SetSliceOrientation(int orientation)
vtkImageViewer2::SetInputConnection
virtual void SetInputConnection(vtkAlgorithmOutput *input)
Set/Get the input image to the viewer.
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkImageViewer2
Display a 2D image.
Definition: vtkImageViewer2.h:185
vtkImageViewer2::GetInputAlgorithm
vtkAlgorithm * GetInputAlgorithm()
vtkInteractorStyleImage
interactive manipulation of the camera specialized for images
Definition: vtkInteractorStyleImage.h:197
vtkImageViewer2::GetPosition
virtual int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
vtkImageViewer2::UnInstallPipeline
virtual void UnInstallPipeline()
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkImageViewer2::GetWindowName
virtual const char * GetWindowName()
Get the name of rendering window.
vtkImageViewer2::GetInputInformation
vtkInformation * GetInputInformation()
vtkImageViewer2::WindowLevel
vtkImageMapToWindowLevelColors * WindowLevel
Definition: vtkImageViewer2.h:368
vtkImageViewer2::SLICE_ORIENTATION_YZ
@ SLICE_ORIENTATION_YZ
Definition: vtkImageViewer2.h:216
vtkImageViewer2::SetSliceOrientationToXY
virtual void SetSliceOrientationToXY()
Definition: vtkImageViewer2.h:223
vtkImageViewer2::GetOffScreenRendering
virtual vtkTypeBool GetOffScreenRendering()
Create a window in memory instead of on the screen.
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
vtkX3D::height
@ height
Definition: vtkX3D.h:260
vtkImageViewer2::GetSize
virtual int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkImageViewer2::New
static vtkImageViewer2 * New()
vtkImageViewer2::GetColorLevel
virtual double GetColorLevel()
Set window and level for mapping pixels to colors.
vtkImageViewer2::FirstRender
int FirstRender
Definition: vtkImageViewer2.h:376
vtkImageViewer2::GetColorWindow
virtual double GetColorWindow()
Set window and level for mapping pixels to colors.
vtkImageViewer2::InstallPipeline
virtual void InstallPipeline()
vtkImageViewer2::UpdateOrientation
virtual void UpdateOrientation()
vtkImageViewer2::SLICE_ORIENTATION_XZ
@ SLICE_ORIENTATION_XZ
Definition: vtkImageViewer2.h:217
vtkImageMapToWindowLevelColors
Map an image through a lookup table and/or a window/level.
Definition: vtkImageMapToWindowLevelColors.h:88
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkImageViewer2::SetPosition
virtual void SetPosition(int a[2])
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
Definition: vtkImageViewer2.h:303
vtkImageViewer2::SetSliceOrientationToXZ
virtual void SetSliceOrientationToXZ()
Definition: vtkImageViewer2.h:231
vtkImageViewer2::ImageActor
vtkImageActor * ImageActor
Definition: vtkImageViewer2.h:371
vtkImageViewer2::~vtkImageViewer2
~vtkImageViewer2() override
vtkImageViewer2::GetSliceRange
virtual int * GetSliceRange()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
vtkImageViewer2::GetSliceMin
virtual int GetSliceMin()
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
vtkImageViewer2::SetInputData
virtual void SetInputData(vtkImageData *in)
Set/Get the input image to the viewer.
vtkImageViewer2::GetInput
virtual vtkImageData * GetInput()
Set/Get the input image to the viewer.
vtkImageViewer2::SetSlice
virtual void SetSlice(int s)
Set/Get the current slice to display (depending on the orientation this can be in X,...
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:192
vtkImageViewer2::SetSize
virtual void SetSize(int a[2])
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
Definition: vtkImageViewer2.h:322
vtkImageViewer2::InteractorStyle
vtkInteractorStyleImage * InteractorStyle
Definition: vtkImageViewer2.h:373
vtkImageViewer2::UpdateDisplayExtent
virtual void UpdateDisplayExtent()
Update the display extent manually so that the proper slice for the given orientation is displayed.
vtkObject.h
vtkImageViewer2::Slice
int Slice
Definition: vtkImageViewer2.h:377
vtkImageViewer2::SetupInteractor
virtual void SetupInteractor(vtkRenderWindowInteractor *)
Attach an interactor for the internal render window.
vtkImageViewer2::SetOffScreenRendering
virtual void SetOffScreenRendering(vtkTypeBool)
Create a window in memory instead of on the screen.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkImageViewer2::SetDisplayId
virtual void SetDisplayId(void *a)
These are here when using a Tk window.
vtkImageViewer2::SetColorLevel
virtual void SetColorLevel(double s)
Set window and level for mapping pixels to colors.
vtkImageViewer2::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkImageViewer2.h:369
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:268
vtkImageViewer2::vtkImageViewer2
vtkImageViewer2()
vtkImageViewer2::SliceOrientation
int SliceOrientation
Definition: vtkImageViewer2.h:375
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:66
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkImageActor
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:152
vtkImageViewer2::SetColorWindow
virtual void SetColorWindow(double s)
Set window and level for mapping pixels to colors.
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:205
vtkImageViewer2::GetSliceRange
virtual void GetSliceRange(int &min, int &max)
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
vtkImageViewer2::SetSliceOrientationToYZ
virtual void SetSliceOrientationToYZ()
Definition: vtkImageViewer2.h:227
vtkImageViewer2::GetSliceRange
virtual void GetSliceRange(int range[2])
Return the minimum and maximum slice values (depending on the orientation this can be in X,...
Definition: vtkImageViewer2.h:266
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageViewer2::Renderer
vtkRenderer * Renderer
Definition: vtkImageViewer2.h:370
vtkImageViewer2::SetRenderWindow
virtual void SetRenderWindow(vtkRenderWindow *arg)
Set your own renderwindow and renderer.