MeVisLab Toolbox Reference
|
A single channel LUT with predefined primitives of different shapes. More...
#include <mlLUTFPrimitive.h>
Public Types | |
enum | ShapeType { Ramp = 0 , Wall , Gauss , Sigmoid , numShapes } |
Shape constants. More... | |
![]() | |
enum | PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream } |
This enum describes the different persistence interfaces available. More... | |
Public Member Functions | |
LUTFPrimitive (void) | |
Constructor. More... | |
LUT parameters | |
virtual ShapeType | getShape (void) const |
Get shape. More... | |
virtual void | setShape (ShapeType shape) |
Set shape. More... | |
virtual double | getCenter (void) const |
Get ramp center. More... | |
virtual void | setCenter (double center) |
Set ramp center. More... | |
virtual double | getWidth (void) const |
Get ramp width. More... | |
virtual void | setWidth (double width) |
Set ramp width. More... | |
virtual double | getEdgeWidth (void) const |
Get edge width. More... | |
virtual void | setEdgeWidth (double edgeWidth) |
Set edge width. More... | |
virtual double | getBaseValue (void) const |
Get base value. More... | |
virtual void | setBaseValue (double baseValue) |
Set base value. More... | |
virtual double | getPeakValue (void) const |
Get peak value. More... | |
virtual void | setPeakValue (double peakValue) |
Set peak value. More... | |
LUT properties | |
double | getNativeMinIndex (void) const override |
Get native minimum index. More... | |
double | getNativeMaxIndex (void) const override |
Get native maximum index. More... | |
![]() | |
LUTFunction (LUTVisualType vt, bool relative) | |
Constructor. More... | |
void | changed (void) |
Assign a new LUT ID. More... | |
void | overwriteUniqueId (unsigned int newId) |
Overwrites the unique id. NOTE: use this only if you really know what you are doing! More... | |
virtual bool | isValid (void) const |
Return true if the LUT function is valid. An invalid LUT function can not be rendered. More... | |
virtual LUTVisualType | getVisualType (void) const |
Get LUT visual type. More... | |
virtual bool | isRelative (void) const |
Is LUT relative? More... | |
virtual void | setRelative (bool relative) |
Set/reset relative flag. More... | |
virtual LUTDimensionality | getDimensionality (void) const |
Get dimensionality (1, 2, or 3), usually depending on height and depth. More... | |
virtual int | getHeight (void) const |
Get native LUT height (= number of rows, numbering starts at 0) More... | |
virtual int | getDepth (void) const |
Get native LUT depth (= number of layers, numbering starts at 0) More... | |
virtual double | getNativeMinValue (void) const |
Get native minimum LUT value. More... | |
virtual double | getNativeMaxValue (void) const |
Get native maximum LUT value. More... | |
unsigned int | getId (void) const |
Get current LUT ID. More... | |
virtual bool | render (LUTDataBase *lutData) const |
Render LUT in (previously initialized) LUTData object. More... | |
virtual bool | renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const |
Render rescaled LUT in (previously initialized) LUTData object. More... | |
![]() | |
Base () | |
Constructor. More... | |
virtual | ~Base () |
Destructor. More... | |
virtual Base * | deepCopy () const |
Creates a deep copy of the given object. More... | |
bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
Checks whether this object's type is equal to or derived from one of the types given in the argument. More... | |
virtual bool | isRefCountedBase () const |
Returns whether the instance is derived from RefCountedBase. More... | |
virtual std::string | detailString () const |
Returns a string describing this object. More... | |
virtual bool | implementsPersistence (PersistenceInterface) const |
Override this method to declare which persistence interfaces are implemented by your derived class. More... | |
virtual std::string | persistentState () const |
Returns a string describing the object's internal state. More... | |
virtual void | setPersistentState (const std::string &state) |
Restores the object's internal state from a string that had been previously generated using persistentState(). More... | |
virtual void | addStateToTree (TreeNode *) const |
Attaches the object state as children of the given parent node. More... | |
virtual void | readStateFromTree (TreeNode *) |
Reads the object state from the children of the given parent node. More... | |
virtual void | writeTo (AbstractPersistenceOutputStream *) const |
Writes the objects state to the data stream object. More... | |
virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Reads the objects state from the data stream object. More... | |
Static Public Attributes | |
static const char * | shapeNames [numShapes] |
Shape names. More... | |
Protected Member Functions | |
ML_CLASS_HEADER (LUTFPrimitive) | |
LUT implementation | |
bool | renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override |
Render the lookup table into lutData using lutIterator to access and increment the LUT pointers. More... | |
bool | renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const override |
Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers. More... | |
template<typename T > | |
bool | renderLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double center, double width, double edgeWidth) const |
Render a LUT primitive (as selected by the _shape member variable) into lutData using lutIterator to access and increment the LUT pointers. More... | |
![]() | |
template<typename T > | |
bool | renderT (LUTData< T > *lutData, bool rescaled, double minIndex, double maxIndex) const |
Perform type-specific, native or rescaled (rescaled = true, rescale to range minIndex ... More... | |
template<typename T > | |
bool | interpolateLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double minIndex, double maxIndex) const |
Perform type-specific rescaled LUT rendering by. More... | |
ML_ABSTRACT_CLASS_HEADER (LUTFunction) | |
virtual LUTVisualType | getRenderType (LUTDataBase *) const |
Get visual type used for rendering. More... | |
Protected Attributes | |
ShapeType | _shape |
Function Type. More... | |
double | _center |
Ramp center. More... | |
double | _width |
Ramp width. More... | |
double | _edgeWidth |
Edge width (used for Wall shape only) More... | |
double | _baseValue |
Base LUT output level, relative to [0,1]. More... | |
double | _peakValue |
Center LUT output level, relative to [0,1]. More... | |
![]() | |
LUTVisualType | _visualType |
LUT visual type. More... | |
bool | _relative |
Flag for relative LUT. More... | |
unsigned int | _id |
Unique LUT ID, changed by the changed() method whenever a property of the LUT function object is modified. More... | |
Additional Inherited Members | |
![]() | |
static unsigned int | generateUniqueId (void) |
Generate a unique id (unique for all mlLUTFunctions), this can also be called to get a unique id for a LUTData object manually. More... | |
![]() | |
static unsigned int | _gNextId |
Global storage for next unused LUT ID to ensure uniqueness. More... | |
A single channel LUT with predefined primitives of different shapes.
Definition at line 28 of file mlLUTFPrimitive.h.
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.
ml::LUTFPrimitive::LUTFPrimitive | ( | void | ) |
Constructor.
|
inlinevirtual |
Get base value.
Definition at line 78 of file mlLUTFPrimitive.h.
|
inlinevirtual |
Get ramp center.
Definition at line 60 of file mlLUTFPrimitive.h.
|
inlinevirtual |
Get edge width.
Definition at line 72 of file mlLUTFPrimitive.h.
|
overridevirtual |
Get native maximum index.
Reimplemented from ml::LUTFunction.
|
overridevirtual |
Get native minimum index.
Reimplemented from ml::LUTFunction.
|
inlinevirtual |
Get peak value.
Definition at line 84 of file mlLUTFPrimitive.h.
|
inlinevirtual |
Get shape.
Definition at line 54 of file mlLUTFPrimitive.h.
|
inlinevirtual |
Get ramp width.
Definition at line 66 of file mlLUTFPrimitive.h.
|
protected |
|
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.
|
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.
|
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.
|
inlinevirtual |
Set base value.
Definition at line 81 of file mlLUTFPrimitive.h.
References ml::LUTFunction::changed().
|
inlinevirtual |
Set ramp center.
Definition at line 63 of file mlLUTFPrimitive.h.
References ml::LUTFunction::changed().
|
inlinevirtual |
Set edge width.
Definition at line 75 of file mlLUTFPrimitive.h.
References ml::LUTFunction::changed().
|
inlinevirtual |
Set peak value.
Definition at line 87 of file mlLUTFPrimitive.h.
References ml::LUTFunction::changed().
|
inlinevirtual |
|
inlinevirtual |
Set ramp width.
Definition at line 69 of file mlLUTFPrimitive.h.
References ml::LUTFunction::changed().
|
protected |
Base LUT output level, relative to [0,1].
Definition at line 147 of file mlLUTFPrimitive.h.
|
protected |
Ramp center.
Definition at line 138 of file mlLUTFPrimitive.h.
|
protected |
Edge width (used for Wall shape only)
Definition at line 144 of file mlLUTFPrimitive.h.
|
protected |
Center LUT output level, relative to [0,1].
Definition at line 150 of file mlLUTFPrimitive.h.
|
protected |
Function Type.
Definition at line 135 of file mlLUTFPrimitive.h.
|
protected |
Ramp width.
Definition at line 141 of file mlLUTFPrimitive.h.
|
static |
Shape names.
Definition at line 43 of file mlLUTFPrimitive.h.