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

mitkReslicePlaneWidgetModel Class Reference

mitkReslicePlaneWidgetModel - a 3D widget for re-slice plane More...

#include <mitkReslicePlaneWidgetModel.h>

Inherits mitkWidgetModel3D.

Inheritance diagram for mitkReslicePlaneWidgetModel:

Inheritance graph
[legend]
Collaboration diagram for mitkReslicePlaneWidgetModel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
 mitkReslicePlaneWidgetModel (coord_type v0x, coord_type v0y, coord_type v0z, coord_type v1x, coord_type v1y, coord_type v1z, coord_type cx, coord_type cy, coord_type cz)
virtual int Render (mitkScene *scene)
virtual void Pick (const WidgetNames &names)
virtual void Release ()
virtual void SetSourceModel (mitkDataModel *model)
void SetPlanePosition (coord_type v0x, coord_type v0y, coord_type v0z, coord_type v1x, coord_type v1y, coord_type v1z, coord_type cx, coord_type cy, coord_type cz)
void SetPlaneOpacity (float opacity)
void SetSliceOpacity (float opacity)
float GetPlaneOpacity ()
float GetSliceOpacity ()
void SetVolumeData (mitkVolume *vol)
mitkVolumeGetVolumeData ()
void SetSliceImageWidth (int width)
void SetSliceImageHeight (int height)
int GetSliceImageWidth ()
int GetSliceImageHeight ()
void GetLeftBottomPoint (coord_type &x, coord_type &y, coord_type &z)
mitkVector const * GetLeftBottomPoint ()
void GetRightBottomPoint (coord_type &x, coord_type &y, coord_type &z)
mitkVector const * GetRightBottomPoint ()
void GetRightTopPoint (coord_type &x, coord_type &y, coord_type &z)
mitkVector const * GetRightTopPoint ()
void GetLeftTopPoint (coord_type &x, coord_type &y, coord_type &z)
mitkVector const * GetLeftTopPoint ()
virtual void Update ()
void EnableReslice (bool enable=true)
void DisableReslice ()
void SetColorTable (mitkColorTable *ct)
mitkColorTableGetColorTable ()
void EnablePseudocolor (bool enable=true)
void DisablePseudocolor ()
bool IsResliceEnabled ()
bool IsPseudocolorEnabled ()
void StoreEnableState ()
mitkVolumeGetReslicedImage ()
void RotateRadAroundXAxisOfPlane (float angle)
void RotateRadAroundYAxisOfPlane (float angle)
void RotateRadAroundZAxisOfPlane (float angle)
void RotateDegAroundXAxisOfPlane (float angle)
void RotateDegAroundYAxisOfPlane (float angle)
void RotateDegAroundZAxisOfPlane (float angle)
void TranslatePlane (float tx, float ty, float tz)
void SetPlaneCenter (float ox, float oy, float oz)
void GetPlaneNormal (float &nx, float &ny, float &nz)
void GetPlaneNormal (float n[3])
void SetUnitName (const string &name)
const string & GetUnitName ()
float GetRotatedAngleRad ()
float GetRotatedAngleDeg ()
float GetMovedDistance ()
float GetVertMoveFromStart ()
float const * GetStartOrigin ()
void GetStartOrigin (float so[3])
bool IsBallSelected ()
bool IsLineSelected ()

Protected Member Functions

virtual void _onMouseDown (int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos)
virtual void _onMouseUp (int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos)
virtual void _onMouseMove (bool ctrlDown, bool shiftDown, int xPos, int yPos, int deltaX, int deltaY)

Detailed Description

mitkReslicePlaneWidgetModel - a 3D widget for re-slice plane

mitkReslicePlaneWidgetModel is a 3D widget for re-slice plane. It can clip the source model at an arbitrary position and along an arbitrary direction, and at the same time, reconstruct the slice of the transection and display it on the clipping plane.

The clipping rectangle plane is initialized by its left-bottom point, right-bottom point and center point in the constructor of this class.


Constructor & Destructor Documentation

mitkReslicePlaneWidgetModel::mitkReslicePlaneWidgetModel coord_type  v0x,
coord_type  v0y,
coord_type  v0z,
coord_type  v1x,
coord_type  v1y,
coord_type  v1z,
coord_type  cx,
coord_type  cy,
coord_type  cz
 

A constructor. The parameters specify a rectangle in the model space via its left-bottom point, right-bottom point and center point.

Parameters:
v0x the x-coordinate of the left-bottom point
v0y the y-coordinate of the left-bottom point
v0z the z-coordinate of the left-bottom point
v1x the x-coordinate of the right-bottom point
v1y the y-coordinate of the right-bottom point
v1z the z-coordinate of the right-bottom point
cx the x-coordinate of the center point
cy the y-coordinate of the center point
cz the z-coordinate of the center point


Member Function Documentation

virtual void mitkReslicePlaneWidgetModel::_onMouseDown int  mouseButton,
bool  ctrlDown,
bool  shiftDown,
int  xPos,
int  yPos
[protected, virtual]
 

Deal with mouse down event.

Parameters:
mouseButton indicates which mouse button is pressed
ctrlDown indicates if the key "Ctrl" is pressed
shiftDown indicates if the key "Shift" is pressed
xPos x-coordinate of the mouse position when mouse down event occurs
yPos y-coordinate of the mouse position when mouse down event occurs

Implements mitkWidgetModel.

virtual void mitkReslicePlaneWidgetModel::_onMouseMove bool  ctrlDown,
bool  shiftDown,
int  xPos,
int  yPos,
int  deltaX,
int  deltaY
[protected, virtual]
 

Deal with mouse move event.

Parameters:
ctrlDown indicates if the key "Ctrl" is pressed
shiftDown indicates if the key "Shift" is pressed
xPos x-coordinate of the mouse position when mouse move event occurs
yPos y-coordinate of the mouse position when mouse move event occurs
deltaX movement along x-axis of the mouse when mouse move event occurs
deltaY movement along y-axis of the mouse when mouse move event occurs

Implements mitkWidgetModel.

virtual void mitkReslicePlaneWidgetModel::_onMouseUp int  mouseButton,
bool  ctrlDown,
bool  shiftDown,
int  xPos,
int  yPos
[protected, virtual]
 

Deal with mouse up event.

Parameters:
mouseButton indicates which mouse button was pressed and now released
ctrlDown indicates if the key "Ctrl" is pressed
shiftDown indicates if the key "Shift" is pressed
xPos x-coordinate of the mouse position when mouse up event occurs
yPos y-coordinate of the mouse position when mouse up event occurs

Implements mitkWidgetModel.

void mitkReslicePlaneWidgetModel::DisablePseudocolor  )  [inline]
 

Display pseudo-color display for re-slice.

void mitkReslicePlaneWidgetModel::DisableReslice  )  [inline]
 

Disable re-slice (do not reconstruct the slice of the transection).

void mitkReslicePlaneWidgetModel::EnablePseudocolor bool  enable = true  ) 
 

Enable pseudo-color display for re-slice.

Parameters:
enable if enable is true, the pseudo-color function is enabled, otherwise it is disabled

void mitkReslicePlaneWidgetModel::EnableReslice bool  enable = true  ) 
 

Enable re-slice (reconstruct the slice of the transection and display it on the clipping plane).

Parameters:
enable if enable is true, the re-slice function is enabled, otherwise it is disabled

mitkColorTable* mitkReslicePlaneWidgetModel::GetColorTable  ) 
 

Get color table.

Returns:
Return the pointer to the mitkColorTable object.

mitkVector const* mitkReslicePlaneWidgetModel::GetLeftBottomPoint  )  [inline]
 

Get the left-bottom point of the re-slice rectangle plane in the model space.

Returns:
Return a point to a const mitkVector object which contains the coordinates of the point.

void mitkReslicePlaneWidgetModel::GetLeftBottomPoint coord_type &  x,
coord_type &  y,
coord_type &  z
[inline]
 

Get the left-bottom point of the re-slice rectangle plane in the model space.

Parameters:
x the x-coordinate of the point
y the y-coordinate of the point
z the z-coordinate of the point

mitkVector const* mitkReslicePlaneWidgetModel::GetLeftTopPoint  )  [inline]
 

Get the left-top point of the re-slice rectangle plane in the model space.

Returns:
Return a point to a const mitkVector object which contains the coordinates of the point.

void mitkReslicePlaneWidgetModel::GetLeftTopPoint coord_type &  x,
coord_type &  y,
coord_type &  z
[inline]
 

Get the left-top point of the re-slice rectangle plane in the model space.

Parameters:
x the x-coordinate of the point
y the y-coordinate of the point
z the z-coordinate of the point

float mitkReslicePlaneWidgetModel::GetMovedDistance  ) 
 

Get moved distance since mouse button is pressed.

Returns:
Return the value of moved distance.

void mitkReslicePlaneWidgetModel::GetPlaneNormal float  n[3]  )  [inline]
 

Get the normal of the plane.

Parameters:
n[0] return the x weight of the normal
n[1] return the y weight of the normal
n[2] return the z weight of the normal

void mitkReslicePlaneWidgetModel::GetPlaneNormal float &  nx,
float &  ny,
float &  nz
 

Get the normal of the plane.

Parameters:
nx return the x weight of the normal
ny return the y weight of the normal
nz return the z weight of the normal

float mitkReslicePlaneWidgetModel::GetPlaneOpacity  )  [inline]
 

Get the opacity of the plane.

Returns:
Return the opacity of the plane (the value is between 0.0f and 1.0f, and the default value is 0.0f)

mitkVolume* mitkReslicePlaneWidgetModel::GetReslicedImage  ) 
 

Get current re-sliced image.

Returns:
Return a pointer of mitkVolume object contains the current re-sliced image.
Note:
The returned object pointer should be deleted properly by yourself.

mitkVector const* mitkReslicePlaneWidgetModel::GetRightBottomPoint  )  [inline]
 

Get the right-bottom point of the re-slice rectangle plane in the model space.

Returns:
Return a point to a const mitkVector object which contains the coordinates of the point.

void mitkReslicePlaneWidgetModel::GetRightBottomPoint coord_type &  x,
coord_type &  y,
coord_type &  z
[inline]
 

Get the right-bottom point of the re-slice rectangle plane in the model space.

Parameters:
x the x-coordinate of the point
y the y-coordinate of the point
z the z-coordinate of the point

mitkVector const* mitkReslicePlaneWidgetModel::GetRightTopPoint  )  [inline]
 

Get the right-top point of the re-slice rectangle plane in the model space.

Returns:
Return a point to a const mitkVector object which contains the coordinates of the point.

void mitkReslicePlaneWidgetModel::GetRightTopPoint coord_type &  x,
coord_type &  y,
coord_type &  z
[inline]
 

Get the right-top point of the re-slice rectangle plane in the model space.

Parameters:
x the x-coordinate of the point
y the y-coordinate of the point
z the z-coordinate of the point

float mitkReslicePlaneWidgetModel::GetRotatedAngleDeg  ) 
 

Get the rotated angle of the plane in degree (around x/y axis) since mouse button is pressed.

Returns:
Return the value of rotated angel in degree.

float mitkReslicePlaneWidgetModel::GetRotatedAngleRad  ) 
 

Get the rotated angle of the plane in radian (around x/y axis) since mouse button is pressed.

Returns:
Return the value of rotated angel in radian.

int mitkReslicePlaneWidgetModel::GetSliceImageHeight  )  [inline]
 

Get the image height of the reconstructed slice.

Returns:
Return the image height (measured by pixels) of the reconstructed slice.

int mitkReslicePlaneWidgetModel::GetSliceImageWidth  )  [inline]
 

Get the image width of the reconstructed slice.

Returns:
Return the image width (measured by pixels) of the reconstructed slice.

float mitkReslicePlaneWidgetModel::GetSliceOpacity  )  [inline]
 

Get the opacity of the reconstructed slice.

Returns:
Return the opacity of the plane (the value is between 0.0f and 1.0f, and the default value is 1.0f)

void mitkReslicePlaneWidgetModel::GetStartOrigin float  so[3]  )  [inline]
 

Get the start origin (start plane center) of the plane.

Parameters:
so[0] return the x-coordinate the start origin
so[1] return the y-coordinate the start origin
so[2] return the z-coordinate the start origin

float const* mitkReslicePlaneWidgetModel::GetStartOrigin  )  [inline]
 

Get the start origin (start plane center) of the plane.

Returns:
Return the start origin (start plane center) of the plane.

const string& mitkReslicePlaneWidgetModel::GetUnitName  )  [inline]
 

Get name string of unit.

Returns:
Return a constant reference to a string contains the name

float mitkReslicePlaneWidgetModel::GetVertMoveFromStart  ) 
 

Get vertical movement from the start position (plane center).

Returns:
Return the vertical movement from the start position.

mitkVolume* mitkReslicePlaneWidgetModel::GetVolumeData  )  [inline]
 

Get the source volume data for reconstructing slice.

Returns:
Return the pointer to the source volume object.

bool mitkReslicePlaneWidgetModel::IsBallSelected  ) 
 

Whether any one of the balls is selected.

Returns:
Return true if one of the four balls is selected.

bool mitkReslicePlaneWidgetModel::IsLineSelected  ) 
 

Whether any one of the lines is selected.

Returns:
Return true if one of the four lines is selected.

bool mitkReslicePlaneWidgetModel::IsPseudocolorEnabled  )  [inline]
 

Test if the pseudo-color function is enabled.

bool mitkReslicePlaneWidgetModel::IsResliceEnabled  )  [inline]
 

Test if the re-slice function is enabled.

virtual void mitkReslicePlaneWidgetModel::Pick const WidgetNames &  names  )  [virtual]
 

Maintain the selection status when this widget is picked.

Parameters:
names a constant reference to an WidgerNames which contains the names of selected parts of this widget.

Implements mitkWidgetModel.

virtual void mitkReslicePlaneWidgetModel::PrintSelf ostream &  os  )  [virtual]
 

Print the necessary information about this object for the debugging purpose.

Parameters:
os The specified ostream to output information.

Reimplemented from mitkWidgetModel3D.

virtual void mitkReslicePlaneWidgetModel::Release  )  [virtual]
 

Maintain the selection status when this widget is released.

Implements mitkWidgetModel.

virtual int mitkReslicePlaneWidgetModel::Render mitkScene scene  )  [virtual]
 

Render this model.

Parameters:
scene the pointer of an mitkScene in which this model will be shown
Returns:
Return 1 if this model is rendered successfully. Otherwise return 0.

Reimplemented from mitkModel.

void mitkReslicePlaneWidgetModel::RotateDegAroundXAxisOfPlane float  angle  ) 
 

Rotate the plane around the x axis of the plane. This function is provided for convenience. It behaves essentially like RotateRadAroundXAxisOfPlane(), but the parameter angle is in degree.

Parameters:
angle rotation angle in degree

void mitkReslicePlaneWidgetModel::RotateDegAroundYAxisOfPlane float  angle  ) 
 

Rotate the plane around the y axis of the plane. This function is provided for convenience. It behaves essentially like RotateRadAroundYAxisOfPlane(), but the parameter angle is in degree.

Parameters:
angle rotation angle in degree

void mitkReslicePlaneWidgetModel::RotateDegAroundZAxisOfPlane float  angle  ) 
 

Rotate the plane around the z axis of the plane. This function is provided for convenience. It behaves essentially like RotateRadAroundZAxisOfPlane(), but the parameter angle is in degree.

Parameters:
angle rotation angle in degree

void mitkReslicePlaneWidgetModel::RotateRadAroundXAxisOfPlane float  angle  ) 
 

Rotate the plane around the x axis of the plane.

	                         |z   / y
	           left top      |   /       right top
	               o---------|--+-----------o
	              /          | /           /
	             /           |/           /  x
	            /            o-----------+---->
	           /                        /
	          /                        /
	         o------------------------o
	     left bottom             right bottom
	   
	    
Note:
The rotation is performed in the local coordinates of the plane.
Parameters:
angle rotation angle in radian

void mitkReslicePlaneWidgetModel::RotateRadAroundYAxisOfPlane float  angle  ) 
 

Rotate the plane around the y axis of the plane.

	                         |z   / y
	           left top      |   /       right top
	               o---------|--+-----------o
	              /          | /           /
	             /           |/           /  x
	            /            o-----------+---->
	           /                        /
	          /                        /
	         o------------------------o
	     left bottom             right bottom
	   
	    
Note:
The rotation is performed in the local coordinates of the plane.
Parameters:
angle rotation angle in radian

void mitkReslicePlaneWidgetModel::RotateRadAroundZAxisOfPlane float  angle  ) 
 

Rotate the plane around the z axis of the plane.

	                         |z   / y
	           left top      |   /       right top
	               o---------|--+-----------o
	              /          | /           /
	             /           |/           /  x
	            /            o-----------+---->
	           /                        /
	          /                        /
	         o------------------------o
	     left bottom             right bottom
	   
	    
Note:
The rotation is performed in the local coordinates of the plane.
Parameters:
angle rotation angle in radian

void mitkReslicePlaneWidgetModel::SetColorTable mitkColorTable ct  )  [inline]
 

Set color table.

Parameters:
ct the pointer to a mitkColorTable object

void mitkReslicePlaneWidgetModel::SetPlaneCenter float  ox,
float  oy,
float  oz
 

Set the center of the plane.

Parameters:
ox the x coordinate of the center
oy the y coordinate of the center
oz the z coordinate of the center

void mitkReslicePlaneWidgetModel::SetPlaneOpacity float  opacity  ) 
 

Set the opacity of the plane.

Parameters:
opacity the opacity of the plane (the value is between 0.0f and 1.0f, and the default value is 0.0f)

void mitkReslicePlaneWidgetModel::SetPlanePosition coord_type  v0x,
coord_type  v0y,
coord_type  v0z,
coord_type  v1x,
coord_type  v1y,
coord_type  v1z,
coord_type  cx,
coord_type  cy,
coord_type  cz
 

Set the position of this plane. The parameters specify a rectangle in the model space via its left-bottom point, right-bottom point and center point.

Parameters:
v0x the x-coordinate of the left-bottom point
v0y the y-coordinate of the left-bottom point
v0z the z-coordinate of the left-bottom point
v1x the x-coordinate of the right-bottom point
v1y the y-coordinate of the right-bottom point
v1z the z-coordinate of the right-bottom point
cx the x-coordinate of the center point
cy the y-coordinate of the center point
cz the z-coordinate of the center point

void mitkReslicePlaneWidgetModel::SetSliceImageHeight int  height  ) 
 

Set the image height of the reconstructed slice.

Parameters:
height the image height (measured by pixels) of the reconstructed slice

void mitkReslicePlaneWidgetModel::SetSliceImageWidth int  width  ) 
 

Set the image width of the reconstructed slice.

Parameters:
width the image width (measured by pixels) of the reconstructed slice

void mitkReslicePlaneWidgetModel::SetSliceOpacity float  opacity  ) 
 

Set the opacity of the reconstructed slice.

Parameters:
opacity the opacity of the plane (the value is between 0.0f and 1.0f, and the default value is 1.0f)

virtual void mitkReslicePlaneWidgetModel::SetSourceModel mitkDataModel model  )  [virtual]
 

Associate this widget with a data model.

Parameters:
model pointer to an mitkDataModel with which this widget is associated
Note:
The parameter model can be NULL. It indicates that manipulation on this widget does not have an effect on other data models.

Reimplemented from mitkWidgetModel3D.

void mitkReslicePlaneWidgetModel::SetUnitName const string &  name  )  [inline]
 

Set name string of unit.

Parameters:
name a constant reference to a string contains the name of the length unit (e.g. mm) this line uses

void mitkReslicePlaneWidgetModel::SetVolumeData mitkVolume vol  ) 
 

Set the source volume data for reconstructing slice.

Parameters:
vol the pointer to the source volume object

void mitkReslicePlaneWidgetModel::StoreEnableState  )  [inline]
 

Store enabled states of the widget's re-slice and pseudo-color function, these states will be restored after rendering of the widget model.

void mitkReslicePlaneWidgetModel::TranslatePlane float  tx,
float  ty,
float  tz
 

Translate the plane with translation vector (tx, ty, tz).

Parameters:
tx the x coordinate of the translation vector
ty the y coordinate of the translation vector
tz the z coordinate of the translation vector

virtual void mitkReslicePlaneWidgetModel::Update  )  [virtual]
 

Update the parameters of the widget.

Reimplemented from mitkWidgetModel3D.


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