Medical Imaging Interaction Toolkit  2018.4.99-eed36131
Medical Imaging Interaction Toolkit
mitk::LookupTable Class Reference

The LookupTable class mitk wrapper for a vtkLookupTableThis class can be used to color images with a LookupTable, such as the 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
}
 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 ()
 

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.

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:
    ExampleLevelWindowColor.png
  • 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.

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 

Definition at line 198 of file mitkLookupTable.h.

Constructor & Destructor Documentation

◆ LookupTable() [1/2]

mitk::LookupTable::LookupTable ( )

Definition at line 47 of file mitkLookupTable.cpp.

References BuildGrayScaleLookupTable().

◆ ~LookupTable()

mitk::LookupTable::~LookupTable ( )
override

Definition at line 68 of file mitkLookupTable.cpp.

◆ LookupTable() [2/2]

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

Definition at line 57 of file mitkLookupTable.cpp.

References m_LookupTable.

Member Function Documentation

◆ BuildGrayScaleLookupTable()

void mitk::LookupTable::BuildGrayScaleLookupTable ( )
protectedvirtual

Definition at line 414 of file mitkLookupTable.cpp.

References m_LookupTable.

Referenced by LookupTable(), and SetType().

◆ BuildHotIronLookupTable()

void mitk::LookupTable::BuildHotIronLookupTable ( )
protectedvirtual

Definition at line 455 of file mitkLookupTable.cpp.

References HotIron, and m_LookupTable.

Referenced by SetType().

◆ BuildInfernoLookupTable()

void mitk::LookupTable::BuildInfernoLookupTable ( )
protectedvirtual

Definition at line 601 of file mitkLookupTable.cpp.

References Inferno, and m_LookupTable.

Referenced by SetType().

◆ BuildInverseGrayScaleLookupTable()

void mitk::LookupTable::BuildInverseGrayScaleLookupTable ( )
protectedvirtual

Definition at line 441 of file mitkLookupTable.cpp.

References m_LookupTable.

Referenced by SetType().

◆ BuildJetLookupTable()

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

Definition at line 471 of file mitkLookupTable.cpp.

References Jet, and m_LookupTable.

Referenced by SetType().

◆ BuildLegacyBinaryLookupTable()

void mitk::LookupTable::BuildLegacyBinaryLookupTable ( )
protectedvirtual

Definition at line 427 of file mitkLookupTable.cpp.

References m_LookupTable.

Referenced by SetType().

◆ BuildLegacyRainbowColorLookupTable()

void mitk::LookupTable::BuildLegacyRainbowColorLookupTable ( )
protectedvirtual

Definition at line 573 of file mitkLookupTable.cpp.

References m_LookupTable.

Referenced by SetType().

◆ BuildMagmaLookupTable()

void mitk::LookupTable::BuildMagmaLookupTable ( )
protectedvirtual

Definition at line 633 of file mitkLookupTable.cpp.

References m_LookupTable, and Magma.

Referenced by SetType().

◆ BuildMultiLabelLookupTable()

void mitk::LookupTable::BuildMultiLabelLookupTable ( )
protectedvirtual

Definition at line 527 of file mitkLookupTable.cpp.

References m_LookupTable, and Multilabel.

Referenced by SetType().

◆ BuildPET20LookupTable()

void mitk::LookupTable::BuildPET20LookupTable ( )
protectedvirtual

Definition at line 511 of file mitkLookupTable.cpp.

References m_Level, m_LookupTable, m_Window, and PET20.

Referenced by SetType().

◆ BuildPETColorLookupTable()

void mitk::LookupTable::BuildPETColorLookupTable ( )
protectedvirtual

Definition at line 494 of file mitkLookupTable.cpp.

References m_Level, m_LookupTable, m_Window, and PETColor.

Referenced by SetType().

◆ BuildPlasmaLookupTable()

void mitk::LookupTable::BuildPlasmaLookupTable ( )
protectedvirtual

Definition at line 585 of file mitkLookupTable.cpp.

References m_LookupTable, and Plasma.

Referenced by SetType().

◆ BuildViridisLookupTable()

void mitk::LookupTable::BuildViridisLookupTable ( )
protectedvirtual

Definition at line 617 of file mitkLookupTable.cpp.

References m_LookupTable, and Viridis.

Referenced by SetType().

◆ ChangeOpacity()

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.

Definition at line 182 of file mitkLookupTable.cpp.

References m_LookupTable, and MITK_INFO.

◆ ChangeOpacityForAll()

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

ChangeOpacityForAll Set the opacity for all table values.

Parameters
opacityOpacity between 0.0 and 1.0.

Definition at line 166 of file mitkLookupTable.cpp.

References m_LookupTable.

◆ Clone()

Pointer mitk::LookupTable::Clone ( ) const

◆ CreateColorTransferFunction() [1/2]

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

Definition at line 340 of file mitkLookupTable.cpp.

References CreateColorTransferFunction().

◆ CreateColorTransferFunction() [2/2]

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

Definition at line 312 of file mitkLookupTable.cpp.

References GetRawLookupTable(), and m_LookupTable.

Referenced by CreateColorTransferFunction().

◆ CreateGradientTransferFunction() [1/2]

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

Definition at line 396 of file mitkLookupTable.cpp.

References CreateGradientTransferFunction().

◆ CreateGradientTransferFunction() [2/2]

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

Definition at line 373 of file mitkLookupTable.cpp.

References GetRawLookupTable(), and m_LookupTable.

Referenced by CreateGradientTransferFunction().

◆ CreateOpacityTransferFunction() [1/2]

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

Definition at line 368 of file mitkLookupTable.cpp.

References CreateOpacityTransferFunction().

◆ CreateOpacityTransferFunction() [2/2]

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

Definition at line 345 of file mitkLookupTable.cpp.

References GetRawLookupTable(), and m_LookupTable.

Referenced by CreateOpacityTransferFunction().

◆ GetActiveType()

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

Return the current look-up table type.

Definition at line 151 of file mitkLookupTable.cpp.

References m_Type.

◆ GetActiveTypeAsString()

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

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

Definition at line 156 of file mitkLookupTable.cpp.

References m_Type, and typenameList.

◆ 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()

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.

Definition at line 201 of file mitkLookupTable.cpp.

References GetVtkLookupTable().

◆ GetRawLookupTable()

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

GetRawLookupTable Getter for the raw lookuptable array.

Definition at line 221 of file mitkLookupTable.cpp.

References m_LookupTable.

Referenced by CreateColorTransferFunction(), CreateGradientTransferFunction(), and CreateOpacityTransferFunction().

◆ GetStaticNameOfClass()

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

Definition at line 50 of file mitkLookupTable.h.

◆ GetTableValue()

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.

Definition at line 206 of file mitkLookupTable.cpp.

References GetVtkLookupTable().

◆ GetVtkLookupTable()

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

GetVtkLookupTable Getter for the internally wrapped vtkLookupTable.

Definition at line 216 of file mitkLookupTable.cpp.

References m_LookupTable.

Referenced by GetColor(), GetTableValue(), operator=(), operator==(), and SetTableValue().

◆ New()

◆ operator!=()

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

non equality operator implementation

Definition at line 262 of file mitkLookupTable.cpp.

◆ operator=()

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

implementation necessary because operator made private in itk::Object

Reimplemented in mitk::LabeledImageLookupTable.

Definition at line 267 of file mitkLookupTable.cpp.

References GetVtkLookupTable(), and m_LookupTable.

Referenced by mitk::LabeledImageLookupTable::operator=().

◆ operator==()

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

equality operator implementation

Definition at line 226 of file mitkLookupTable.cpp.

References GetVtkLookupTable(), and m_LookupTable.

◆ PrintSelf()

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

Definition at line 401 of file mitkLookupTable.cpp.

References m_LookupTable.

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::LookupTable::RequestedRegionIsOutsideOfTheBufferedRegion ( )
override

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

Definition at line 292 of file mitkLookupTable.cpp.

◆ 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.

Definition at line 306 of file mitkLookupTable.cpp.

◆ 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.

Definition at line 288 of file mitkLookupTable.cpp.

◆ SetTableValue()

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.

Definition at line 211 of file mitkLookupTable.cpp.

References GetVtkLookupTable().

Referenced by mitk::GizmoInteractor::SetManipulatedObjectNode().

◆ SetType() [1/2]

◆ SetType() [2/2]

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.

Definition at line 140 of file mitkLookupTable.cpp.

References SetType(), and typenameList.

◆ SetVtkLookupTable()

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

SetVtkLookupTable Setter for the internal lookuptable.

Parameters
lutThe lookuptable.

Definition at line 72 of file mitkLookupTable.cpp.

References m_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.

Definition at line 280 of file mitkLookupTable.cpp.

◆ 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.

Definition at line 297 of file mitkLookupTable.cpp.

Member Data Documentation

◆ m_Level

float mitk::LookupTable::m_Level
protected

Definition at line 264 of file mitkLookupTable.h.

Referenced by BuildPET20LookupTable(), and BuildPETColorLookupTable().

◆ m_LookupTable

◆ m_Opacity

float mitk::LookupTable::m_Opacity
protected

Definition at line 265 of file mitkLookupTable.h.

◆ m_Type

LookupTableType mitk::LookupTable::m_Type
protected

Definition at line 267 of file mitkLookupTable.h.

Referenced by GetActiveType(), GetActiveTypeAsString(), and SetType().

◆ m_Window

float mitk::LookupTable::m_Window
protected

Definition at line 263 of file mitkLookupTable.h.

Referenced by BuildPET20LookupTable(), and BuildPETColorLookupTable().

◆ typenameList

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

Definition at line 216 of file mitkLookupTable.h.

Referenced by GetActiveTypeAsString(), and SetType().


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