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

mitkImageModel Class Reference

mitkImageModel - a concrete model class used to display a 2D image in mitkImageScene More...

#include <mitkImageModel.h>

Inherits mitkDataModel.

Inheritance diagram for mitkImageModel:

Inheritance graph
[legend]
Collaboration diagram for mitkImageModel:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ViewMode { VIEW_XY, VIEW_YZ, VIEW_XZ }

Public Member Functions

virtual void PrintSelf (ostream &os)
void SetData (mitkVolume *data)
mitkVolumeGetData ()
virtual int Render (mitkScene *scene)
void SetViewMode (ViewMode viewMode)
ViewMode GetViewMode () const
void SetCurrentSliceNumber (int sliceNo)
int GetCurrentSliceNumber () const
void NextSlice ()
void PrevSlice ()
int GetTotalSliceNumber () const
int GetWidth () const
int GetHeight () const
float GetSpacingX () const
float GetSpacingY ()
float GetSpacingZ () const
void SetOpacity (float opacity)
float GetOpacity () const
virtual bool IsOpaque ()
void CleanUp ()
void AdjustWidthCenter (int viewWidth, int viewHeight, float deltX, float deltY)
float GetWindowWidth () const
float GetWindowCenter () const
void SetWindowWidth (float winWidth)
void SetWindowCenter (float winCenter)
void ResetWindowWidthCenter ()
void GetDataValueAndCoordinate (float objectX, float objectY, int &vx, int &vy, int &vz, float &rValue, float &gValue, float &bValue) const
void GetCoordinate (float objectX, float objectY, int &vx, int &vy, int &vz) const
void GetXYCoordinate (float objectX, float objectY, int &vx, int &vy) const
void GetXYCoordinate (float objectX, float objectY, float &vx, float &vy) const
void GetXYCoordinateDelta (float odx, float ody, float &vdx, float &vdy) const
void GetObjectCoordinate (int vx, int vy, float &objX, float &objY)
void GetObjectCoordinate (int vx, int vy, int vz, float &objX, float &objY)
float GetActualLength (float opt0[2], float opt1[2]) const
float GetActualLength (float x0, float y0, float x1, float y1) const
float GetActualXLength (float objXLen) const
float GetActualYLength (float objYLen) const
unsigned int GetTextureID () const
void GetIncrements (int incs[3]) const
mitkVolumeGetCurrentSlice ()
void EnablePseudocolor (bool enable=true)
void UpdatePseudocolor (bool rectChanged)

Detailed Description

mitkImageModel - a concrete model class used to display a 2D image in mitkImageScene

mitkImageModel is a concrete model class used to display a 2D image in mitkImageScene. It can access a volume as input and display it in image scene. To use it, the code snippet is:

    mitkImageModel *aModel = new mitkImageModel;
    aModel->SetData(aVolume); // Set the volume to be displayed
    aModel->SetViewMode(mitkImageModel::VIEW_XY);
    aModel->SetCurrentSliceNumber(0); //Display the first slice
    aImageScene->AddModel(aModel);
    aImageScene->Update();
    aModel->NextSlice();  //Display the next slice
    aImageScene->Update();


Member Enumeration Documentation

enum mitkImageModel::ViewMode
 

Set the view mode of a volume.

         z|    y           
          |   /           
          |  /             
          | /              
          |/               
          o------------x    
	    
Enumerator:
VIEW_XY  default mode, display the volume in the direction of parallel to XoY plane
VIEW_YZ  display the volume in the direction of parallel to YoZ plane
VIEW_XZ  display the volume in the direction of parallel to XoZ plane


Member Function Documentation

void mitkImageModel::AdjustWidthCenter int  viewWidth,
int  viewHeight,
float  deltX,
float  deltY
 

Adjust the window width and window center of this image model

Parameters:
viewWidth the width of the view
viewHeight the height of the view
deltX Specify the change of the window width
deltY Specify the change of the window center

void mitkImageModel::CleanUp  ) 
 

Internal function, Don't call it directly.

void mitkImageModel::EnablePseudocolor bool  enable = true  )  [inline]
 

Enable pseudo-color function.

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

float mitkImageModel::GetActualLength float  x0,
float  y0,
float  x1,
float  y1
const [inline]
 

Get the actual length of the line in volume coordinate system at used specified object coordinate.

Parameters:
x0 specify the x coordinate of one point in object coordinate
y0 specify the y coordinate of one point in object coordinate
x1 specify the x coordinate of the other point in object coordinate
y1 specify the y coordinate of the other point in object coordinate

float mitkImageModel::GetActualLength float  opt0[2],
float  opt1[2]
const [inline]
 

Get the actual length of the line in volume coordinate system at used specified object coordinate.

Parameters:
opt0[0] specify the x coordinate of one point in object coordinate
opt0[1] specify the y coordinate of one point in object coordinate
opt1[0] specify the x coordinate of the other point in object coordinate
opt1[1] specify the y coordinate of the other point in object coordinate

float mitkImageModel::GetActualXLength float  objXLen  )  const [inline]
 

Get the actual length of the line in volume coordinate system at used specified object coordinate along x-axis.

Parameters:
objXLen specify the length along x-axis in object coordinate

float mitkImageModel::GetActualYLength float  objYLen  )  const [inline]
 

Get the actual length of the line in volume coordinate system at used specified object coordinate.

Parameters:
objYLen specify the length along y-axis in object coordinate

void mitkImageModel::GetCoordinate float  objectX,
float  objectY,
int &  vx,
int &  vy,
int &  vz
const [inline]
 

Get the volume coordinate at a specified object coordinate.

Parameters:
objectX Specify the x coordinate in object coordinate
objectY Specify the y coordinate in object coordinate
vx Return the x coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.
vy Return the y coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.
vz Return the z coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.

mitkVolume* mitkImageModel::GetCurrentSlice  ) 
 

Get data of the slice currently displayed.

Returns:
Return a one-slice volume which contains the data of the slice currently displayed.
Note:
The returned object pointer should be deleted properly by yourself.

int mitkImageModel::GetCurrentSliceNumber  )  const [inline]
 

Get the current slice number displayed in ImageView

Returns:
Return the current slice number

mitkVolume* mitkImageModel::GetData  ) 
 

Get the volume data.

Returns:
Return pointer to the volume data.

void mitkImageModel::GetDataValueAndCoordinate float  objectX,
float  objectY,
int &  vx,
int &  vy,
int &  vz,
float &  rValue,
float &  gValue,
float &  bValue
const
 

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

Parameters:
objectX Specify the x coordinate in object coordinate
objectY Specify the y coordinate in object coordinate
vx Return the x coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.
vy Return the y coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.
vz Return the z coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object 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

int mitkImageModel::GetHeight  )  const [inline]
 

Internal function, Don't call it directly.

void mitkImageModel::GetIncrements int  incs[3]  )  const [inline]
 

Get the increments in x, y and z directions according to current view mode.

Parameters:
incs[0] the increment in x directions
incs[1] the increment in y directions
incs[2] the increment in z directions

void mitkImageModel::GetObjectCoordinate int  vx,
int  vy,
int  vz,
float &  objX,
float &  objY
 

Get the coordinates in the object space according to the given volume coordinates.

Parameters:
vx specify the x-coordinate in the volume space
vy specify the y-coordinate in the volume space
vz specify the z-coordinate in the volume space
objX return the x-coordinate in the object space
objY return the y-coordinate in the object space

void mitkImageModel::GetObjectCoordinate int  vx,
int  vy,
float &  objX,
float &  objY
 

Get the coordinates in the object space according to the given volume coordinates.

Parameters:
vx specify the x-coordinate in the volume space (according to view-mode)
vy specify the y-coordinate in the volume space (according to view-mode)
objX return the x-coordinate in the object space
objY return the y-coordinate in the object space

float mitkImageModel::GetOpacity  )  const [inline]
 

Get the opacity of this model.

Returns:
Return the opacity of this model.

float mitkImageModel::GetSpacingX  )  const [inline]
 

Internal function, Don't call it directly.

float mitkImageModel::GetSpacingY  )  [inline]
 

Internal function, Don't call it directly.

float mitkImageModel::GetSpacingZ  )  const [inline]
 

Internal function, Don't call it directly.

unsigned int mitkImageModel::GetTextureID  )  const [inline]
 

Get the texture ID.

Returns:
Return the texture ID.

int mitkImageModel::GetTotalSliceNumber  )  const [inline]
 

Display previous slice. If current slice is the first slice in the volume, then display the last slice.

ViewMode mitkImageModel::GetViewMode  )  const [inline]
 

Get the view mode of the volume.

See also:
ViewMode
Returns:
Return the view mode used by this ImageModel

int mitkImageModel::GetWidth  )  const [inline]
 

Internal function, Don't call it directly.

float mitkImageModel::GetWindowCenter  )  const [inline]
 

Get the window center of this image model

Returns:
Return the window center of this image model

float mitkImageModel::GetWindowWidth  )  const [inline]
 

Get the window width of this image model

Returns:
Return the window width of this image model

void mitkImageModel::GetXYCoordinate float  objectX,
float  objectY,
float &  vx,
float &  vy
const [inline]
 

Get the X-Y volume coordinate at a specified object coordinate according to the view mode.

Parameters:
objectX Specify the x coordinate in object coordinate
objectY Specify the y coordinate in object coordinate
vx Return the x coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.
vy Return the y coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.

void mitkImageModel::GetXYCoordinate float  objectX,
float  objectY,
int &  vx,
int &  vy
const [inline]
 

Get the X-Y volume coordinate at a specified object coordinate according to the view mode.

Parameters:
objectX Specify the x coordinate in object coordinate
objectY Specify the y coordinate in object coordinate
vx Return the x coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.
vy Return the y coordinate in the volume. It is calculate by transforming the point(objectX,objectY) from object coordinate to volume coordinate.

void mitkImageModel::GetXYCoordinateDelta float  odx,
float  ody,
float &  vdx,
float &  vdy
const [inline]
 

Get the movement in volume coordinate at a specified object coordinate according to the view mode.

Parameters:
odx Specify the movement along x-axis in object coordinate
ody Specify the movement along y-axis in object coordinate
vdx Return the movement along x-axis in the volume coordinate
vdy Return the movement along y-axis in the volume coordinate

virtual bool mitkImageModel::IsOpaque  )  [inline, virtual]
 

Whether this model is opaque.

Returns:
Return true if this model is opaque.

Implements mitkModel.

void mitkImageModel::NextSlice  ) 
 

Display next slice. If current slice is the last slice in the volume, then display the first slice.

void mitkImageModel::PrevSlice  ) 
 

Display previous slice. If current slice is the first slice in the volume, then display the last slice.

virtual void mitkImageModel::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 mitkDataModel.

virtual int mitkImageModel::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.
Warning:
Don't call this function directly.

Reimplemented from mitkModel.

void mitkImageModel::ResetWindowWidthCenter  ) 
 

Reset the window width and center to the default value.

void mitkImageModel::SetCurrentSliceNumber int  sliceNo  ) 
 

Set the current slice number for displaying.

Parameters:
sliceNo Specify the current slice number

void mitkImageModel::SetData mitkVolume data  ) 
 

Set the volume data.

Parameters:
data pointer to an mitkVolume

void mitkImageModel::SetOpacity float  opacity  )  [inline]
 

Set the opacity of this model.

Parameters:
opacity Specify the opacity of this model.

void mitkImageModel::SetViewMode ViewMode  viewMode  ) 
 

Set the view mode of the volume.

See also:
ViewMode
Parameters:
viewMode Specify the view mode

void mitkImageModel::SetWindowCenter float  winCenter  ) 
 

Set the window center of this image model

Parameters:
winCenter Specify the new window center of this image model

void mitkImageModel::SetWindowWidth float  winWidth  ) 
 

Set the window width of this image model

Parameters:
winWidth Specify the new window width of this image model

void mitkImageModel::UpdatePseudocolor bool  rectChanged  ) 
 

Update pseudo-color region if the region is changed.

Parameters:
rectChanged if the size or position of the pseudo-color region is changed


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