MeVisLab Toolbox Reference
ml::LUTFPrimitive Class Reference

A single channel LUT with predefined primitives of different shapes. More...

#include <mlLUTFPrimitive.h>

Inheritance diagram for ml::LUTFPrimitive:
ml::LUTFunction ml::Base

Public Types

enum  ShapeType {
  Ramp = 0 , Wall , Gauss , Sigmoid ,
  numShapes
}
 Shape constants. More...
Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...

Public Member Functions

 LUTFPrimitive (void)
 Constructor.
LUT parameters
virtual ShapeType getShape (void) const
 Get shape.
virtual void setShape (ShapeType shape)
 Set shape.
virtual double getCenter (void) const
 Get ramp center.
virtual void setCenter (double center)
 Set ramp center.
virtual double getWidth (void) const
 Get ramp width.
virtual void setWidth (double width)
 Set ramp width.
virtual double getEdgeWidth (void) const
 Get edge width.
virtual void setEdgeWidth (double edgeWidth)
 Set edge width.
virtual double getBaseValue (void) const
 Get base value.
virtual void setBaseValue (double baseValue)
 Set base value.
virtual double getPeakValue (void) const
 Get peak value.
virtual void setPeakValue (double peakValue)
 Set peak value.
LUT properties
double getNativeMinIndex (void) const override
 Get native minimum index.
double getNativeMaxIndex (void) const override
 Get native maximum index.
Public Member Functions inherited from ml::LUTFunction
 LUTFunction (LUTVisualType vt, bool relative)
 Constructor.
void changed (void)
void overwriteUniqueId (unsigned int newId)
 Overwrites the unique id. NOTE: use this only if you really know what you are doing!
virtual bool isValid (void) const
 Return true if the LUT function is valid. An invalid LUT function can not be rendered.
virtual LUTVisualType getVisualType (void) const
 Get LUT visual type.
virtual bool isRelative (void) const
 Is LUT relative?
virtual void setRelative (bool relative)
 Set/reset relative flag.
virtual LUTDimensionality getDimensionality (void) const
 Get dimensionality (1, 2, or 3), usually depending on height and depth.
virtual int getHeight (void) const
 Get native LUT height (= number of rows, numbering starts at 0).
virtual int getDepth (void) const
 Get native LUT depth (= number of layers, numbering starts at 0).
virtual double getNativeMinValue (void) const
 Get native minimum LUT value.
virtual double getNativeMaxValue (void) const
 Get native maximum LUT value.
unsigned int getId (void) const
virtual bool render (LUTDataBase *lutData) const
virtual bool renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const
Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
virtual ~Base ()
 Destructor.
virtual BasedeepCopy () const
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
virtual bool isRefCountedBase () const
 Returns whether the instance is derived from RefCountedBase.
virtual std::string detailString () const
virtual bool implementsPersistence (PersistenceInterface) const
virtual std::string persistentState () const
 Returns a string describing the object's internal state.
virtual void setPersistentState (const std::string &state)
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
virtual void readFrom (AbstractPersistenceInputStream *, int)

Static Public Attributes

static const char * shapeNames [numShapes]
 Shape names.

Protected Member Functions

 ML_CLASS_HEADER (LUTFPrimitive)
LUT implementation
bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const override
template<typename T>
bool renderLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double center, double width, double edgeWidth) const
Protected Member Functions inherited from ml::LUTFunction
template<typename T>
bool renderT (LUTData< T > *lutData, bool rescaled, double minIndex, double maxIndex) const
template<typename T>
bool interpolateLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double minIndex, double maxIndex) const
 ML_ABSTRACT_CLASS_HEADER (LUTFunction)
virtual LUTVisualType getRenderType (LUTDataBase *) const

Protected Attributes

ShapeType _shape
 Function Type.
double _center
 Ramp center.
double _width
 Ramp width.
double _edgeWidth
 Edge width (used for Wall shape only).
double _baseValue
 Base LUT output level, relative to [0,1].
double _peakValue
 Center LUT output level, relative to [0,1].
Protected Attributes inherited from ml::LUTFunction
LUTVisualType _visualType
 LUT visual type.
bool _relative
 Flag for relative LUT.
unsigned int _id

Additional Inherited Members

Static Public Member Functions inherited from ml::LUTFunction
static unsigned int generateUniqueId (void)
Static Protected Attributes inherited from ml::LUTFunction
static unsigned int _gNextId
 Global storage for next unused LUT ID to ensure uniqueness.

Detailed Description

A single channel LUT with predefined primitives of different shapes.

Definition at line 28 of file mlLUTFPrimitive.h.

Member Enumeration Documentation

◆ ShapeType

Shape constants.

Enumerator
Ramp 

Linear ramp.

Wall 

Double ramp.

Gauss 

Gaussian shape.

Sigmoid 

Sigmoid shape.

numShapes 

Number of available shape primitives.

Definition at line 33 of file mlLUTFPrimitive.h.

Constructor & Destructor Documentation

◆ LUTFPrimitive()

ml::LUTFPrimitive::LUTFPrimitive ( void )

Constructor.

Referenced by ML_CLASS_HEADER().

Member Function Documentation

◆ getBaseValue()

virtual double ml::LUTFPrimitive::getBaseValue ( void ) const
inlinevirtual

Get base value.

Definition at line 78 of file mlLUTFPrimitive.h.

References _baseValue.

◆ getCenter()

virtual double ml::LUTFPrimitive::getCenter ( void ) const
inlinevirtual

Get ramp center.

Definition at line 60 of file mlLUTFPrimitive.h.

References _center.

◆ getEdgeWidth()

virtual double ml::LUTFPrimitive::getEdgeWidth ( void ) const
inlinevirtual

Get edge width.

Definition at line 72 of file mlLUTFPrimitive.h.

References _edgeWidth.

◆ getNativeMaxIndex()

double ml::LUTFPrimitive::getNativeMaxIndex ( void ) const
overridevirtual

Get native maximum index.

Reimplemented from ml::LUTFunction.

◆ getNativeMinIndex()

double ml::LUTFPrimitive::getNativeMinIndex ( void ) const
overridevirtual

Get native minimum index.

Reimplemented from ml::LUTFunction.

◆ getPeakValue()

virtual double ml::LUTFPrimitive::getPeakValue ( void ) const
inlinevirtual

Get peak value.

Definition at line 84 of file mlLUTFPrimitive.h.

References _peakValue.

◆ getShape()

virtual ShapeType ml::LUTFPrimitive::getShape ( void ) const
inlinevirtual

Get shape.

Definition at line 54 of file mlLUTFPrimitive.h.

References _shape.

◆ getWidth()

virtual double ml::LUTFPrimitive::getWidth ( void ) const
inlinevirtual

Get ramp width.

Definition at line 66 of file mlLUTFPrimitive.h.

References _width.

◆ ML_CLASS_HEADER()

ml::LUTFPrimitive::ML_CLASS_HEADER ( LUTFPrimitive )
protected

References LUTFPrimitive().

◆ renderLUT()

template<typename T>
bool ml::LUTFPrimitive::renderLUT ( LUTData< T > * lutData,
LUTIterator< T > * lutIterator,
double center,
double width,
double edgeWidth ) const
protected

Render a LUT primitive (as selected by the _shape member variable) into lutData using lutIterator to access and increment the LUT pointers. Return true if successful.

◆ renderLUTNative()

bool ml::LUTFPrimitive::renderLUTNative ( LUTDataBase * lutData,
LUTIteratorBase * lutIterator ) const
overrideprotectedvirtual

Render the lookup table into lutData using lutIterator to access and increment the LUT pointers. Both lutData and lutIterator should be type-cast to a derived, type specific class pointer, according to lutData->getDataType(). Return true if successful.

Implements ml::LUTFunction.

◆ renderLUTRescaled()

bool ml::LUTFPrimitive::renderLUTRescaled ( LUTDataBase * lutData,
LUTIteratorBase * lutIterator,
double minIndex,
double maxIndex ) const
overrideprotectedvirtual

Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers. Both lutData and lutIterator should be type-cast to a derived, type specific class pointer, according to lutData->getDataType(). The LUT is rendered for range minIndex .. maxIndex, but resampled to the index range specified in lutData. Return true if successful.

Reimplemented from ml::LUTFunction.

◆ setBaseValue()

virtual void ml::LUTFPrimitive::setBaseValue ( double baseValue)
inlinevirtual

Set base value.

Definition at line 81 of file mlLUTFPrimitive.h.

References _baseValue, and ml::LUTFunction::changed().

◆ setCenter()

virtual void ml::LUTFPrimitive::setCenter ( double center)
inlinevirtual

Set ramp center.

Definition at line 63 of file mlLUTFPrimitive.h.

References _center, and ml::LUTFunction::changed().

◆ setEdgeWidth()

virtual void ml::LUTFPrimitive::setEdgeWidth ( double edgeWidth)
inlinevirtual

Set edge width.

Definition at line 75 of file mlLUTFPrimitive.h.

References _edgeWidth, and ml::LUTFunction::changed().

◆ setPeakValue()

virtual void ml::LUTFPrimitive::setPeakValue ( double peakValue)
inlinevirtual

Set peak value.

Definition at line 87 of file mlLUTFPrimitive.h.

References _peakValue, and ml::LUTFunction::changed().

◆ setShape()

virtual void ml::LUTFPrimitive::setShape ( ShapeType shape)
inlinevirtual

Set shape.

Definition at line 57 of file mlLUTFPrimitive.h.

References _shape, and ml::LUTFunction::changed().

◆ setWidth()

virtual void ml::LUTFPrimitive::setWidth ( double width)
inlinevirtual

Set ramp width.

Definition at line 69 of file mlLUTFPrimitive.h.

References _width, and ml::LUTFunction::changed().

Member Data Documentation

◆ _baseValue

double ml::LUTFPrimitive::_baseValue
protected

Base LUT output level, relative to [0,1].

Definition at line 147 of file mlLUTFPrimitive.h.

Referenced by getBaseValue(), and setBaseValue().

◆ _center

double ml::LUTFPrimitive::_center
protected

Ramp center.

Definition at line 138 of file mlLUTFPrimitive.h.

Referenced by getCenter(), and setCenter().

◆ _edgeWidth

double ml::LUTFPrimitive::_edgeWidth
protected

Edge width (used for Wall shape only).

Definition at line 144 of file mlLUTFPrimitive.h.

Referenced by getEdgeWidth(), and setEdgeWidth().

◆ _peakValue

double ml::LUTFPrimitive::_peakValue
protected

Center LUT output level, relative to [0,1].

Definition at line 150 of file mlLUTFPrimitive.h.

Referenced by getPeakValue(), and setPeakValue().

◆ _shape

ShapeType ml::LUTFPrimitive::_shape
protected

Function Type.

Definition at line 135 of file mlLUTFPrimitive.h.

Referenced by getShape(), and setShape().

◆ _width

double ml::LUTFPrimitive::_width
protected

Ramp width.

Definition at line 141 of file mlLUTFPrimitive.h.

Referenced by getWidth(), and setWidth().

◆ shapeNames

const char* ml::LUTFPrimitive::shapeNames[numShapes]
static

Shape names.

Definition at line 43 of file mlLUTFPrimitive.h.


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