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

mitkPseudocolorWidgetModel Class Reference

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

#include <mitkPseudocolorWidgetModel.h>

Inherits mitkWidgetModel2D.

Inheritance diagram for mitkPseudocolorWidgetModel:

Inheritance graph
[legend]
Collaboration diagram for mitkPseudocolorWidgetModel:

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 ()
void SetStartPoint (int x, int y)
void SetMovePoint (int x, int y)
void SetEndPoint (int x, int y)
int GetWidth ()
int GetHeight ()
int GetLeft ()
int GetRight ()
int GetBottom ()
int GetTop ()
void GetStartPoint (int &sx, int &sy)
void GetStartPoint (int p[2])
void GetEndPoint (int &ex, int &ey)
void GetEndPoint (int p[2])
bool IsValid ()
int SetColorTable (unsigned char table[][3], int colorNum=COLOR_TABLE_SIZE)
void ResetColorTable ()
int GetColorTable (unsigned char table[][3], int colorNum=COLOR_TABLE_SIZE)
virtual mitkVolumeGetRegionMask ()

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

mitkPseudocolorWidgetModel - a 2D widget for displaying pseudocolor image

mitkPseudocolorWidgetModel 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.


Member Function Documentation

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

int mitkPseudocolorWidgetModel::GetBottom  )  [inline]
 

Get the bottom of the pseudocolor rectangle.

Returns:
Return the bottom of the pseudocolor rectangle.

int mitkPseudocolorWidgetModel::GetColorTable unsigned char  table[][3],
int  colorNum = COLOR_TABLE_SIZE
 

Get color table.

Parameters:
table an unsigned char array to contain the color table and the arrangement of the color components is 'RGBRGBRGB...'
colorNum the number of colors the buffer table[][3] can contain
Returns:
Return the number of colors gotten actually.

void mitkPseudocolorWidgetModel::GetEndPoint int  p[2]  )  [inline]
 

Get the end point of the pseudocolor rectangle.

Parameters:
p[0] return the x-coordinate of the start point
p[1] return the y-coordinate of the start point

void mitkPseudocolorWidgetModel::GetEndPoint int &  ex,
int &  ey
[inline]
 

Get the end point of the pseudocolor rectangle.

Parameters:
ex return the x-coordinate of the end point
ey return the y-coordinate of the end point

int mitkPseudocolorWidgetModel::GetHeight  )  [inline]
 

Get the height of the pseudocolor rectangle.

Returns:
Return the height of the pseudocolor rectangle.

int mitkPseudocolorWidgetModel::GetLeft  )  [inline]
 

Get the left of the pseudocolor rectangle.

Returns:
Return the left of the pseudocolor rectangle.

virtual mitkVolume* mitkPseudocolorWidgetModel::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.

int mitkPseudocolorWidgetModel::GetRight  )  [inline]
 

Get the right of the pseudocolor rectangle.

Returns:
Return the right of the pseudocolor rectangle.

void mitkPseudocolorWidgetModel::GetStartPoint int  p[2]  )  [inline]
 

Get the start point of the pseudocolor rectangle.

Parameters:
p[0] return the x-coordinate of the start point
p[1] return the y-coordinate of the start point

void mitkPseudocolorWidgetModel::GetStartPoint int &  sx,
int &  sy
[inline]
 

Get the start point of the pseudocolor rectangle.

Parameters:
sx return the x-coordinate of the start point
sy return the y-coordinate of the start point

int mitkPseudocolorWidgetModel::GetTop  )  [inline]
 

Get the top of the pseudocolor rectangle.

Returns:
Return the left of the pseudocolor rectangle.

int mitkPseudocolorWidgetModel::GetWidth  )  [inline]
 

Get the width of the pseudocolor rectangle.

Returns:
Return the width of the pseudocolor rectangle.

bool mitkPseudocolorWidgetModel::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 mitkPseudocolorWidgetModel::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 mitkPseudocolorWidgetModel::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 mitkPseudocolorWidgetModel::Release  )  [virtual]
 

Maintain the selection status when this widget is released.

Implements mitkWidgetModel.

virtual int mitkPseudocolorWidgetModel::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 mitkPseudocolorWidgetModel::ResetColorTable  ) 
 

Reset the color table to the default values.

int mitkPseudocolorWidgetModel::SetColorTable unsigned char  table[][3],
int  colorNum = COLOR_TABLE_SIZE
 

Set color table.

Parameters:
table an unsigned char array contains the color table and the arrangement of the color components is 'RGBRGBRGB...'
colorNum the number of colors in the table to set
Returns:
Return the number of colors set to the table.
Note:
The total number of colors in the table must be less than mitkPseudocolorWidgetModel::COLOR_TABLE_SIZE. At present, this class can support a color table whose number of colors is up to 256 (i.e. mitkPseudocolorWidgetModel::COLOR_TABLE_SIZE = 256).

void mitkPseudocolorWidgetModel::SetEndPoint int  x,
int  y
 

Set the end point of the pseudocolor image rectangle draged by mouse.

Parameters:
x x-coordinate of this point
y y-coordinate of this point

void mitkPseudocolorWidgetModel::SetMovePoint int  x,
int  y
 

Set position of the moving end point.

Parameters:
x x-coordinate of the moving end point of this line
y y-coordinate of the moving end point of this line

void mitkPseudocolorWidgetModel::SetStartPoint int  x,
int  y
 

Set the start point of the pseudocolor image rectangle draged by mouse.

Parameters:
x x-coordinate of this point
y y-coordinate of this point


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