GOFIGURE2
0.9.0
|
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>
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 |
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.
|
protected |
Definition at line 112 of file vtkViewImage.cxx.
|
protected |
Definition at line 201 of file vtkViewImage.cxx.
|
virtual |
Enable or Disable interaction on the view.
Definition at line 516 of file vtkViewImage.cxx.
|
virtual |
Enable or Disable interaction on the view.
Definition at line 510 of file vtkViewImage.cxx.
|
virtual |
Definition at line 437 of file vtkViewImage.cxx.
double * vtkViewImage::GetCameraFocalPoint | ( | void | ) |
Get the camera focal point.
Definition at line 622 of file vtkViewImage.cxx.
double vtkViewImage::GetCameraParallelScale | ( | void | ) |
Get the camera parallel scale.
Definition at line 678 of file vtkViewImage.cxx.
double * vtkViewImage::GetCameraPosition | ( | void | ) |
Get the camera position.
Definition at line 594 of file vtkViewImage.cxx.
double * vtkViewImage::GetCameraViewUp | ( | void | ) |
Get the camera view up.
Definition at line 649 of file vtkViewImage.cxx.
|
inline |
Get the current position in world coordinate.
This framework is only used in vtkViewImage2D to update corner annotations and cursor position.
Definition at line 465 of file vtkViewImage.h.
|
inline |
Get the current position in world coordinate.
[in,out] | point | double 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.
|
virtual |
Enable or Disable interaction on the view.
Definition at line 522 of file vtkViewImage.cxx.
|
virtual |
Convert a world coordinate point into an image indices coordinate point.
NOTE indices has to be erased.
Definition at line 374 of file vtkViewImage.cxx.
|
virtual |
Access to the RenderWindow interactor
Definition at line 563 of file vtkViewImage.cxx.
double vtkViewImage::GetLevel | ( | ) |
Definition at line 722 of file vtkViewImage.cxx.
|
virtual |
Definition at line 569 of file vtkViewImage.cxx.
|
virtual |
Get the pixel value at a given world coordinate point in space, return zero if out of bounds.
Definition at line 306 of file vtkViewImage.cxx.
double vtkViewImage::GetWindow | ( | ) |
Definition at line 708 of file vtkViewImage.cxx.
|
virtual |
Convert an indices coordinate point (image coordinates) into a world coordinate point.
Definition at line 339 of file vtkViewImage.cxx.
|
virtual |
Reimplemented in vtkViewImage3D.
Definition at line 545 of file vtkViewImage.cxx.
|
virtual |
Reset position - zoom - window/level to default.
Reimplemented in vtkViewImage2D.
Definition at line 502 of file vtkViewImage.cxx.
|
virtual |
|
virtual |
Reset the window level.
Definition at line 450 of file vtkViewImage.cxx.
|
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 419 of file vtkViewImage.cxx.
|
virtual |
Definition at line 428 of file vtkViewImage.cxx.
void vtkViewImage::SetCameraFocalPoint | ( | double * | arg | ) |
Set the camera focal point.
[in] | arg | pointer to a double[3] containing the new focal point of the camera |
Definition at line 609 of file vtkViewImage.cxx.
void vtkViewImage::SetCameraParallelScale | ( | double | arg | ) |
Set the camera parallel scale.
[in] | arg | double containing the new parallel scale |
Definition at line 664 of file vtkViewImage.cxx.
void vtkViewImage::SetCameraPosition | ( | double * | arg | ) |
Set the camera position.
[in] | arg | pointer to a double[3] containing the new position of the camera |
Definition at line 582 of file vtkViewImage.cxx.
void vtkViewImage::SetCameraViewUp | ( | double * | arg | ) |
Set the camera view up.
[in] | arg | pointer to a double[3] containing the new view up of the camera |
Definition at line 636 of file vtkViewImage.cxx.
|
virtual |
Definition at line 278 of file vtkViewImage.cxx.
|
virtual |
Set window and level for mapping pixels to colors.
Definition at line 251 of file vtkViewImage.cxx.
|
virtual |
Definition at line 165 of file vtkViewImage.cxx.
void vtkViewImage::SetLevel | ( | double | iLevel | ) |
Definition at line 715 of file vtkViewImage.cxx.
|
virtual |
Definition at line 228 of file vtkViewImage.cxx.
|
virtual |
Reimplemented in vtkViewImage2D, and vtkViewImage3D.
Definition at line 218 of file vtkViewImage.cxx.
|
virtual |
Change the visibility of the annotations.
[in] | iShowAnnotations | int 0: annotations are not visible 1: annotations are visible |
Reimplemented in vtkViewImage2D.
Definition at line 694 of file vtkViewImage.cxx.
|
virtual |
Show/Hide scalar bar.
Definition at line 528 of file vtkViewImage.cxx.
|
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.
[in] | iSlice | New position of the slice |
Reimplemented in vtkViewImage2D, and vtkViewImage3D.
Definition at line 276 of file vtkViewImage.h.
|
virtual |
Definition at line 244 of file vtkViewImage.cxx.
void vtkViewImage::SetWindow | ( | double | iWindow | ) |
Definition at line 701 of file vtkViewImage.cxx.
void vtkViewImage::SetWorldCoordinates | ( | const double & | x, |
const double & | y, | ||
const double & | z | ||
) |
Set the world coordinates.
[in] | x | x value |
[in] | y | y value |
[in] | z | z 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 297 of file vtkViewImage.cxx.
|
pure virtual |
Implemented in vtkViewImage3D, and vtkViewImage2D.
|
inlinevirtual |
Reimplemented in vtkViewImage2D.
Definition at line 302 of file vtkViewImage.h.
void vtkViewImage::UpdateWindowLevel | ( | void | ) |
Definition at line 471 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.
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 | |||
) |
|
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.
|
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.
|
protected |
Definition at line 552 of file vtkViewImage.h.
|
protected |
Definition at line 554 of file vtkViewImage.h.
|
protected |
Definition at line 568 of file vtkViewImage.h.
|
protected |
Definition at line 571 of file vtkViewImage.h.
|
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.
|
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.
|
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.
|
protected |
Get the scalar bar actor. This instance follows the color window/level of the viewer.
Definition at line 545 of file vtkViewImage.h.
|
protected |
local instances.
Definition at line 559 of file vtkViewImage.h.
|
protected |
Definition at line 560 of file vtkViewImage.h.
|
protected |
The TextProperty instance (GetTextProperty()) describes the font and other settings of the CornerAnnotation instance (GetCornerAnnotation())
Definition at line 535 of file vtkViewImage.h.
|
protected |
Definition at line 570 of file vtkViewImage.h.