GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkViewImage Class Referenceabstract

This class is a top-level convenience class for displaying a scalar - or RGB image in a 2D or 3D scene. More...

#include <Code/ExternalCode/MegaVTK/vtkRenderingAddOn/vtkViewImage.h>

Inheritance diagram for vtkViewImage:
Inheritance graph
[legend]
Collaboration diagram for vtkViewImage:
Collaboration graph
[legend]

Public Member Functions

virtual void Disable (void)
 Enable or Disable interaction on the view. More...
 
virtual void Enable (void)
 Enable or Disable interaction on the view. More...
 
virtual double * GetBackground (void)
 
double * GetCameraFocalPoint (void)
 Get the camera focal point. More...
 
double GetCameraParallelScale (void)
 Get the camera parallel scale. More...
 
double * GetCameraPosition (void)
 Get the camera position. More...
 
double * GetCameraViewUp (void)
 Get the camera view up. More...
 
double * GetCurrentPoint (void)
 Get the current position in world coordinate. More...
 
void GetCurrentPoint (double point[3])
 Get the current position in world coordinate. More...
 
virtual bool GetEnabled (void)
 Enable or Disable interaction on the view. More...
 
virtual int * GetImageCoordinatesFromWorldCoordinates (double position[3])
 Convert a world coordinate point into an image indices coordinate point. More...
 
virtual vtkRenderWindowInteractor * GetInteractor ()
 
double GetLevel ()
 
virtual vtkRenderWindowInteractor * GetRenderWindowInteractor ()
 
virtual double GetValueAtPosition (double worldcoordinates[3], int component=0)
 Get the pixel value at a given world coordinate point in space, return zero if out of bounds. More...
 
double GetWindow ()
 
virtual double * GetWorldCoordinatesFromImageCoordinates (int indices[3])
 Convert an indices coordinate point (image coordinates) into a world coordinate point. More...
 
virtual void Render (void)
 
virtual void Reset (void)
 Reset position - zoom - window/level to default. More...
 
virtual void ResetCamera (void)
 Reset the camera. More...
 
virtual void ResetWindowLevel (void)
 Reset the window level. More...
 
virtual void SetBackground (double rgb[3])
 Set the background color. Format is RGB, 0 <= R,G,B <=1 Example: SetBackground(0.9,0.9,0.9) for grey-white. More...
 
virtual void SetBackground (const double &r, const double &g, const double &b)
 
void SetCameraFocalPoint (double *arg)
 Set the camera focal point. More...
 
void SetCameraParallelScale (double arg)
 Set the camera parallel scale. More...
 
void SetCameraPosition (double *arg)
 Set the camera position. More...
 
void SetCameraViewUp (double *arg)
 Set the camera view up. More...
 
virtual void SetColorLevel (double s)
 
virtual void SetColorWindow (double s)
 Set window and level for mapping pixels to colors. More...
 
virtual void SetInput (vtkImageData *input)
 
void SetLevel (double iLevel)
 
virtual void SetLookupTable (vtkLookupTable *lookuptable)
 
virtual void SetOrientationMatrix (vtkMatrix4x4 *matrix)
 
virtual void SetShowAnnotations (const int &iShowAnnotations)
 Change the visibility of the annotations. More...
 
virtual void SetShowScalarBar (const bool &)
 Show/Hide scalar bar. More...
 
virtual void SetSlice (int iSlice)
 Set/Get the current slice to display (depending on the orientation this can be in X, Y or Z). More...
 
virtual void SetTextProperty (vtkTextProperty *textproperty)
 
void SetWindow (double iWindow)
 
void SetWorldCoordinates (const double &x, const double &y, const double &z)
 Set the world coordinates. More...
 
virtual void SetWorldCoordinates (double pos[3])=0
 
virtual void Update (void)
 
void UpdateWindowLevel ()
 
 vtkBooleanMacro (ShowAnnotations, int)
 Set the annotation status. 0: annotations are not visible 1: annotations are visible. More...
 
 vtkBooleanMacro (ShowScalarBar, int)
 Set the visibility of the scalar bar. 0: scalar bar is not visible 1: scalar bar is visible. More...
 
 vtkGetMacro (ShowAnnotations, int)
 Get the annotation status. 0: annotations are not visible 1: annotations are visible. More...
 
 vtkGetMacro (ShowScalarBar, int)
 Get the visibility of the scalar bar. 0: scalar bar is not visible 1: scalar bar is visible. More...
 
 vtkGetMacro (IsColor, bool)
 Get information about the color of the image. true: multi-channels image (i.e. color) false: single-channel image (i.e. black and white) More...
 
 vtkGetMacro (IntersectionLineWidth, float)
 Get the linewidth for added dataset in the scene (when using AddDataSet) More...
 
 vtkGetObjectMacro (CornerAnnotation, vtkCornerAnnotation)
 Get the corner annotation. More...
 
 vtkGetObjectMacro (ScalarBarActor, vtkScalarBarActor)
 Get the scalar bar actor. This instance follows the color window/level of the viewer. More...
 
 vtkGetObjectMacro (OrientationMatrix, vtkMatrix4x4)
 The OrientationMatrix instance (GetOrientationMatrix()) is a very important added feature of this viewer. It describes the rotation and translation to apply to the image bouding box (axis aligned) to the world coordinate system. More...
 
 vtkGetObjectMacro (LookupTable, vtkLookupTable)
 
 vtkGetObjectMacro (TextProperty, vtkTextProperty)
 Get a pointer to the current vtkTextProperty. More...
 
 vtkSetMacro (IntersectionLineWidth, float)
 Set the linewidth for added dataset in the scene (when using AddDataSet) More...
 
 vtkTypeRevisionMacro (vtkViewImage, vtkImageViewer2)
 

Protected Member Functions

 vtkViewImage ()
 
 ~vtkViewImage ()
 

Protected Attributes

vtkCornerAnnotation * CornerAnnotation
 
double CurrentPoint [3]
 
std::string DirectionAnnotationMatrix [3][2]
 
float IntersectionLineWidth
 
bool IsColor
 
double Level
 
vtkLookupTable * LookupTable
 
vtkMatrix4x4 * OrientationMatrix
 
vtkMatrixToLinearTransform * OrientationTransform
 
vtkScalarBarActor * ScalarBarActor
 
int ShowAnnotations
 
int ShowScalarBar
 
vtkTextProperty * TextProperty
 
double Window
 

Detailed Description

This class is a top-level convenience class for displaying a scalar - or RGB image in a 2D or 3D scene.

It inherits from the vtkImageViewer2 class, which is initially designed for 2D scene visualization. However, vtkViewImage overrides some of its parents' methods (SetSlice()) in order to generalize its purpose to 2D AND 3D scene visualization.

As a high-level class, it provides the user with convinient functionalities such as a colormap (SetLookupTable()), a scalar bar (ScalarBarActor), some corner annotations (CornerAnnotation), access to the background color (SetBackground()), the annotation text properties (SetTextProperty()), or a call for reseting to default values (Reset() or ResetCamera()).

The principle add-on of this class is to tacke the common issue of placing different objects in a same consistent reference frame. In a world coordinates system, an volume image can be localized by its origin and its spacing, and an orientation vector defining how to rotate the volume to be consistent with reality.

The vtkImageData class has among its attributes the origin and the spacing information. However, the orientation information is missing.

The vtkViewImage class tackle this lack by providing the user the possibility to set an orientation matrix with SetOrientationMatrix(). This matrix will directly be applied to the actor describing the image in the 2D - or 3D - scene. The rotation 3x3 component of this matrix has to be orthogonal (no scaling). The offset component may contain the origin information. In this case the user will have to make sure that this information is absent from the vtkImageData instance given in SetInput(). For that you can call : view->GetInput()->SetOrigin(0,0,0).

Definition at line 183 of file vtkViewImage.h.

Constructor & Destructor Documentation

vtkViewImage::vtkViewImage ( )
protected

Definition at line 112 of file vtkViewImage.cxx.

vtkViewImage::~vtkViewImage ( )
protected

Definition at line 205 of file vtkViewImage.cxx.

Member Function Documentation

void vtkViewImage::Disable ( void  )
virtual

Enable or Disable interaction on the view.

Definition at line 520 of file vtkViewImage.cxx.

void vtkViewImage::Enable ( void  )
virtual

Enable or Disable interaction on the view.

Definition at line 514 of file vtkViewImage.cxx.

double * vtkViewImage::GetBackground ( void  )
virtual

Definition at line 441 of file vtkViewImage.cxx.

double * vtkViewImage::GetCameraFocalPoint ( void  )

Get the camera focal point.

Returns
pointer to a double[3] containing the new focal point of the camera

Definition at line 626 of file vtkViewImage.cxx.

double vtkViewImage::GetCameraParallelScale ( void  )

Get the camera parallel scale.

Returns
double containing the new parallel scale

Definition at line 682 of file vtkViewImage.cxx.

double * vtkViewImage::GetCameraPosition ( void  )

Get the camera position.

Returns
pointer to a double[3] containing the position of the camera

Definition at line 598 of file vtkViewImage.cxx.

double * vtkViewImage::GetCameraViewUp ( void  )

Get the camera view up.

Returns
pointer to a double[3] containing the new view up of the camera

Definition at line 653 of file vtkViewImage.cxx.

double* vtkViewImage::GetCurrentPoint ( void  )
inline

Get the current position in world coordinate.

Returns
double pointer to the current position in world coordinates

This framework is only used in vtkViewImage2D to update corner annotations and cursor position.

Definition at line 465 of file vtkViewImage.h.

void vtkViewImage::GetCurrentPoint ( double  point[3])
inline

Get the current position in world coordinate.

Parameters
[in,out]pointdouble pointer to the current position in world coordinates (double[3])

This framework is only used in vtkViewImage2D to update corner annotations and cursor position.

Definition at line 475 of file vtkViewImage.h.

bool vtkViewImage::GetEnabled ( void  )
virtual

Enable or Disable interaction on the view.

Definition at line 526 of file vtkViewImage.cxx.

int * vtkViewImage::GetImageCoordinatesFromWorldCoordinates ( double  position[3])
virtual

Convert a world coordinate point into an image indices coordinate point.

NOTE indices has to be erased.

Definition at line 378 of file vtkViewImage.cxx.

vtkRenderWindowInteractor * vtkViewImage::GetInteractor ( )
virtual

Access to the RenderWindow interactor

Definition at line 567 of file vtkViewImage.cxx.

double vtkViewImage::GetLevel ( )

Definition at line 726 of file vtkViewImage.cxx.

vtkRenderWindowInteractor * vtkViewImage::GetRenderWindowInteractor ( )
virtual

Definition at line 573 of file vtkViewImage.cxx.

double vtkViewImage::GetValueAtPosition ( double  worldcoordinates[3],
int  component = 0 
)
virtual

Get the pixel value at a given world coordinate point in space, return zero if out of bounds.

Definition at line 310 of file vtkViewImage.cxx.

double vtkViewImage::GetWindow ( )

Definition at line 712 of file vtkViewImage.cxx.

double * vtkViewImage::GetWorldCoordinatesFromImageCoordinates ( int  indices[3])
virtual

Convert an indices coordinate point (image coordinates) into a world coordinate point.

Definition at line 343 of file vtkViewImage.cxx.

void vtkViewImage::Render ( void  )
virtual

Reimplemented in vtkViewImage3D.

Definition at line 549 of file vtkViewImage.cxx.

void vtkViewImage::Reset ( void  )
virtual

Reset position - zoom - window/level to default.

Reimplemented in vtkViewImage2D.

Definition at line 506 of file vtkViewImage.cxx.

void vtkViewImage::ResetCamera ( void  )
virtual

Reset the camera.

Reimplemented in vtkViewImage2D.

Definition at line 497 of file vtkViewImage.cxx.

void vtkViewImage::ResetWindowLevel ( void  )
virtual

Reset the window level.

Definition at line 454 of file vtkViewImage.cxx.

void vtkViewImage::SetBackground ( double  rgb[3])
virtual

Set the background color. Format is RGB, 0 <= R,G,B <=1 Example: SetBackground(0.9,0.9,0.9) for grey-white.

Definition at line 423 of file vtkViewImage.cxx.

void vtkViewImage::SetBackground ( const double &  r,
const double &  g,
const double &  b 
)
virtual

Definition at line 432 of file vtkViewImage.cxx.

void vtkViewImage::SetCameraFocalPoint ( double *  arg)

Set the camera focal point.

Parameters
[in]argpointer to a double[3] containing the new focal point of the camera

Definition at line 613 of file vtkViewImage.cxx.

void vtkViewImage::SetCameraParallelScale ( double  arg)

Set the camera parallel scale.

Parameters
[in]argdouble containing the new parallel scale

Definition at line 668 of file vtkViewImage.cxx.

void vtkViewImage::SetCameraPosition ( double *  arg)

Set the camera position.

Parameters
[in]argpointer to a double[3] containing the new position of the camera

Definition at line 586 of file vtkViewImage.cxx.

void vtkViewImage::SetCameraViewUp ( double *  arg)

Set the camera view up.

Parameters
[in]argpointer to a double[3] containing the new view up of the camera

Definition at line 640 of file vtkViewImage.cxx.

void vtkViewImage::SetColorLevel ( double  s)
virtual

Definition at line 282 of file vtkViewImage.cxx.

void vtkViewImage::SetColorWindow ( double  s)
virtual

Set window and level for mapping pixels to colors.

Definition at line 255 of file vtkViewImage.cxx.

void vtkViewImage::SetInput ( vtkImageData *  input)
virtual

Definition at line 169 of file vtkViewImage.cxx.

void vtkViewImage::SetLevel ( double  iLevel)

Definition at line 719 of file vtkViewImage.cxx.

void vtkViewImage::SetLookupTable ( vtkLookupTable *  lookuptable)
virtual

Definition at line 232 of file vtkViewImage.cxx.

void vtkViewImage::SetOrientationMatrix ( vtkMatrix4x4 *  matrix)
virtual

Reimplemented in vtkViewImage2D, and vtkViewImage3D.

Definition at line 222 of file vtkViewImage.cxx.

void vtkViewImage::SetShowAnnotations ( const int &  iShowAnnotations)
virtual

Change the visibility of the annotations.

Parameters
[in]iShowAnnotationsint 0: annotations are not visible 1: annotations are visible

Reimplemented in vtkViewImage2D.

Definition at line 698 of file vtkViewImage.cxx.

void vtkViewImage::SetShowScalarBar ( const bool &  val)
virtual

Show/Hide scalar bar.

Definition at line 532 of file vtkViewImage.cxx.

virtual void vtkViewImage::SetSlice ( int  iSlice)
inlinevirtual

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

This method has been overriden in order to generalize the use of this class to 2D AND 3D scene visualization. Thus in this top-level class SetSlice() does not do anything.

Parameters
[in]iSliceNew position of the slice

Reimplemented in vtkViewImage2D, and vtkViewImage3D.

Definition at line 276 of file vtkViewImage.h.

void vtkViewImage::SetTextProperty ( vtkTextProperty *  textproperty)
virtual

Definition at line 248 of file vtkViewImage.cxx.

void vtkViewImage::SetWindow ( double  iWindow)

Definition at line 705 of file vtkViewImage.cxx.

void vtkViewImage::SetWorldCoordinates ( const double &  x,
const double &  y,
const double &  z 
)

Set the world coordinates.

Parameters
[in]xx value
[in]yy value
[in]zz value

The world is not always what we think it is ... Use this method to move the viewer slice such that the position (in world coordinates) given by the arguments is contained by the slice plane. If the given position is outside the bounds of the image, then the slice will be as close as possible.

Definition at line 301 of file vtkViewImage.cxx.

virtual void vtkViewImage::SetWorldCoordinates ( double  pos[3])
pure virtual

Implemented in vtkViewImage3D, and vtkViewImage2D.

virtual void vtkViewImage::Update ( void  )
inlinevirtual

Reimplemented in vtkViewImage2D.

Definition at line 302 of file vtkViewImage.h.

void vtkViewImage::UpdateWindowLevel ( void  )

Definition at line 475 of file vtkViewImage.cxx.

vtkViewImage::vtkBooleanMacro ( ShowAnnotations  ,
int   
)

Set the annotation status. 0: annotations are not visible 1: annotations are visible.

vtkViewImage::vtkBooleanMacro ( ShowScalarBar  ,
int   
)

Set the visibility of the scalar bar. 0: scalar bar is not visible 1: scalar bar is visible.

vtkViewImage::vtkGetMacro ( ShowAnnotations  ,
int   
)

Get the annotation status. 0: annotations are not visible 1: annotations are visible.

vtkViewImage::vtkGetMacro ( ShowScalarBar  ,
int   
)

Get the visibility of the scalar bar. 0: scalar bar is not visible 1: scalar bar is visible.

vtkViewImage::vtkGetMacro ( IsColor  ,
bool   
)

Get information about the color of the image. true: multi-channels image (i.e. color) false: single-channel image (i.e. black and white)

vtkViewImage::vtkGetMacro ( IntersectionLineWidth  ,
float   
)

Get the linewidth for added dataset in the scene (when using AddDataSet)

vtkViewImage::vtkGetObjectMacro ( CornerAnnotation  ,
vtkCornerAnnotation   
)

Get the corner annotation.

Todo:
make the corner annotation such that it follows the slice number, the image scalar value at cursor, the spacing, etc
vtkViewImage::vtkGetObjectMacro ( ScalarBarActor  ,
vtkScalarBarActor   
)

Get the scalar bar actor. This instance follows the color window/level of the viewer.

vtkViewImage::vtkGetObjectMacro ( OrientationMatrix  ,
vtkMatrix4x4   
)

The OrientationMatrix instance (GetOrientationMatrix()) is a very important added feature of this viewer. It describes the rotation and translation to apply to the image bouding box (axis aligned) to the world coordinate system.

Rotation part is usually given by the GetDirection() method on an itk::Image for instance. Translation usually correspond to the origin of the image given by GetOrigin() on an itk::Image.

CAUTION: if you provide non-zero origin to the viewer vtkImageData input (SetInput()), then don't provide translation to the OrientationMatrix instance, otherwise the information is redundant.

The best behaviour is to force the origin of the vtkImageData input to zero and provide this origin information in the OrientationMatrix.

vtkViewImage::vtkGetObjectMacro ( LookupTable  ,
vtkLookupTable   
)

The LookupTable instance (GetLookupTable()) can be used to set a user-defined color-table to the viewer. Default is a linear black to white table.

vtkViewImage::vtkGetObjectMacro ( TextProperty  ,
vtkTextProperty   
)

Get a pointer to the current vtkTextProperty.

The TextProperty instance (GetTextProperty()) describes the font and other settings of the CornerAnnotation instance (GetCornerAnnotation())

vtkViewImage::vtkSetMacro ( IntersectionLineWidth  ,
float   
)

Set the linewidth for added dataset in the scene (when using AddDataSet)

vtkViewImage::vtkTypeRevisionMacro ( vtkViewImage  ,
vtkImageViewer2   
)

Member Data Documentation

vtkCornerAnnotation* vtkViewImage::CornerAnnotation
protected

The corner annotation gather information related to the image. In vtkViewImage2D, it displays slice number, spacing, window-level, position, etc Access and change the values with GetCornerAnnotation()->SetText(n, const char*). n begins down-right and increases anti-clockwise.

Definition at line 530 of file vtkViewImage.h.

double vtkViewImage::CurrentPoint[3]
protected

Get the current position in world coordinate. This framework is only used in vtkViewImage2D to update corner annotations and cursor position.

Definition at line 566 of file vtkViewImage.h.

std::string vtkViewImage::DirectionAnnotationMatrix[3][2]
protected

Definition at line 552 of file vtkViewImage.h.

float vtkViewImage::IntersectionLineWidth
protected

Definition at line 554 of file vtkViewImage.h.

bool vtkViewImage::IsColor
protected

Definition at line 568 of file vtkViewImage.h.

double vtkViewImage::Level
protected

Definition at line 571 of file vtkViewImage.h.

vtkLookupTable* vtkViewImage::LookupTable
protected

The LookupTable instance (GetLookupTable()) can be used to set a user-defined color-table to the viewer. Default is a linear black to white table.

Definition at line 540 of file vtkViewImage.h.

vtkMatrix4x4* vtkViewImage::OrientationMatrix
protected

The OrientationMatrix instance (GetOrientationMatrix()) is a very important added feature of this viewer. It describes the rotation and translation to apply to the image bouding box (axis aligned) to the world coordinate system.

Rotation part is usually given by the GetDirection() method on an itk::Image for instance. Translation usually correspond to the origin of the image given by GetOrigin() on an itk::Image.

CAUTION: if you provide non-zero origin to the viewer vtkImageData input (SetInput()), then don't provide translation to the OrientationMatrix instance, otherwise the information is redundant.

The best behaviour is to force the origin of the vtkImageData input to zero and provide this origin information in the OrientationMatrix.

Definition at line 523 of file vtkViewImage.h.

vtkMatrixToLinearTransform* vtkViewImage::OrientationTransform
protected

This vtkTransform instance carries the OrientationMatrix (see GetOrientationMatrix()) and is used to quickly transform the slice plane in vtkViewImage2D.

Definition at line 550 of file vtkViewImage.h.

vtkScalarBarActor* vtkViewImage::ScalarBarActor
protected

Get the scalar bar actor. This instance follows the color window/level of the viewer.

Definition at line 545 of file vtkViewImage.h.

int vtkViewImage::ShowAnnotations
protected

local instances.

Definition at line 559 of file vtkViewImage.h.

int vtkViewImage::ShowScalarBar
protected

Definition at line 560 of file vtkViewImage.h.

vtkTextProperty* vtkViewImage::TextProperty
protected

The TextProperty instance (GetTextProperty()) describes the font and other settings of the CornerAnnotation instance (GetCornerAnnotation())

Definition at line 535 of file vtkViewImage.h.

double vtkViewImage::Window
protected

Definition at line 570 of file vtkViewImage.h.


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