MeVisLab Toolbox Reference
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

Public Member Functions

 RasterFunction ()
 Constructor.
 
 RasterFunction (const RasterFunction &f)
 Copy constructor.
 
 ~RasterFunction () override
 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 (double val)
 
double getFillValue () const
 
Set/Get the voxel fill value for the background. Default is 0.
void setBGFillValue (double val)
 
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.
 
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!
std::string persistentState () const override
 Returns a string describing the object's internal state.
 
void setPersistentState (const std::string &) override
 Restores the object's internal state from a string that had been previously generated using persistentState().
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
 
virtual ~Base ()
 Destructor.
 
virtual BasedeepCopy () const
 Set addStateToTree version number that can be accessed via getAddStateVersion()
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument.
 
virtual bool isRefCountedBase () const
 Returns if the instance is derived from RefCountedBase.
 
virtual std::string detailString () const
 Return a string describing this object.
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class.
 
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node.
 
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node.
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object.
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object.
 

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.
 

Additional Inherited Members

- Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
 

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

◆ RasterFunction() [1/2]

ml::RasterFunction::RasterFunction ( )
inline

Constructor.

Definition at line 73 of file mlRasterFunction.h.

◆ RasterFunction() [2/2]

ml::RasterFunction::RasterFunction ( const RasterFunction & f)
inline

Copy constructor.

Definition at line 76 of file mlRasterFunction.h.

◆ ~RasterFunction()

ml::RasterFunction::~RasterFunction ( )
inlineoverride

Destructor.

Definition at line 79 of file mlRasterFunction.h.

Member Function Documentation

◆ _fillRaster()

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

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 203 of file mlRasterFunction.h.

References ML_BAD_PARAMETER, ML_PRINT_WARNING, mlrange_cast(), ml::StaticVoxelTest, ml::StaticWorldVoxelTest, ml::TSubImageBox< intT >::v1, ml::TSubImageBox< intT >::v2, ml::VirtualVoxelTest, and ml::VirtualWorldVoxelTest.

◆ _getClipBox()

virtual SubImageBox ml::RasterFunction::_getClipBox ( const SubImageBox & box) const
protectedvirtual

Returns the subImgBox whose voxels are going to be tested.

If necessary the world subImgBox is transformed to voxel coordinates.

◆ _getTransformBase()

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

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

◆ _transformSubImgBox()

virtual SubImageBox ml::RasterFunction::_transformSubImgBox ( const SubImageBoxd & box) const
protectedvirtual

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

◆ clone()

virtual RasterFunction * ml::RasterFunction::clone ( ) const
inlinevirtual

Create a clone of the RasterFunction.

Definition at line 185 of file mlRasterFunction.h.

◆ draw()

virtual void ml::RasterFunction::draw ( SubImage * sImg) const
virtual

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

◆ enableBGFilling()

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

Definition at line 149 of file mlRasterFunction.h.

◆ enableModifierFunction()

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

Definition at line 131 of file mlRasterFunction.h.

References mlrange_cast().

◆ getBGFillValue()

double ml::RasterFunction::getBGFillValue ( ) const
inline

Definition at line 144 of file mlRasterFunction.h.

◆ getFillValue()

double ml::RasterFunction::getFillValue ( ) const
inline

Definition at line 138 of file mlRasterFunction.h.

◆ getFunctionMode()

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

Definition at line 87 of file mlRasterFunction.h.

◆ getModifierFunction()

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

Definition at line 129 of file mlRasterFunction.h.

◆ getPretransform()

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

Definition at line 164 of file mlRasterFunction.h.

◆ getVoxBoundingBox()

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.

◆ getVoxelTestFunction()

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

Definition at line 109 of file mlRasterFunction.h.

◆ getVoxToWorld()

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

Definition at line 170 of file mlRasterFunction.h.

◆ getWorldBoundingBox()

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

Definition at line 157 of file mlRasterFunction.h.

◆ getWorldVoxelTestFunction()

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

Definition at line 118 of file mlRasterFunction.h.

◆ isBGFilling()

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

Definition at line 150 of file mlRasterFunction.h.

◆ isModifierFunctionOn()

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

Definition at line 132 of file mlRasterFunction.h.

◆ isVoxelInside()

virtual bool ml::RasterFunction::isVoxelInside ( const ImageVector & ) const
inlinevirtual

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.

◆ isWorldVoxelInside()

virtual bool ml::RasterFunction::isWorldVoxelInside ( const Vector6 & ) const
inlinevirtual

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.

◆ operator=()

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

Copy operator.

◆ persistentState()

std::string ml::RasterFunction::persistentState ( ) const
inlineoverridevirtual

Returns a string describing the object's internal state.

Reimplemented from ml::Base.

Definition at line 178 of file mlRasterFunction.h.

◆ setBGFillValue()

void ml::RasterFunction::setBGFillValue ( double val)
inline

Definition at line 143 of file mlRasterFunction.h.

◆ setFillValue()

void ml::RasterFunction::setFillValue ( double val)
inline

Definition at line 137 of file mlRasterFunction.h.

◆ setFunctionMode()

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

Definition at line 86 of file mlRasterFunction.h.

◆ setModifierFunction()

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

Definition at line 127 of file mlRasterFunction.h.

◆ setPersistentState()

void ml::RasterFunction::setPersistentState ( const std::string & state)
inlineoverridevirtual

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

Reimplemented from ml::Base.

Definition at line 180 of file mlRasterFunction.h.

◆ setPreTransform()

void ml::RasterFunction::setPreTransform ( const Matrix4 & pre)
inline

Definition at line 163 of file mlRasterFunction.h.

References mlrange_cast().

◆ setVoxBoundingBox()

void ml::RasterFunction::setVoxBoundingBox ( const SubImageBox & box)
inline

Definition at line 156 of file mlRasterFunction.h.

◆ setVoxelTestFunction()

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

Definition at line 107 of file mlRasterFunction.h.

◆ setVoxToWorld()

void ml::RasterFunction::setVoxToWorld ( const Matrix4 & v2w)
inline

Definition at line 169 of file mlRasterFunction.h.

References mlrange_cast().

◆ setWorldBoundingBox()

void ml::RasterFunction::setWorldBoundingBox ( const SubImageBoxd & box)
inline

Definition at line 158 of file mlRasterFunction.h.

◆ setWorldVoxelTestFunction()

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: