MeVisLabToolboxReference
ml::RasterFunction Class Reference

Base object to handle implicit or explicit functions to draw into subimages. More...

#include <mlRasterFunction.h>

Inheritance diagram for ml::RasterFunction:
ml::Base

List of all members.

Public Member Functions

 RasterFunction ()
 Constructor.
 RasterFunction (const RasterFunction &f)
 Copy constructor.
virtual ~RasterFunction ()
 Destructor.
virtual const RasterFunctionoperator= (const RasterFunction &f)
 Copy operator.
virtual bool isVoxelInside (const ImageVector &) const
 The implicit function used to test whether a point p is inside (result == 1), onto (result == 0) or outside (result == -1) the image.
virtual bool isWorldVoxelInside (const Vector6 &) const
 The implicit function used to test whether a point p is inside (result == 1), onto (result == 0) or outside (result == -1) the image.
virtual void draw (SubImage *sImg) const
 Fill intersecting area of sImg with the currently selected function using the transformation matrices.
virtual RasterFunctionclone () const
 Create a clone of the RasterFunction.
Sets/Gets the function which is used to fill the data. Default is \c VirtualWorldVoxelTest.
void setFunctionMode (TestFuncMode mode)
TestFuncMode getFunctionMode () const
By default no function is set.
void setVoxelTestFunction (VoxelTestFunction f, void *data)
void getVoxelTestFunction (VoxelTestFunction &f, void *&data) const
void setModifierFunction (ModifierFunction f, void *data)
void getModifierFunction (ModifierFunction &f, void *&data) const
void enableModifierFunction (bool flag)
bool isModifierFunctionOn () const
in world coordinates. By default no function is set.
void setWorldVoxelTestFunction (WorldVoxelTestFunction f, void *data)
void getWorldVoxelTestFunction (WorldVoxelTestFunction &f, void *&data) const
Set/Get the voxel fill value. Default is 1.
void setFillValue (long double val)
long double getFillValue () const
Set/Get the voxel fill value for the background. Default is 0.
void setBGFillValue (long double val)
long double getBGFillValue () const
Enable/disable background filling. default is off = false.
void enableBGFilling (bool val)
bool isBGFilling () const
const SubImageBoxgetVoxBoundingBox () const
 Set/Get bounding boxes of objects in implicit functions in voxel or in world coordinates. Defaults are empty boxes.
void setVoxBoundingBox (const SubImageBox &box)
const SubImageBoxdgetWorldBoundingBox () const
void setWorldBoundingBox (const SubImageBoxd &box)
Set/Get the current transformation of the object before its transformation to world coordinates. Default is the identity.
void setPreTransform (const Matrix4 &pre)
const Matrix4getPretransform () const
Set/Get the voxel to world matrix. Default is the identity.
void setVoxToWorld (const Matrix4 &v2w)
const Matrix4getVoxToWorld () const
Persistence. Still to do!
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state.
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState().
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState().

Protected Member Functions

virtual SubImageBox _transformSubImgBox (const SubImageBoxd &box) const
 Transforms a subImgBox from world coordinates to a subImgBox in voxel coordinates.
virtual SubImageBox _getClipBox (const SubImageBox &box) const
 Returns the subImgBox whose voxels are going to be tested.
virtual void _getTransformBase (const ImageVector &p, Vector3 tBase[4]) const
 Get world coordinate of p, and world vectors from p to p+(1,0,0), to p+(0,1,0) and p+(0,0,1).
template<typename DATATYPE >
void _fillRaster (const SubImageBox &box, TSubImage< DATATYPE > *pSubImg, Vector3 tBase[4]) const
 Test all voxels within pSubImg against the selected function if they are inside box.

Detailed Description

Base object to handle implicit or explicit functions to draw into subimages.

Definition at line 69 of file mlRasterFunction.h.


Constructor & Destructor Documentation

ml::RasterFunction::RasterFunction ( ) [inline]

Constructor.

Definition at line 73 of file mlRasterFunction.h.

ml::RasterFunction::RasterFunction ( const RasterFunction f) [inline]

Copy constructor.

Definition at line 76 of file mlRasterFunction.h.

virtual ml::RasterFunction::~RasterFunction ( ) [inline, virtual]

Destructor.

Definition at line 79 of file mlRasterFunction.h.


Member Function Documentation

template<typename DATATYPE >
void ml::RasterFunction::_fillRaster ( const SubImageBox box,
TSubImage< DATATYPE > *  pSubImg,
Vector3  tBase[4] 
) const [inline, protected]

Test all voxels within pSubImg against the selected function if they are inside box.

tBase must contain the world coordinate of the box' origin p, and world vectors from p to p+(1,0,0), to p+(0,1,0) and p+(0,0,1).

Use normal write function with fill value.

Use normal write function with fill value.

Use normal write function with fill value.

Use normal write function with fill value.

Definition at line 202 of file mlRasterFunction.h.

References ml::TSubImage< DATATYPE >::fill(), ml::ImageVector, ML_BAD_PARAMETER, ML_PRINT_WARNING, ml::TSubImage< DATATYPE >::setImageValue(), ml::StaticVoxelTest, ml::StaticWorldVoxelTest, ml::TSubImageBox< intT >::v1, ml::TSubImageBox< intT >::v2, ml::VirtualVoxelTest, and ml::VirtualWorldVoxelTest.

virtual SubImageBox ml::RasterFunction::_getClipBox ( const SubImageBox box) const [protected, virtual]

Returns the subImgBox whose voxels are going to be tested.

If necessary the world subImgBox is transformed to voxel coordinates.

virtual void ml::RasterFunction::_getTransformBase ( const ImageVector p,
Vector3  tBase[4] 
) const [protected, virtual]

Get world coordinate of p, and world vectors from p to p+(1,0,0), to p+(0,1,0) and p+(0,0,1).

virtual SubImageBox ml::RasterFunction::_transformSubImgBox ( const SubImageBoxd box) const [protected, virtual]

Transforms a subImgBox from world coordinates to a subImgBox in voxel coordinates.

virtual void ml::RasterFunction::clearPersistentState ( char *  ) const [inline, virtual]

Disposes a string previously allocated by getPersistentState().

Reimplemented from ml::Base.

Definition at line 180 of file mlRasterFunction.h.

virtual RasterFunction* ml::RasterFunction::clone ( void  ) const [inline, virtual]

Create a clone of the RasterFunction.

Definition at line 184 of file mlRasterFunction.h.

virtual void ml::RasterFunction::draw ( SubImage sImg) const [virtual]

Fill intersecting area of sImg with the currently selected function using the transformation matrices.

void ml::RasterFunction::enableBGFilling ( bool  val) [inline]

Definition at line 149 of file mlRasterFunction.h.

void ml::RasterFunction::enableModifierFunction ( bool  flag) [inline]

Definition at line 131 of file mlRasterFunction.h.

long double ml::RasterFunction::getBGFillValue ( ) const [inline]

Definition at line 144 of file mlRasterFunction.h.

long double ml::RasterFunction::getFillValue ( ) const [inline]

Definition at line 138 of file mlRasterFunction.h.

TestFuncMode ml::RasterFunction::getFunctionMode ( ) const [inline]

Definition at line 87 of file mlRasterFunction.h.

void ml::RasterFunction::getModifierFunction ( ModifierFunction f,
void *&  data 
) const [inline]

Definition at line 129 of file mlRasterFunction.h.

virtual char* ml::RasterFunction::getPersistentState ( ) const [inline, virtual]

Returns a C string describing the object's internal state.

The memory for the string will be allocated here and has to be deallocated using clearPersistentState().

Reimplemented from ml::Base.

Definition at line 178 of file mlRasterFunction.h.

const Matrix4& ml::RasterFunction::getPretransform ( ) const [inline]

Definition at line 164 of file mlRasterFunction.h.

const SubImageBox& ml::RasterFunction::getVoxBoundingBox ( ) const [inline]

Set/Get bounding boxes of objects in implicit functions in voxel or in world coordinates. Defaults are empty boxes.

Definition at line 155 of file mlRasterFunction.h.

void ml::RasterFunction::getVoxelTestFunction ( VoxelTestFunction f,
void *&  data 
) const [inline]

Definition at line 109 of file mlRasterFunction.h.

const Matrix4& ml::RasterFunction::getVoxToWorld ( ) const [inline]

Definition at line 170 of file mlRasterFunction.h.

const SubImageBoxd& ml::RasterFunction::getWorldBoundingBox ( ) const [inline]

Definition at line 157 of file mlRasterFunction.h.

void ml::RasterFunction::getWorldVoxelTestFunction ( WorldVoxelTestFunction f,
void *&  data 
) const [inline]

Definition at line 118 of file mlRasterFunction.h.

bool ml::RasterFunction::isBGFilling ( ) const [inline]

Definition at line 150 of file mlRasterFunction.h.

bool ml::RasterFunction::isModifierFunctionOn ( ) const [inline]

Definition at line 132 of file mlRasterFunction.h.

virtual bool ml::RasterFunction::isVoxelInside ( const ImageVector ) const [inline, virtual]

The implicit function used to test whether a point p is inside (result == 1), onto (result == 0) or outside (result == -1) the image.

This function tests in voxel coordinates. Overload this function to implement your own voxel test function. Default implementation returns false, i.e. no object is rastered.

Definition at line 95 of file mlRasterFunction.h.

virtual bool ml::RasterFunction::isWorldVoxelInside ( const Vector6 ) const [inline, virtual]

The implicit function used to test whether a point p is inside (result == 1), onto (result == 0) or outside (result == -1) the image.

This function tests in voxel coordinates. Overload this function to implement your own world voxel test. Default implementation is false, i.e. no object is rastered.

Definition at line 102 of file mlRasterFunction.h.

virtual const RasterFunction& ml::RasterFunction::operator= ( const RasterFunction f) [virtual]

Copy operator.

void ml::RasterFunction::setBGFillValue ( long double  val) [inline]

Definition at line 143 of file mlRasterFunction.h.

void ml::RasterFunction::setFillValue ( long double  val) [inline]

Definition at line 137 of file mlRasterFunction.h.

void ml::RasterFunction::setFunctionMode ( TestFuncMode  mode) [inline]

Definition at line 86 of file mlRasterFunction.h.

void ml::RasterFunction::setModifierFunction ( ModifierFunction  f,
void *  data 
) [inline]

Definition at line 127 of file mlRasterFunction.h.

virtual void ml::RasterFunction::setPersistentState ( const char *  ) [inline, virtual]

Restores the object's internal state from a string that had been previously generated using getPersistentState().

Reimplemented from ml::Base.

Definition at line 179 of file mlRasterFunction.h.

void ml::RasterFunction::setPreTransform ( const Matrix4 pre) [inline]

Definition at line 163 of file mlRasterFunction.h.

void ml::RasterFunction::setVoxBoundingBox ( const SubImageBox box) [inline]

Definition at line 156 of file mlRasterFunction.h.

void ml::RasterFunction::setVoxelTestFunction ( VoxelTestFunction  f,
void *  data 
) [inline]

Definition at line 107 of file mlRasterFunction.h.

void ml::RasterFunction::setVoxToWorld ( const Matrix4 v2w) [inline]

Definition at line 169 of file mlRasterFunction.h.

void ml::RasterFunction::setWorldBoundingBox ( const SubImageBoxd box) [inline]

Definition at line 158 of file mlRasterFunction.h.

void ml::RasterFunction::setWorldVoxelTestFunction ( WorldVoxelTestFunction  f,
void *  data 
) [inline]

Definition at line 116 of file mlRasterFunction.h.


The documentation for this class was generated from the following file: