Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkImageScene Class Reference

mitkImageScene - a Scene to display 2D images More...

#include <mitkImageScene.h>

Inherits mitkScene.

Inheritance diagram for mitkImageScene:

Inheritance graph
[legend]
Collaboration diagram for mitkImageScene:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void InitGL ()
virtual void ResizeGL (int newX, int newY)
virtual void RenderGL ()
virtual mitkManipulatorCreateManipulator ()
void GetDataValueAndCoordinate (int mIdx, int x, int y, int &vx, int &vy, int &vz, float &rValue, float &gValue, float &bValue)
void GetVolumeCoordinate (int mIdx, int x, int y, int &vx, int &vy, int &vz)
void GetViewCoordinate (int mIdx, int vx, int vy, int vz, int &sx, int &sy)
void AdjustWidthCenter (float deltX, float deltY)
float GetWindowWidth ()
float GetWindowCenter ()
void SetWindowWidth (float winWidth)
void SetWindowCenter (float winCenter)
void ResetWindowWidthCenter ()
void EnableCrossArrow ()
void DisableCrossArrow ()
void SetCrossArrow (bool isEnabled)
bool GetCrossArrow ()
void SetCrossArrowWidth (int width)
void SetCrossArrowHeight (int height)
int GetCrossArrowWidth ()
int GetCrossArrowHeight ()
void SetCrossArrowPositionX (float xPos)
void SetCrossArrowPositionY (float yPos)
void SetCrossArrowPosition (int mIdx, int vx, int vy)
float GetCrossArrowPositionX ()
float GetCrossArrowPositionY ()
void ResetCrossArrowPosition ()
virtual void ResetScene ()
virtual void Translate (float deltX, float deltY, float deltZ=0)
virtual void Rotate (float deltX, float deltY, float deltZ)
virtual void Rotate (float ax, float ay, float az, float angle)
virtual void Rotate (const mitkQuaternion &q)
virtual void SetRotation (float x, float y, float z)
virtual void SetRotation (float ax, float ay, float az, float angle)
virtual void SetRotation (const mitkQuaternion &q)
virtual void Scale (float delt)

Detailed Description

mitkImageScene - a Scene to display 2D images

mitkImageScene is a 2d Scene to display 2-dimensional images. The purpose of providing it is for the convenience. To display 2d images, you must create one or several image models(mitkImageModel) firstly, then add them using the function

 AddModel() 
. Same as mitkScene, mitkImageScene can be easily integrated into any user interface toolkit, such as MFC in Microsoft Visual C++, VCL in Borland C++ Builder, Trolltech Qt, etc. The following code snippet demonstrate this point:
    mitkImageScene *aScene = new mitkImageScene;
    //Set the parent window, and fill out the whole parent window
    aScene->SetParent(parentWindowId);  
    aScene->SetLeft(0);
    aScene->SetTop(0);
    aScene->SetWidth(parentWindowWidth);
    aScene->SetHeight(parentWindowHeight);  
    aScene->Show();
So mitkImageScene only requires a parent window id and then can integrate into that window seamless.


Member Function Documentation

void mitkImageScene::AdjustWidthCenter float  deltX,
float  deltY
 

Adjust the window width and window center of this scene

Parameters:
deltX Specify the change of the window width
deltY Specify the change of the window center

virtual mitkManipulator* mitkImageScene::CreateManipulator  )  [virtual]
 

Create a default manipulator for the mouse events processing. Subclass can override this function to create a proper manipulator.

Reimplemented from mitkScene.

void mitkImageScene::DisableCrossArrow  )  [inline]
 

Set the cross arrow to disable. If the cross arrow is enabled, the scene will draw a cross arrow and a rectangle centered in the cross.

void mitkImageScene::EnableCrossArrow  )  [inline]
 

Set the cross arrow to enable. If the cross arrow is enabled, the scene will draw a cross arrow and a rectangle centered in the cross.

bool mitkImageScene::GetCrossArrow  )  [inline]
 

Get the status of cross arrow. If the cross arrow is enabled, the scene will draw a cross arrow and a rectangle centered in the cross.

Returns:
Return true, the cross arrow is enabled. Return false, the cross arrow is disabled.

int mitkImageScene::GetCrossArrowHeight  )  [inline]
 

Get the height of the rectangle associated with the cross arrow.

Returns:
Return the height of the rectangle.

float mitkImageScene::GetCrossArrowPositionX  )  [inline]
 

Get the x coordinate of the cross arrow center.

Returns:
Return the x coordinate of the cross arrow center.

float mitkImageScene::GetCrossArrowPositionY  )  [inline]
 

Get the y coordinate of the cross arrow center.

Returns:
Return the y coordinate of the cross arrow center.

int mitkImageScene::GetCrossArrowWidth  )  [inline]
 

Get the width of the rectangle associated with the cross arrow.

Returns:
Return the width of the rectangle.

void mitkImageScene::GetDataValueAndCoordinate int  mIdx,
int  x,
int  y,
int &  vx,
int &  vy,
int &  vz,
float &  rValue,
float &  gValue,
float &  bValue
 

Get the data value and volume coordinate at a specified view coordinate.

Parameters:
mIdx Specify the ith model. The data value and volume coordinate are got from this model.
x Specify the x coordinate in this scene
y Specify the y coordinate in this scene
vx Return the x coordinate in the volume. It is calculate by transforming the point(x,y) from view coordinate to volume coordinate.
vy Return the y coordinate in the volume. It is calculate by transforming the point(x,y) from view coordinate to volume coordinate.
vz Return the z coordinate in the volume. It is calculate by transforming the point(x,y) from view coordinate to volume coordinate.
rValue Return the red component of the data value at point(vx, vy, vz) in the volume. If the volume is gray image(single channel), then rValue = gValue = bValue
gValue Return the green component of the data value at point(vx, vy, vz) in the volume. If the volume is gray image(single channel), then rValue = gValue = bValue
bValue Return the blue component of the data value at point(vx, vy, vz) in the volume. If the volume is gray image(single channel), then rValue = gValue = bValue

void mitkImageScene::GetViewCoordinate int  mIdx,
int  vx,
int  vy,
int  vz,
int &  sx,
int &  sy
 

Get the view (screen) coordinate at a specified volume coordinate.

Parameters:
mIdx Specify the ith model. The data value and volume coordinate are got from this model.
vx the x coordinate in the volume.
vy the y coordinate in the volume.
vz the z coordinate in the volume.
x return the x coordinate in this scene
y return the y coordinate in this scene

void mitkImageScene::GetVolumeCoordinate int  mIdx,
int  x,
int  y,
int &  vx,
int &  vy,
int &  vz
 

Get the volume coordinate at a specified view coordinate.

Parameters:
mIdx Specify the ith model. The data value and volume coordinate are got from this model.
x Specify the x coordinate in this scene
y Specify the y coordinate in this scene
vx Return the x coordinate in the volume. It is calculate by transforming the point(x,y) from view coordinate to volume coordinate.
vy Return the y coordinate in the volume. It is calculate by transforming the point(x,y) from view coordinate to volume coordinate.
vz Return the z coordinate in the volume. It is calculate by transforming the point(x,y) from view coordinate to volume coordinate.

float mitkImageScene::GetWindowCenter  ) 
 

Get the window center of this scene

Returns:
Return the window center of this scene

float mitkImageScene::GetWindowWidth  ) 
 

Get the window width of this scene

Returns:
Return the window width of this scene

virtual void mitkImageScene::InitGL  )  [virtual]
 

Initialize OpenGL variables and resources.

Reimplemented from mitkScene.

virtual void mitkImageScene::RenderGL  )  [virtual]
 

Handle the render event pass by the container

Reimplemented from mitkScene.

void mitkImageScene::ResetCrossArrowPosition  ) 
 

Reset the center position and the rectangle size to the default value.

virtual void mitkImageScene::ResetScene  )  [virtual]
 

Reset the geometric position of all of the models in this scene.

Reimplemented from mitkScene.

void mitkImageScene::ResetWindowWidthCenter  ) 
 

Reset the window width and center to the default value.

virtual void mitkImageScene::ResizeGL int  newX,
int  newY
[virtual]
 

Handle the resize event pass by the container

Reimplemented from mitkScene.

virtual void mitkImageScene::Rotate const mitkQuaternion q  )  [inline, virtual]
 

Rotate all of the models in this scene.

Parameters:
q the quaternion of the rotation
Note:
The rotation is incremental.

Reimplemented from mitkScene.

virtual void mitkImageScene::Rotate float  ax,
float  ay,
float  az,
float  angle
[inline, virtual]
 

Rotate all of the models in this scene around axis (ax,ay,az) for angle degrees.

Parameters:
ax the x-coordinate of rotation axis
ay the y-coordinate of rotation axis
az the z-coordinate of rotation axis
angle the angle of rotation in degrees
Note:
The rotation is incremental.

Reimplemented from mitkScene.

virtual void mitkImageScene::Rotate float  deltX,
float  deltY,
float  deltZ
[virtual]
 

Rotate all of the models in this scene around x, y, z axis.

Parameters:
deltX Specify the rotation around x-axis in degrees.
deltY Specify the rotation around y-axis in degrees.
deltZ Specify the rotation around z-axis in degrees.
Note:
The rotation is incremental.

Reimplemented from mitkScene.

virtual void mitkImageScene::Scale float  delt  )  [virtual]
 

Scale all of the models in this scene in x, y, z directions.

Parameters:
delt Specify the scale in x, y, z directions. This function scales the models equally in each direction.

Reimplemented from mitkScene.

void mitkImageScene::SetCrossArrow bool  isEnabled  )  [inline]
 

Set the status of cross arrow. If the cross arrow is enabled, the scene will draw a cross arrow and a rectangle centered in the cross.

Parameters:
isEnabled isEnabled=true, Set the cross arrow to enable. isEnabled=false, Set the cross arrow to disable.

void mitkImageScene::SetCrossArrowHeight int  height  )  [inline]
 

Set the height of the rectangle associated with the cross arrow.

Parameters:
height Specify the height of the rectangle.

void mitkImageScene::SetCrossArrowPosition int  mIdx,
int  vx,
int  vy
 

Set the cross arrow position according the volume coordinates of the mIdx'th model.

Parameters:
mIdx the index of the model (should be a mitkImageModel)
vx the x-coordinate in the volume space
vy the y-coordinate in the volume space

void mitkImageScene::SetCrossArrowPositionX float  xPos  )  [inline]
 

Set the x coordinate of the cross arrow center.

Parameters:
xPos Specify the x coordinate of the cross arrow center.

void mitkImageScene::SetCrossArrowPositionY float  yPos  )  [inline]
 

Set the y coordinate of the cross arrow center.

Parameters:
yPos Specify the y coordinate of the cross arrow center.

void mitkImageScene::SetCrossArrowWidth int  width  )  [inline]
 

Set the width of the rectangle associated with the cross arrow.

Parameters:
width Specify the width of the rectangle.

virtual void mitkImageScene::SetRotation const mitkQuaternion q  )  [inline, virtual]
 

Set rotations of all models in this scene to the quaternion "q".

Parameters:
q the quaternion of the rotation

Reimplemented from mitkScene.

virtual void mitkImageScene::SetRotation float  ax,
float  ay,
float  az,
float  angle
[inline, virtual]
 

Set rotations of all models in this scene.

Parameters:
ax the x-coordinate of rotation axis
ay the y-coordinate of rotation axis
az the z-coordinate of rotation axis
angle the angle of rotation in degrees

Reimplemented from mitkScene.

virtual void mitkImageScene::SetRotation float  x,
float  y,
float  z
[virtual]
 

Set rotations of all models in this scene.

Parameters:
x Specify the rotation around x-axis in degrees.
y Specify the rotation around y-axis in degrees.
z Specify the rotation around z-axis in degrees.

Reimplemented from mitkScene.

void mitkImageScene::SetWindowCenter float  winCenter  ) 
 

Set the window center of this scene

Parameters:
winCenter Specify the new window center of this scene

void mitkImageScene::SetWindowWidth float  winWidth  ) 
 

Set the window width of this scene

Parameters:
winWidth Specify the new window width of this scene

virtual void mitkImageScene::Translate float  deltX,
float  deltY,
float  deltZ = 0
[virtual]
 

Translate all of the models in this scene in x, y, z directions.

Parameters:
deltX Specify the translation in x direction
deltY Specify the translation in y direction
deltZ Specify the translation in z direction

Reimplemented from mitkScene.


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:03:19 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3