Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::LabeledImageLookupTable Class Reference

#include <mitkLabeledImageLookupTable.h>

Inheritance diagram for mitk::LabeledImageLookupTable:
Collaboration diagram for mitk::LabeledImageLookupTable:

Public Types

typedef unsigned char LabelType
 
- Public Types inherited from mitk::LookupTable
enum  LookupTableType {
  GRAYSCALE, INVERSE_GRAYSCALE, HOT_IRON, JET,
  JET_TRANSPARENT, PLASMA, INFERNO, VIRIDIS,
  MAGMA, LEGACY_BINARY, LEGACY_RAINBOW_COLOR, MULTILABEL,
  PET_COLOR, PET_20, TURBO
}
 The LookupTableType enum for different predefined lookup tables. More...
 
typedef unsigned char RawLookupTableType
 RawLookupTableType raw lookuptable typedef for convenience. More...
 
typedef LookupTable Self
 
typedef itk::DataObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

 mitkClassMacro (LabeledImageLookupTable, LookupTable)
 
Pointer Clone () const
 
LabeledImageLookupTableoperator= (const LookupTable &other) override
 implementation necessary because operator made private in itk::Object More...
 
virtual void SetColorForLabel (const LabelType &label, const double &r, const double &g, const double &b, const double a=1.0)
 
virtual double * GetColorForLabel (const LabelType &label)
 
mitk::LevelWindow GetLevelWindow ()
 
- Public Member Functions inherited from mitk::LookupTable
virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual vtkSmartPointer< vtkLookupTable > GetVtkLookupTable () const
 GetVtkLookupTable Getter for the internally wrapped vtkLookupTable. More...
 
virtual RawLookupTableTypeGetRawLookupTable () const
 GetRawLookupTable Getter for the raw lookuptable array. More...
 
virtual void SetVtkLookupTable (vtkSmartPointer< vtkLookupTable > lut)
 SetVtkLookupTable Setter for the internal lookuptable. More...
 
virtual void ChangeOpacityForAll (float opacity)
 ChangeOpacityForAll Set the opacity for all table values. More...
 
virtual void ChangeOpacity (int index, float opacity)
 ChangeOpacity Set the opacity for a specific table index. More...
 
virtual void GetColor (double value, double rgb[3])
 GetColor convenience method wrapping the vtkLookupTable::GetColor() method. More...
 
virtual void GetTableValue (int index, double rgba[4])
 GetTableValue convenience method wrapping the vtkLookupTable::GetTableValue() method. More...
 
virtual void SetTableValue (int index, double rgba[4])
 SetTableValue convenience method wrapping the vtkLookupTable::SetTableValue() method. More...
 
virtual void SetWindow (float _arg)
 
virtual void SetLevel (float _arg)
 
virtual void SetOpacity (float _arg)
 
virtual bool operator== (const mitk::LookupTable &LookupTable) const
 equality operator implementation More...
 
virtual bool operator!= (const LookupTable &LookupTable) const
 non equality operator implementation More...
 
void UpdateOutputInformation () override
 Updates the output information of the current object by calling updateOutputInformation of the data objects source object. More...
 
void SetRequestedRegionToLargestPossibleRegion () override
 Sets the requested Region to the largest possible region. This method is not implemented, since this is the default behavior of the itk pipeline and we do not support the requested-region mechanism for lookup-tables. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Checks, if the requested region lies outside of the buffered region by calling verifyRequestedRegion(). More...
 
bool VerifyRequestedRegion () override
 Checks if the requested region is completely contained in the buffered region. Since we always want to process the lookup table as a whole, this method always returns true. More...
 
void SetRequestedRegion (const itk::DataObject *data) override
 This method has no effect for lookup tables, since we do not support the region-mechanism. More...
 
 LookupTable ()
 
 ~LookupTable () override
 
void CreateColorTransferFunction (vtkColorTransferFunction *&colorFunction)
 
void CreateOpacityTransferFunction (vtkPiecewiseFunction *&opacityFunction)
 
void CreateGradientTransferFunction (vtkPiecewiseFunction *&gradientFunction)
 
vtkSmartPointer< vtkColorTransferFunction > CreateColorTransferFunction ()
 
vtkSmartPointer< vtkPiecewiseFunction > CreateOpacityTransferFunction ()
 
vtkSmartPointer< vtkPiecewiseFunction > CreateGradientTransferFunction ()
 
virtual void SetType (const LookupTableType type)
 Set the look-up table type by enum (or integer). More...
 
virtual void SetType (const std::string &typeName)
 Set the look-up table type by string. More...
 
virtual LookupTableType GetActiveType () const
 Return the current look-up table type. More...
 
virtual std::string GetActiveTypeAsString () const
 Return the current look-up table type as a string. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::LookupTable
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 

Protected Member Functions

 LabeledImageLookupTable ()
 
 LabeledImageLookupTable (const LabeledImageLookupTable &other)
 
 ~LabeledImageLookupTable () override
 
virtual void GenerateRandomColor (double &r, double &g, double &b)
 
virtual double GenerateRandomNumber ()
 
- Protected Member Functions inherited from mitk::LookupTable
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 LookupTable (const LookupTable &other)
 
virtual void BuildGrayScaleLookupTable ()
 
virtual void BuildLegacyBinaryLookupTable ()
 
virtual void BuildLegacyRainbowColorLookupTable ()
 
virtual void BuildInverseGrayScaleLookupTable ()
 
virtual void BuildHotIronLookupTable ()
 
virtual void BuildPlasmaLookupTable ()
 
virtual void BuildInfernoLookupTable ()
 
virtual void BuildViridisLookupTable ()
 
virtual void BuildMagmaLookupTable ()
 
virtual void BuildJetLookupTable (bool transparent=false)
 
virtual void BuildPETColorLookupTable ()
 
virtual void BuildPET20LookupTable ()
 
virtual void BuildMultiLabelLookupTable ()
 
virtual void BuildTurboLookupTable ()
 

Protected Attributes

mitk::LevelWindow m_LevelWindow
 
- Protected Attributes inherited from mitk::LookupTable
vtkSmartPointer< vtkLookupTable > m_LookupTable
 
float m_Window
 
float m_Level
 
float m_Opacity
 
LookupTableType m_Type
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::LookupTable
static std::vector< std::string > typenameList
 

Detailed Description

A lookup table for 2D mapping of labeled images. The lookup table supports images with up to 256 unsigned labels. Negative labels are not supported. Please use the level/window settings as given by the GetLevelWindow() method to make sure, that the colors are rendered correctly. The colors are initialized with random colors as default. As background the label 0 is assumed. The color for the background is set to fully transparent as default.

Definition at line 33 of file mitkLabeledImageLookupTable.h.

Member Typedef Documentation

◆ LabelType

The data type for a label. Currently only images with labels in the range [0,255] are supported.

Definition at line 45 of file mitkLabeledImageLookupTable.h.

Constructor & Destructor Documentation

◆ LabeledImageLookupTable() [1/2]

mitk::LabeledImageLookupTable::LabeledImageLookupTable ( )
protected

Default constructor. Protected to prevent "normal" creation

◆ LabeledImageLookupTable() [2/2]

mitk::LabeledImageLookupTable::LabeledImageLookupTable ( const LabeledImageLookupTable other)
protected

◆ ~LabeledImageLookupTable()

mitk::LabeledImageLookupTable::~LabeledImageLookupTable ( )
overrideprotected

Virtual destructor

Member Function Documentation

◆ Clone()

Pointer mitk::LabeledImageLookupTable::Clone ( ) const

◆ GenerateRandomColor()

virtual void mitk::LabeledImageLookupTable::GenerateRandomColor ( double &  r,
double &  g,
double &  b 
)
protectedvirtual

Generates a random rgb color value. Values for rgb are in the range [0,1]

◆ GenerateRandomNumber()

virtual double mitk::LabeledImageLookupTable::GenerateRandomNumber ( )
protectedvirtual

Generates a radnom number drawn from a uniform distribution in the range [0,1].

◆ GetColorForLabel()

virtual double* mitk::LabeledImageLookupTable::GetColorForLabel ( const LabelType label)
virtual

Determines the color which will be used for coloring a given label.

Parameters
labelthe label for which the color should be returned
Returns
an rgba array containing the color information for the given label. Color components are expressed as [0,1] double values.

◆ GetLevelWindow()

mitk::LevelWindow mitk::LabeledImageLookupTable::GetLevelWindow ( )
inline

Provides access to level window settings, which should be used in combination with the LUTs generated by this filter (at lease for 2D visualization. If you use other level/window settings, it is not guaranteed, that scalar values are mapped to the correct colors.

Definition at line 80 of file mitkLabeledImageLookupTable.h.

◆ mitkClassMacro()

mitk::LabeledImageLookupTable::mitkClassMacro ( LabeledImageLookupTable  ,
LookupTable   
)

Standard mitk typedefs are generated by the mitkClassMacro

◆ New()

static Pointer mitk::LabeledImageLookupTable::New ( )
static

Make this object constructable by the ::New() Method.

◆ operator=()

LabeledImageLookupTable& mitk::LabeledImageLookupTable::operator= ( const LookupTable LookupTable)
overridevirtual

implementation necessary because operator made private in itk::Object

Reimplemented from mitk::LookupTable.

◆ SetColorForLabel()

virtual void mitk::LabeledImageLookupTable::SetColorForLabel ( const LabelType label,
const double &  r,
const double &  g,
const double &  b,
const double  a = 1.0 
)
virtual

Sets the color for a given label

Parameters
labelThe pixel value used as a label in the image
rThe red component of the rgba color value. Values should be given in the range [0,1]
gThe green component of the rgba color value. Values should be given in the range [0,1]
bThe blue component of the rgba color value. Values should be given in the range [0,1]
aThe alpha component of the rgba color value. Values should be given in the range [0,1]. Default is 1.

Member Data Documentation

◆ m_LevelWindow

mitk::LevelWindow mitk::LabeledImageLookupTable::m_LevelWindow
protected

Definition at line 105 of file mitkLabeledImageLookupTable.h.


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