MeVisLab Toolbox Reference
ml::LUTFRescale Class Reference

LUT transform to rescale a LUT's index range and to convert an absolute to a relative LUT. More...

#include <mlLUTFRescale.h>

Inheritance diagram for ml::LUTFRescale:
ml::LUTFunction ml::Base

Public Member Functions

 LUTFRescale (void)
 Constructor.
 
virtual void setInputLUT (const LUTFunction *inLUT)
 Set input LUT, set relative flag to true if input LUT is relative.
 
Transform parameters
void setRelative (bool relative) override
 Set/reset relative flag, can only be set if input LUT is absolute.
 
virtual bool getAutoSourceRange (void) const
 Get auto source index range flag.
 
virtual void setAutoSourceRange (bool autoSourceRange)
 Set auto source index range flag.
 
virtual double getSourceMin (void) const
 Get minimum source index.
 
virtual double getSourceMax (void) const
 Get maximum source index.
 
virtual void setSourceRange (double sourceMin, double sourceMax)
 Set source index range.
 
virtual double getTargetMin (void) const
 Get minimum target index.
 
virtual double getTargetMax (void) const
 Get maximum target index.
 
virtual void setTargetRange (double targetMin, double targetMax)
 Set target index range.
 
LUT properties
bool isValid (void) const override
 Return true if the LUT function is valid.
 
LUTVisualType getVisualType (void) const override
 Get LUT visual type.
 
double getNativeMinIndex (void) const override
 Get native minimum index.
 
double getNativeMaxIndex (void) const override
 Get native maximum index.
 
int getHeight (void) const override
 Get native LUT height (= number of rows, numbering starts at 0)
 
int getDepth (void) const override
 Get native LUT depth (= number of layers, numbering starts at 0)
 
double getNativeMinValue (void) const override
 Get native minimum LUT value.
 
double getNativeMaxValue (void) const override
 Get native maximum LUT value.
 
- Public Member Functions inherited from ml::LUTFunction
 LUTFunction (LUTVisualType vt, bool relative)
 Constructor.
 
void changed (void)
 Assign a new LUT ID.
 
void overwriteUniqueId (unsigned int newId)
 Overwrites the unique id. NOTE: use this only if you really know what you are doing!
 
virtual bool isRelative (void) const
 Is LUT relative?
 
virtual LUTDimensionality getDimensionality (void) const
 Get dimensionality (1, 2, or 3), usually depending on height and depth.
 
unsigned int getId (void) const
 Get current LUT ID.
 
virtual bool render (LUTDataBase *lutData) const
 Render LUT in (previously initialized) LUTData object.
 
virtual bool renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const
 Render rescaled LUT in (previously initialized) LUTData object.
 
- 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 std::string persistentState () const
 Returns a string describing the object's internal state.
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState().
 
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

 ML_CLASS_HEADER (LUTFRescale)
 
Index rescale transformations
virtual double transformForward (double index) const
 Apply rescaling to index.
 
virtual double transformInverse (double index) const
 Apply inverse rescaling to index.
 
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.
 
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.
 
- Protected Member Functions inherited from ml::LUTFunction
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 ... maxIndex) LUT rendering by.
 
template<typename T >
bool interpolateLUT (LUTData< T > *lutData, LUTIterator< T > *lutIterator, double minIndex, double maxIndex) const
 Perform type-specific rescaled LUT rendering by.
 
 ML_ABSTRACT_CLASS_HEADER (LUTFunction)
 
virtual LUTVisualType getRenderType (LUTDataBase *) const
 Get visual type used for rendering.
 

Protected Attributes

const LUTFunction_inLUT
 Input LUT.
 
bool _autoSourceRange
 Source index range is determined from input LUT.
 
double _sourceMin
 Source index range.
 
double _sourceMax
 
double _targetMin
 Target index range.
 
double _targetMax
 
- Protected Attributes inherited from ml::LUTFunction
LUTVisualType _visualType
 LUT visual type.
 
bool _relative
 Flag for relative LUT.
 
unsigned int _id
 Unique LUT ID, changed by the changed() method whenever a property of the LUT function object is modified.
 

Additional Inherited Members

- Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
 
- Static Public Member Functions inherited from ml::LUTFunction
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.
 
- Static Protected Attributes inherited from ml::LUTFunction
static unsigned int _gNextId
 Global storage for next unused LUT ID to ensure uniqueness.
 

Detailed Description

LUT transform to rescale a LUT's index range and to convert an absolute to a relative LUT.

Definition at line 30 of file mlLUTFRescale.h.

Constructor & Destructor Documentation

◆ LUTFRescale()

ml::LUTFRescale::LUTFRescale ( void )

Constructor.

Member Function Documentation

◆ getAutoSourceRange()

virtual bool ml::LUTFRescale::getAutoSourceRange ( void ) const
inlinevirtual

Get auto source index range flag.

Definition at line 50 of file mlLUTFRescale.h.

◆ getDepth()

int ml::LUTFRescale::getDepth ( void ) const
overridevirtual

Get native LUT depth (= number of layers, numbering starts at 0)

Reimplemented from ml::LUTFunction.

◆ getHeight()

int ml::LUTFRescale::getHeight ( void ) const
overridevirtual

Get native LUT height (= number of rows, numbering starts at 0)

Reimplemented from ml::LUTFunction.

◆ getNativeMaxIndex()

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

Get native maximum index.

Reimplemented from ml::LUTFunction.

◆ getNativeMaxValue()

double ml::LUTFRescale::getNativeMaxValue ( void ) const
overridevirtual

Get native maximum LUT value.

Reimplemented from ml::LUTFunction.

◆ getNativeMinIndex()

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

Get native minimum index.

Reimplemented from ml::LUTFunction.

◆ getNativeMinValue()

double ml::LUTFRescale::getNativeMinValue ( void ) const
overridevirtual

Get native minimum LUT value.

Reimplemented from ml::LUTFunction.

◆ getSourceMax()

virtual double ml::LUTFRescale::getSourceMax ( void ) const
virtual

Get maximum source index.

◆ getSourceMin()

virtual double ml::LUTFRescale::getSourceMin ( void ) const
virtual

Get minimum source index.

◆ getTargetMax()

virtual double ml::LUTFRescale::getTargetMax ( void ) const
inlinevirtual

Get maximum target index.

Definition at line 68 of file mlLUTFRescale.h.

◆ getTargetMin()

virtual double ml::LUTFRescale::getTargetMin ( void ) const
inlinevirtual

Get minimum target index.

Definition at line 65 of file mlLUTFRescale.h.

◆ getVisualType()

LUTVisualType ml::LUTFRescale::getVisualType ( void ) const
overridevirtual

Get LUT visual type.

Reimplemented from ml::LUTFunction.

◆ isValid()

bool ml::LUTFRescale::isValid ( void ) const
overridevirtual

Return true if the LUT function is valid.

Reimplemented from ml::LUTFunction.

◆ ML_CLASS_HEADER()

ml::LUTFRescale::ML_CLASS_HEADER ( LUTFRescale )
protected

◆ renderLUTNative()

bool ml::LUTFRescale::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::LUTFRescale::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.

◆ setAutoSourceRange()

virtual void ml::LUTFRescale::setAutoSourceRange ( bool autoSourceRange)
inlinevirtual

Set auto source index range flag.

Definition at line 53 of file mlLUTFRescale.h.

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

◆ setInputLUT()

virtual void ml::LUTFRescale::setInputLUT ( const LUTFunction * inLUT)
virtual

Set input LUT, set relative flag to true if input LUT is relative.

◆ setRelative()

void ml::LUTFRescale::setRelative ( bool relative)
overridevirtual

Set/reset relative flag, can only be set if input LUT is absolute.

A relative LUT can not be converted to an absolute LUT.

Reimplemented from ml::LUTFunction.

◆ setSourceRange()

virtual void ml::LUTFRescale::setSourceRange ( double sourceMin,
double sourceMax )
virtual

Set source index range.

◆ setTargetRange()

virtual void ml::LUTFRescale::setTargetRange ( double targetMin,
double targetMax )
virtual

Set target index range.

◆ transformForward()

virtual double ml::LUTFRescale::transformForward ( double index) const
protectedvirtual

Apply rescaling to index.

◆ transformInverse()

virtual double ml::LUTFRescale::transformInverse ( double index) const
protectedvirtual

Apply inverse rescaling to index.

Member Data Documentation

◆ _autoSourceRange

bool ml::LUTFRescale::_autoSourceRange
protected

Source index range is determined from input LUT.

Definition at line 144 of file mlLUTFRescale.h.

◆ _inLUT

const LUTFunction* ml::LUTFRescale::_inLUT
protected

Input LUT.

Definition at line 141 of file mlLUTFRescale.h.

◆ _sourceMax

double ml::LUTFRescale::_sourceMax
protected

Definition at line 147 of file mlLUTFRescale.h.

◆ _sourceMin

double ml::LUTFRescale::_sourceMin
protected

Source index range.

Definition at line 147 of file mlLUTFRescale.h.

◆ _targetMax

double ml::LUTFRescale::_targetMax
protected

Definition at line 150 of file mlLUTFRescale.h.

◆ _targetMin

double ml::LUTFRescale::_targetMin
protected

Target index range.

Definition at line 150 of file mlLUTFRescale.h.


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