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

mitkPseudocolorWidgetModelEx Class Reference

mitkPseudocolorWidgetModelEx - a 2D widget for displaying pseudocolor image More...

#include <mitkPseudocolorWidgetModelEx.h>

Inherits mitkWidgetModel2D.

Inheritance diagram for mitkPseudocolorWidgetModelEx:

Inheritance graph
[legend]
Collaboration diagram for mitkPseudocolorWidgetModelEx:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
virtual int Render (mitkScene *scene)
virtual void Pick (const WidgetNames &names)
virtual void Release ()
virtual void SetSourceModel (mitkDataModel *model)
bool IsValid ()
void SetStartPoint (float x, float y)
void SetStartPoint (int sx, int sy)
void SetMovePoint (float x, float y)
void SetMovePoint (int sx, int sy)
void SetEndPoint (float x, float y)
void SetEndPoint (int sx, int sy)
void SetColorTable (mitkColorTable *ct)
mitkColorTableGetColorTable ()
void GetLeftBottom (int &l, int &b)
int GetRectWidthInImage ()
int GetRectHeightInImage ()
bool UpdatePseudocolorRect ()
void SetRectChanged ()
virtual mitkVolumeGetRegionMask ()
virtual void Update ()

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

mitkPseudocolorWidgetModelEx - a 2D widget for displaying pseudocolor image

mitkPseudocolorWidgetModelEx is a 2D widget for displaying pseudocolor image. It can respond the mouse events and display the pseudocolor image of current rectangle part and return the width and height. It is supposed to be attached to a 2D data model (e.g. mitkImageModel) and add to a 2D scene (e.g. mitkImageScene), and in other conditions the display could be improper. Being different with mitkPseudocolorWidgetModel, it directly maps original pixel values (including 8-bit, 16-bit, 32-bit integers and float point values) to RGB colors, and use mitkColorTable to set color table freely.

See also:
mitkColorTable


Member Function Documentation

virtual void mitkPseudocolorWidgetModelEx::_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 mitkPseudocolorWidgetModelEx::_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 mitkPseudocolorWidgetModelEx::_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.

mitkColorTable* mitkPseudocolorWidgetModelEx::GetColorTable  ) 
 

Get color table.

Returns:
Return the pointer to the mitkColorTable object.

void mitkPseudocolorWidgetModelEx::GetLeftBottom int &  l,
int &  b
[inline]
 

Get left-top point (in image space) of the pseudo color window.

Parameters:
l return the left value
t return the top value

int mitkPseudocolorWidgetModelEx::GetRectHeightInImage  )  [inline]
 

Get the height (in image space) of the pseudo color window.

Returns:
Return the height value in number of pixels.

int mitkPseudocolorWidgetModelEx::GetRectWidthInImage  )  [inline]
 

Get the width (in image space) of the pseudo color window.

Returns:
Return the width value in number of pixels.

virtual mitkVolume* mitkPseudocolorWidgetModelEx::GetRegionMask  )  [virtual]
 

Get mask image where the value of widget region is 255 and the rest is 0.

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

Reimplemented from mitkWidgetModel2D.

bool mitkPseudocolorWidgetModelEx::IsValid  )  [inline]
 

If the widget model is valid.

Returns:
Return if the widget model is valid (i.e. can be shown in the scene).

virtual void mitkPseudocolorWidgetModelEx::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 mitkPseudocolorWidgetModelEx::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 mitkWidgetModel2D.

virtual void mitkPseudocolorWidgetModelEx::Release  )  [virtual]
 

Maintain the selection status when this widget is released.

Implements mitkWidgetModel.

virtual int mitkPseudocolorWidgetModelEx::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 mitkPseudocolorWidgetModelEx::SetColorTable mitkColorTable ct  )  [inline]
 

Set color table.

Parameters:
ct the pointer to a mitkColorTable object

void mitkPseudocolorWidgetModelEx::SetEndPoint int  sx,
int  sy
[inline]
 

Set position of the end point.

Parameters:
sx x-coordinate of the end point of mouse dragging on screen
sy y-coordinate of the end point of mouse dragging on screen
Note:
The coordinates of the point are in the screen coordinate system. This function is useful when you can not get the original coordinates in the object space easily outside. It can do this job for you. But if this widget is attach to a data model, you must ensure the source model and the scene which contains this widget and the source model are properly set to this widget (e.g. call SetSourceModel() of this widget or call AddWidget() of the source model and SetScene() of this widget first) before calling this function, because this function needs the transform matrix of the source model and the scene to calculate the original coordinates.

void mitkPseudocolorWidgetModelEx::SetEndPoint float  x,
float  y
[inline]
 

Set position of the end point in the object space.

Parameters:
x x-coordinate of the end point of mouse dragging
y y-coordinate of the end point of mouse dragging
Note:
The coordinates of the point must be the original coordinates in the object space before all geometrical transforms. (Because this widget is for 2D image, the z-coordinate will always be zero.)

void mitkPseudocolorWidgetModelEx::SetMovePoint int  sx,
int  sy
 

Set position of the moving end point.

Parameters:
sx x-coordinate of the moving end point of mouse dragging on screen
sy y-coordinate of the moving end point of mouse dragging on screen
Note:
The coordinates of the point are in the screen coordinate system. This function is useful when you can not get the original coordinates in the object space easily outside. It can do this job for you. But if this widget is attach to a data model, you must ensure the source model and the scene which contains this widget and the source model are properly set to this widget (e.g. call SetSourceModel() of this widget or call AddWidget() of the source model and SetScene() of this widget first) before calling this function, because this function needs the transform matrix of the source model and the scene to calculate the original coordinates.

void mitkPseudocolorWidgetModelEx::SetMovePoint float  x,
float  y
 

Set position of the moving end point in the object space.

Parameters:
x x-coordinate of the moving end point of mouse dragging
y y-coordinate of the moving end point of mouse dragging
Note:
The coordinates of the point must be the original coordinates in the object space before all geometrical transforms. (Because this widget is for 2D image, the z-coordinate will always be zero.)

void mitkPseudocolorWidgetModelEx::SetRectChanged  )  [inline]
 

Set that the pseudo-color region is changed.

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

Associate this widget with a model.

Parameters:
model pointer to an miekDataModel to which this widget attach

Reimplemented from mitkWidgetModel2D.

void mitkPseudocolorWidgetModelEx::SetStartPoint int  sx,
int  sy
 

Set position of the start point.

Parameters:
sx x-coordinate of the start point of mouse dragging on screen
sy y-coordinate of the start point of mouse dragging on screen
Note:
The coordinates of the point are in the screen coordinate system. This function is useful when you can not get the original coordinates in the object space easily outside. It can do this job for you. But if this widget is attach to a data model, you must ensure the source model and the scene which contains this widget and the source model are properly set to this widget (e.g. call SetSourceModel() of this widget or call AddWidget() of the source model and SetScene() of this widget first) before calling this function, because this function needs the transform matrix of the source model and the scene to calculate the original coordinates.

void mitkPseudocolorWidgetModelEx::SetStartPoint float  x,
float  y
 

Set position of the start point in the object space.

Parameters:
x x-coordinate of the start point of mouse dragging
y y-coordinate of the start point of mouse dragging
Note:
The coordinates of the point must be the original coordinates in the object space before all geometrical transforms. (Because this widget is for 2D image, the z-coordinate will always be zero.)

virtual void mitkPseudocolorWidgetModelEx::Update  )  [virtual]
 

Update the parameters of the widget.

Reimplemented from mitkWidgetModel2D.

bool mitkPseudocolorWidgetModelEx::UpdatePseudocolorRect  ) 
 

Update the pseudo-color region.


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