vtkgdcm
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkImageColorViewer Class Reference

Display a 2D image. More...

#include <vtkImageColorViewer.h>

Inherits vtkObject.

Collaboration diagram for vtkImageColorViewer:
[legend]

Public Types

enum  { SLICE_ORIENTATION_YZ = 0 , SLICE_ORIENTATION_XZ = 1 , SLICE_ORIENTATION_XY = 2 }
 Set/get the slice orientation BTX. More...
 
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual const char * GetWindowName ()
 Get the name of rendering window. More...
 
virtual void Render (void)
 Render the resulting image. More...
 
virtual void SetInput (vtkImageData *in)
 Set/Get the input image to the viewer. More...
 
virtual vtkImageData * GetInput ()
 
virtual void SetInputConnection (vtkAlgorithmOutput *input)
 
virtual void AddInputConnection (vtkAlgorithmOutput *input)
 
virtual void AddInput (vtkImageData *input)
 
double GetOverlayVisibility ()
 
void SetOverlayVisibility (double vis)
 
virtual int GetSliceOrientation ()
 
virtual void SetSliceOrientation (int orientation)
 
virtual void SetSliceOrientationToXY ()
 
virtual void SetSliceOrientationToYZ ()
 
virtual void SetSliceOrientationToXZ ()
 
virtual int GetSlice ()
 Set/Get the current slice to display (depending on the orientation this can be in X, Y or Z). More...
 
virtual void SetSlice (int s)
 
virtual void UpdateDisplayExtent ()
 Update the display extent manually so that the proper slice for the given orientation is displayed. More...
 
virtual int GetSliceMin ()
 Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z). More...
 
virtual int GetSliceMax ()
 
virtual void GetSliceRange (int range[2])
 
virtual void GetSliceRange (int &min, int &max)
 
virtual int * GetSliceRange ()
 
virtual double GetColorWindow ()
 Set window and level for mapping pixels to colors. More...
 
virtual double GetColorLevel ()
 
virtual void SetColorWindow (double s)
 
virtual void SetColorLevel (double s)
 
virtual void SetDisplayId (void *a)
 These are here when using a Tk window. More...
 
virtual void SetWindowId (void *a)
 
virtual void SetParentId (void *a)
 
virtual int * GetPosition ()
 Set/Get the position in screen coordinates of the rendering window. More...
 
virtual void SetPosition (int a, int b)
 
virtual void SetPosition (int a[2])
 
virtual int * GetSize ()
 Set/Get the size of the window in screen coordinates in pixels. More...
 
virtual void SetSize (int a, int b)
 
virtual void SetSize (int a[2])
 
virtual vtkRenderWindow * GetRenderWindow ()
 Get the internal render window, renderer, image actor, and image map instances. More...
 
virtual vtkRenderer * GetRenderer ()
 
virtual vtkImageActor * GetImageActor ()
 
virtual vtkImageMapToWindowLevelColors2GetWindowLevel ()
 
virtual vtkInteractorStyleImage * GetInteractorStyle ()
 
virtual void SetRenderWindow (vtkRenderWindow *arg)
 Set your own renderwindow and renderer. More...
 
virtual void SetRenderer (vtkRenderer *arg)
 
virtual void SetupInteractor (vtkRenderWindowInteractor *)
 Attach an interactor for the internal render window. More...
 
virtual void SetOffScreenRendering (int)
 Create a window in memory instead of on the screen. More...
 
virtual int GetOffScreenRendering ()
 
virtual void OffScreenRenderingOn ()
 
virtual void OffScreenRenderingOff ()
 
int GetWholeZMin ()
 
int GetWholeZMax ()
 
int GetZSlice ()
 
void SetZSlice (int)
 

Static Public Member Functions

static vtkImageColorViewerNew ()
 
static int IsTypeOf (const char *type)
 
static vtkImageColorViewerSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkImageColorViewer ()
 
 ~vtkImageColorViewer ()
 
virtual void InstallPipeline ()
 
virtual void UnInstallPipeline ()
 
virtual void UpdateOrientation ()
 

Protected Attributes

vtkImageMapToWindowLevelColors2WindowLevel
 
vtkRenderWindow * RenderWindow
 
vtkRenderer * Renderer
 
vtkImageActor * ImageActor
 
vtkImageActor * OverlayImageActor
 
vtkRenderWindowInteractor * Interactor
 
vtkInteractorStyleImage * InteractorStyle
 
int SliceOrientation
 
int FirstRender
 
int Slice
 

Friends

class vtkImageColorViewerCallback
 

Detailed Description

Display a 2D image.

vtkImageColorViewer is a convenience class for displaying a 2D image. It packages up the functionality found in vtkRenderWindow, vtkRenderer, vtkImageActor and vtkImageMapToWindowLevelColors into a single easy to use class. This class also creates an image interactor style (vtkInteractorStyleImage) that allows zooming and panning of images, and supports interactive window/level operations on the image. Note that vtkImageColorViewer is simply a wrapper around these classes.

vtkImageColorViewer uses the 3D rendering and texture mapping engine to draw an image on a plane. This allows for rapid rendering, zooming, and panning. The image is placed in the 3D scene at a depth based on the z-coordinate of the particular image slice. Each call to SetSlice() changes the image data (slice) displayed AND changes the depth of the displayed slice in the 3D scene. This can be controlled by the AutoAdjustCameraClippingRange ivar of the InteractorStyle member.

It is possible to mix images and geometry, using the methods:

viewer->SetInput( myImage ); viewer->GetRenderer()->AddActor( myActor );

This can be used to annotate an image with a PolyData of "edges" or or highlight sections of an image or display a 3D isosurface with a slice from the volume, etc. Any portions of your geometry that are in front of the displayed slice will be visible; any portions of your geometry that are behind the displayed slice will be obscured. A more general framework (with respect to viewing direction) for achieving this effect is provided by the vtkImagePlaneWidget .

Note that pressing 'r' will reset the window/level and pressing shift+'r' or control+'r' will reset the camera.

See also
vtkRenderWindow vtkRenderer vtkImageActor vtkImageMapToWindowLevelColors

Definition at line 75 of file vtkImageColorViewer.h.

Member Typedef Documentation

◆ Superclass

Definition at line 79 of file vtkImageColorViewer.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Set/get the slice orientation BTX.

Enumerator
SLICE_ORIENTATION_YZ 
SLICE_ORIENTATION_XZ 
SLICE_ORIENTATION_XY 

Definition at line 116 of file vtkImageColorViewer.h.

Constructor & Destructor Documentation

◆ vtkImageColorViewer()

vtkImageColorViewer::vtkImageColorViewer ( )
protected

◆ ~vtkImageColorViewer()

vtkImageColorViewer::~vtkImageColorViewer ( )
protected

Member Function Documentation

◆ New()

static vtkImageColorViewer* vtkImageColorViewer::New ( )
static

◆ GetClassName()

virtual const char* vtkImageColorViewer::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkImageColorViewer::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkImageColorViewer::IsA ( const char *  type)
virtual

◆ SafeDownCast()

static vtkImageColorViewer* vtkImageColorViewer::SafeDownCast ( vtkObject *  o)
static

◆ PrintSelf()

void vtkImageColorViewer::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

◆ GetWindowName()

virtual const char* vtkImageColorViewer::GetWindowName ( )
virtual

Get the name of rendering window.

◆ Render()

virtual void vtkImageColorViewer::Render ( void  )
virtual

Render the resulting image.

◆ SetInput()

virtual void vtkImageColorViewer::SetInput ( vtkImageData *  in)
virtual

Set/Get the input image to the viewer.

◆ GetInput()

virtual vtkImageData* vtkImageColorViewer::GetInput ( )
virtual

◆ SetInputConnection()

virtual void vtkImageColorViewer::SetInputConnection ( vtkAlgorithmOutput *  input)
virtual

◆ AddInputConnection()

virtual void vtkImageColorViewer::AddInputConnection ( vtkAlgorithmOutput *  input)
virtual

◆ AddInput()

virtual void vtkImageColorViewer::AddInput ( vtkImageData *  input)
virtual

◆ GetOverlayVisibility()

double vtkImageColorViewer::GetOverlayVisibility ( )

◆ SetOverlayVisibility()

void vtkImageColorViewer::SetOverlayVisibility ( double  vis)

◆ GetSliceOrientation()

virtual int vtkImageColorViewer::GetSliceOrientation ( )
virtual

◆ SetSliceOrientation()

virtual void vtkImageColorViewer::SetSliceOrientation ( int  orientation)
virtual

◆ SetSliceOrientationToXY()

virtual void vtkImageColorViewer::SetSliceOrientationToXY ( )
inlinevirtual

Definition at line 125 of file vtkImageColorViewer.h.

◆ SetSliceOrientationToYZ()

virtual void vtkImageColorViewer::SetSliceOrientationToYZ ( )
inlinevirtual

Definition at line 127 of file vtkImageColorViewer.h.

◆ SetSliceOrientationToXZ()

virtual void vtkImageColorViewer::SetSliceOrientationToXZ ( )
inlinevirtual

Definition at line 129 of file vtkImageColorViewer.h.

◆ GetSlice()

virtual int vtkImageColorViewer::GetSlice ( )
virtual

Set/Get the current slice to display (depending on the orientation this can be in X, Y or Z).

◆ SetSlice()

virtual void vtkImageColorViewer::SetSlice ( int  s)
virtual

◆ UpdateDisplayExtent()

virtual void vtkImageColorViewer::UpdateDisplayExtent ( )
virtual

Update the display extent manually so that the proper slice for the given orientation is displayed.

It will also try to set a reasonable camera clipping range. This method is called automatically when the Input is changed, but most of the time the input of this class is likely to remain the same, i.e. connected to the output of a filter, or an image reader. When the input of this filter or reader itself is changed, an error message might be displayed since the current display extent is probably outside the new whole extent. Calling this method will ensure that the display extent is reset properly.

◆ GetSliceMin()

virtual int vtkImageColorViewer::GetSliceMin ( )
virtual

Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z).

◆ GetSliceMax()

virtual int vtkImageColorViewer::GetSliceMax ( )
virtual

◆ GetSliceRange() [1/3]

virtual void vtkImageColorViewer::GetSliceRange ( int  range[2])
inlinevirtual

Definition at line 163 of file vtkImageColorViewer.h.

◆ GetSliceRange() [2/3]

virtual void vtkImageColorViewer::GetSliceRange ( int &  min,
int &  max 
)
virtual

◆ GetSliceRange() [3/3]

virtual int* vtkImageColorViewer::GetSliceRange ( )
virtual

◆ GetColorWindow()

virtual double vtkImageColorViewer::GetColorWindow ( )
virtual

Set window and level for mapping pixels to colors.

◆ GetColorLevel()

virtual double vtkImageColorViewer::GetColorLevel ( )
virtual

◆ SetColorWindow()

virtual void vtkImageColorViewer::SetColorWindow ( double  s)
virtual

◆ SetColorLevel()

virtual void vtkImageColorViewer::SetColorLevel ( double  s)
virtual

◆ SetDisplayId()

virtual void vtkImageColorViewer::SetDisplayId ( void *  a)
virtual

These are here when using a Tk window.

◆ SetWindowId()

virtual void vtkImageColorViewer::SetWindowId ( void *  a)
virtual

◆ SetParentId()

virtual void vtkImageColorViewer::SetParentId ( void *  a)
virtual

◆ GetPosition()

virtual int* vtkImageColorViewer::GetPosition ( )
virtual

Set/Get the position in screen coordinates of the rendering window.

◆ SetPosition() [1/2]

virtual void vtkImageColorViewer::SetPosition ( int  a,
int  b 
)
virtual

◆ SetPosition() [2/2]

virtual void vtkImageColorViewer::SetPosition ( int  a[2])
inlinevirtual

Definition at line 194 of file vtkImageColorViewer.h.

◆ GetSize()

virtual int* vtkImageColorViewer::GetSize ( )
virtual

Set/Get the size of the window in screen coordinates in pixels.

◆ SetSize() [1/2]

virtual void vtkImageColorViewer::SetSize ( int  a,
int  b 
)
virtual

◆ SetSize() [2/2]

virtual void vtkImageColorViewer::SetSize ( int  a[2])
inlinevirtual

Definition at line 203 of file vtkImageColorViewer.h.

◆ GetRenderWindow()

virtual vtkRenderWindow* vtkImageColorViewer::GetRenderWindow ( )
virtual

Get the internal render window, renderer, image actor, and image map instances.

◆ GetRenderer()

virtual vtkRenderer* vtkImageColorViewer::GetRenderer ( )
virtual

◆ GetImageActor()

virtual vtkImageActor* vtkImageColorViewer::GetImageActor ( )
virtual

◆ GetWindowLevel()

virtual vtkImageMapToWindowLevelColors2* vtkImageColorViewer::GetWindowLevel ( )
virtual

◆ GetInteractorStyle()

virtual vtkInteractorStyleImage* vtkImageColorViewer::GetInteractorStyle ( )
virtual

◆ SetRenderWindow()

virtual void vtkImageColorViewer::SetRenderWindow ( vtkRenderWindow *  arg)
virtual

Set your own renderwindow and renderer.

◆ SetRenderer()

virtual void vtkImageColorViewer::SetRenderer ( vtkRenderer *  arg)
virtual

◆ SetupInteractor()

virtual void vtkImageColorViewer::SetupInteractor ( vtkRenderWindowInteractor *  )
virtual

Attach an interactor for the internal render window.

◆ SetOffScreenRendering()

virtual void vtkImageColorViewer::SetOffScreenRendering ( int  )
virtual

Create a window in memory instead of on the screen.

This may not be supported for every type of window and on some windows you may need to invoke this prior to the first render.

◆ GetOffScreenRendering()

virtual int vtkImageColorViewer::GetOffScreenRendering ( )
virtual

◆ OffScreenRenderingOn()

virtual void vtkImageColorViewer::OffScreenRenderingOn ( )
virtual

◆ OffScreenRenderingOff()

virtual void vtkImageColorViewer::OffScreenRenderingOff ( )
virtual

◆ GetWholeZMin()

int vtkImageColorViewer::GetWholeZMin ( )

◆ GetWholeZMax()

int vtkImageColorViewer::GetWholeZMax ( )

◆ GetZSlice()

int vtkImageColorViewer::GetZSlice ( )
Deprecated:
Replaced by vtkImageColorViewer::GetSlice() as of VTK 5.0.

◆ SetZSlice()

void vtkImageColorViewer::SetZSlice ( int  )
Deprecated:
Replaced by vtkImageColorViewer::SetSlice() as of VTK 5.0.

◆ InstallPipeline()

virtual void vtkImageColorViewer::InstallPipeline ( )
protectedvirtual

◆ UnInstallPipeline()

virtual void vtkImageColorViewer::UnInstallPipeline ( )
protectedvirtual

◆ UpdateOrientation()

virtual void vtkImageColorViewer::UpdateOrientation ( )
protectedvirtual

Friends And Related Function Documentation

◆ vtkImageColorViewerCallback

friend class vtkImageColorViewerCallback
friend

Definition at line 288 of file vtkImageColorViewer.h.

Member Data Documentation

◆ WindowLevel

vtkImageMapToWindowLevelColors2* vtkImageColorViewer::WindowLevel
protected

Definition at line 269 of file vtkImageColorViewer.h.

◆ RenderWindow

vtkRenderWindow* vtkImageColorViewer::RenderWindow
protected

Definition at line 270 of file vtkImageColorViewer.h.

◆ Renderer

vtkRenderer* vtkImageColorViewer::Renderer
protected

Definition at line 271 of file vtkImageColorViewer.h.

◆ ImageActor

vtkImageActor* vtkImageColorViewer::ImageActor
protected

Definition at line 272 of file vtkImageColorViewer.h.

◆ OverlayImageActor

vtkImageActor* vtkImageColorViewer::OverlayImageActor
protected

Definition at line 273 of file vtkImageColorViewer.h.

◆ Interactor

vtkRenderWindowInteractor* vtkImageColorViewer::Interactor
protected

Definition at line 274 of file vtkImageColorViewer.h.

◆ InteractorStyle

vtkInteractorStyleImage* vtkImageColorViewer::InteractorStyle
protected

Definition at line 275 of file vtkImageColorViewer.h.

◆ SliceOrientation

int vtkImageColorViewer::SliceOrientation
protected

Definition at line 277 of file vtkImageColorViewer.h.

◆ FirstRender

int vtkImageColorViewer::FirstRender
protected

Definition at line 278 of file vtkImageColorViewer.h.

◆ Slice

int vtkImageColorViewer::Slice
protected

Definition at line 279 of file vtkImageColorViewer.h.


The documentation for this class was generated from the following file: