Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::LookupTable Class Reference

The LookupTable class mitk wrapper for a vtkLookupTable. More...

#include <mitkLookupTable.h>

Inheritance diagram for mitk::LookupTable:
Collaboration diagram for mitk::LookupTable:

Public Types

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

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...
 
virtual LookupTableoperator= (const LookupTable &LookupTable)
 implementation necessary because operator made private in itk::Object 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 const char * GetStaticNameOfClass ()
 
static Pointer New ()
 

Static Public Attributes

static std::vector< std::string > typenameList
 

Protected Member Functions

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

vtkSmartPointer< vtkLookupTable > m_LookupTable
 
float m_Window
 
float m_Level
 
float m_Opacity
 
LookupTableType m_Type
 

Detailed Description

The LookupTable class mitk wrapper for a vtkLookupTable.

This class can be used to color images with a LookupTable, such as the vtkLookupTable.

Note
If you want to use this as a property for an mitk::Image, make sure to use the mitk::LookupTableProperty and set the mitk::RenderingModeProperty to a mode which supports lookup tables (e.g. LOOKUPTABLE_COLOR). Make sure to check the documentation of the mitk::RenderingModeProperty. For a code example how to use the mitk::LookupTable check the mitkImageVtkMapper2DLookupTableTest.cpp in Core/Code/Testing.

Definition at line 42 of file mitkLookupTable.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 50 of file mitkLookupTable.h.

◆ Pointer

◆ RawLookupTableType

RawLookupTableType raw lookuptable typedef for convenience.

Definition at line 48 of file mitkLookupTable.h.

◆ Self

Definition at line 50 of file mitkLookupTable.h.

◆ Superclass

typedef itk::DataObject mitk::LookupTable::Superclass

Definition at line 50 of file mitkLookupTable.h.

Member Enumeration Documentation

◆ LookupTableType

The LookupTableType enum for different predefined lookup tables.

  • GRAYSCALE Our default level-window (sometimes referred to as window-level by other sources) setup for a test image looks like this:
  • INVERSE_GRAYSCALE Inverse LookupTable of GRAYSCALE.
  • HOT_IRON A LookupTable for red colors.
  • JET A LookupTable for JET color rendering.
  • LEGACY_BINARY A LookupTable for binary images.
  • LEGACY_RAINBOW_COLOR A rainbow-like LookupTable.
  • MULTILABEL A LookupTable for multilabel images.
  • PET_COLOR A LookupTable for PET color rendering.
  • PET_20 A LookupTable for PET_20 color rendering.
  • TURBO An improved rainbow LookupTable for visualization.

The different LookupTableTypes can be applied in the MitkWorkbench via right-clicking on an image and choosing a color map.

Enumerator
GRAYSCALE 
INVERSE_GRAYSCALE 
HOT_IRON 
JET 
JET_TRANSPARENT 
PLASMA 
INFERNO 
VIRIDIS 
MAGMA 
LEGACY_BINARY 
LEGACY_RAINBOW_COLOR 
MULTILABEL 
PET_COLOR 
PET_20 
TURBO 

Definition at line 199 of file mitkLookupTable.h.

Constructor & Destructor Documentation

◆ LookupTable() [1/2]

mitk::LookupTable::LookupTable ( )

◆ ~LookupTable()

mitk::LookupTable::~LookupTable ( )
override

◆ LookupTable() [2/2]

mitk::LookupTable::LookupTable ( const LookupTable other)
protected

Member Function Documentation

◆ BuildGrayScaleLookupTable()

virtual void mitk::LookupTable::BuildGrayScaleLookupTable ( )
protectedvirtual

◆ BuildHotIronLookupTable()

virtual void mitk::LookupTable::BuildHotIronLookupTable ( )
protectedvirtual

◆ BuildInfernoLookupTable()

virtual void mitk::LookupTable::BuildInfernoLookupTable ( )
protectedvirtual

◆ BuildInverseGrayScaleLookupTable()

virtual void mitk::LookupTable::BuildInverseGrayScaleLookupTable ( )
protectedvirtual

◆ BuildJetLookupTable()

virtual void mitk::LookupTable::BuildJetLookupTable ( bool  transparent = false)
protectedvirtual

◆ BuildLegacyBinaryLookupTable()

virtual void mitk::LookupTable::BuildLegacyBinaryLookupTable ( )
protectedvirtual

◆ BuildLegacyRainbowColorLookupTable()

virtual void mitk::LookupTable::BuildLegacyRainbowColorLookupTable ( )
protectedvirtual

◆ BuildMagmaLookupTable()

virtual void mitk::LookupTable::BuildMagmaLookupTable ( )
protectedvirtual

◆ BuildMultiLabelLookupTable()

virtual void mitk::LookupTable::BuildMultiLabelLookupTable ( )
protectedvirtual

◆ BuildPET20LookupTable()

virtual void mitk::LookupTable::BuildPET20LookupTable ( )
protectedvirtual

◆ BuildPETColorLookupTable()

virtual void mitk::LookupTable::BuildPETColorLookupTable ( )
protectedvirtual

◆ BuildPlasmaLookupTable()

virtual void mitk::LookupTable::BuildPlasmaLookupTable ( )
protectedvirtual

◆ BuildTurboLookupTable()

virtual void mitk::LookupTable::BuildTurboLookupTable ( )
protectedvirtual

◆ BuildViridisLookupTable()

virtual void mitk::LookupTable::BuildViridisLookupTable ( )
protectedvirtual

◆ ChangeOpacity()

virtual void mitk::LookupTable::ChangeOpacity ( int  index,
float  opacity 
)
virtual

ChangeOpacity Set the opacity for a specific table index.

Parameters
indexThe lookuptable index.
opacityOpacity between 0.0 and 1.0.

◆ ChangeOpacityForAll()

virtual void mitk::LookupTable::ChangeOpacityForAll ( float  opacity)
virtual

ChangeOpacityForAll Set the opacity for all table values.

Parameters
opacityOpacity between 0.0 and 1.0.

◆ Clone()

Pointer mitk::LookupTable::Clone ( ) const

◆ CreateColorTransferFunction() [1/2]

vtkSmartPointer<vtkColorTransferFunction> mitk::LookupTable::CreateColorTransferFunction ( )

◆ CreateColorTransferFunction() [2/2]

void mitk::LookupTable::CreateColorTransferFunction ( vtkColorTransferFunction *&  colorFunction)
Deprecated:
(as of 2014_03) Please use CreateColorTransferFunction() instead

◆ CreateGradientTransferFunction() [1/2]

vtkSmartPointer<vtkPiecewiseFunction> mitk::LookupTable::CreateGradientTransferFunction ( )

◆ CreateGradientTransferFunction() [2/2]

void mitk::LookupTable::CreateGradientTransferFunction ( vtkPiecewiseFunction *&  gradientFunction)
Deprecated:
(as of 2014_03) Please use CreateGradientTransferFunction() instead

◆ CreateOpacityTransferFunction() [1/2]

vtkSmartPointer<vtkPiecewiseFunction> mitk::LookupTable::CreateOpacityTransferFunction ( )

◆ CreateOpacityTransferFunction() [2/2]

void mitk::LookupTable::CreateOpacityTransferFunction ( vtkPiecewiseFunction *&  opacityFunction)
Deprecated:
(as of 2014_03) Please use CreateOpacityTransferFunction() instead

◆ GetActiveType()

virtual LookupTableType mitk::LookupTable::GetActiveType ( ) const
virtual

Return the current look-up table type.

◆ GetActiveTypeAsString()

virtual std::string mitk::LookupTable::GetActiveTypeAsString ( ) const
virtual

Return the current look-up table type as a string.

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::LookupTable::GetClassHierarchy ( ) const
inlinevirtual

Definition at line 50 of file mitkLookupTable.h.

◆ GetClassName()

virtual const char* mitk::LookupTable::GetClassName ( ) const
virtual

◆ GetColor()

virtual void mitk::LookupTable::GetColor ( double  value,
double  rgb[3] 
)
virtual

GetColor convenience method wrapping the vtkLookupTable::GetColor() method.

Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.

Parameters
valueThe value you want to map.
rgbRGB values between 0 and 1.

◆ GetRawLookupTable()

virtual RawLookupTableType* mitk::LookupTable::GetRawLookupTable ( ) const
virtual

GetRawLookupTable Getter for the raw lookuptable array.

◆ GetStaticNameOfClass()

static const char* mitk::LookupTable::GetStaticNameOfClass ( )
inlinestatic

Definition at line 50 of file mitkLookupTable.h.

◆ GetTableValue()

virtual void mitk::LookupTable::GetTableValue ( int  index,
double  rgba[4] 
)
virtual

GetTableValue convenience method wrapping the vtkLookupTable::GetTableValue() method.

Parameters
indexThe index you want to get.
rgbaRGB values between 0 and 1.

◆ GetVtkLookupTable()

virtual vtkSmartPointer<vtkLookupTable> mitk::LookupTable::GetVtkLookupTable ( ) const
virtual

GetVtkLookupTable Getter for the internally wrapped vtkLookupTable.

◆ New()

static Pointer mitk::LookupTable::New ( )
static

◆ operator!=()

virtual bool mitk::LookupTable::operator!= ( const LookupTable LookupTable) const
virtual

non equality operator implementation

◆ operator=()

virtual LookupTable& mitk::LookupTable::operator= ( const LookupTable LookupTable)
virtual

implementation necessary because operator made private in itk::Object

Reimplemented in mitk::LabeledImageLookupTable.

◆ operator==()

virtual bool mitk::LookupTable::operator== ( const mitk::LookupTable LookupTable) const
virtual

equality operator implementation

◆ PrintSelf()

void mitk::LookupTable::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::LookupTable::RequestedRegionIsOutsideOfTheBufferedRegion ( )
override

Checks, if the requested region lies outside of the buffered region by calling verifyRequestedRegion().

◆ SetLevel()

virtual void mitk::LookupTable::SetLevel ( float  _arg)
virtual

◆ SetOpacity()

virtual void mitk::LookupTable::SetOpacity ( float  _arg)
virtual

◆ SetRequestedRegion()

void mitk::LookupTable::SetRequestedRegion ( const itk::DataObject *  data)
override

This method has no effect for lookup tables, since we do not support the region-mechanism.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::LookupTable::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.

◆ SetTableValue()

virtual void mitk::LookupTable::SetTableValue ( int  index,
double  rgba[4] 
)
virtual

SetTableValue convenience method wrapping the vtkLookupTable::SetTableValue() method.

Parameters
indexThe index you want to set.
rgbaRGB values between 0 and 1.

◆ SetType() [1/2]

virtual void mitk::LookupTable::SetType ( const LookupTableType  type)
virtual

Set the look-up table type by enum (or integer).

Returns if the given type doesn't exist. Only changes the type if it is different from the current one.

◆ SetType() [2/2]

virtual void mitk::LookupTable::SetType ( const std::string &  typeName)
virtual

Set the look-up table type by string.

Returns if the given type doesn't exist. Only changes the type if it is different from the current one.

◆ SetVtkLookupTable()

virtual void mitk::LookupTable::SetVtkLookupTable ( vtkSmartPointer< vtkLookupTable >  lut)
virtual

SetVtkLookupTable Setter for the internal lookuptable.

Parameters
lutThe lookuptable.

◆ SetWindow()

virtual void mitk::LookupTable::SetWindow ( float  _arg)
virtual

◆ UpdateOutputInformation()

void mitk::LookupTable::UpdateOutputInformation ( )
override

Updates the output information of the current object by calling updateOutputInformation of the data objects source object.

◆ VerifyRequestedRegion()

bool mitk::LookupTable::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.

Member Data Documentation

◆ m_Level

float mitk::LookupTable::m_Level
protected

Definition at line 267 of file mitkLookupTable.h.

◆ m_LookupTable

vtkSmartPointer<vtkLookupTable> mitk::LookupTable::m_LookupTable
protected

Definition at line 264 of file mitkLookupTable.h.

◆ m_Opacity

float mitk::LookupTable::m_Opacity
protected

Definition at line 268 of file mitkLookupTable.h.

◆ m_Type

LookupTableType mitk::LookupTable::m_Type
protected

Definition at line 270 of file mitkLookupTable.h.

◆ m_Window

float mitk::LookupTable::m_Window
protected

Definition at line 266 of file mitkLookupTable.h.

◆ typenameList

std::vector<std::string> mitk::LookupTable::typenameList
static

Definition at line 218 of file mitkLookupTable.h.


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