Medical Imaging Interaction Toolkit  2016.11.0
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, 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...
 
virtual void UpdateOutputInformation () override
 
virtual void SetRequestedRegionToLargestPossibleRegion () override
 
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 
virtual bool VerifyRequestedRegion () override
 
virtual void SetRequestedRegion (const itk::DataObject *data) override
 
 LookupTable ()
 
virtual ~LookupTable ()
 
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 const std::string GetActiveTypeAsString ()
 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 const char *const 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 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 46 of file mitkLookupTable.h.

Member Typedef Documentation

Definition at line 54 of file mitkLookupTable.h.

RawLookupTableType raw lookuptable typedef for convenience.

Definition at line 52 of file mitkLookupTable.h.

Definition at line 54 of file mitkLookupTable.h.

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

Definition at line 54 of file mitkLookupTable.h.

Member Enumeration Documentation

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 
LEGACY_BINARY 
LEGACY_RAINBOW_COLOR 
MULTILABEL 
PET_COLOR 
PET_20 

Definition at line 200 of file mitkLookupTable.h.

Constructor & Destructor Documentation

mitk::LookupTable::LookupTable ( )

Definition at line 43 of file mitkLookupTable.cpp.

References BuildGrayScaleLookupTable(), m_LookupTable, and mitk::New().

mitk::LookupTable::~LookupTable ( )
virtual

Definition at line 55 of file mitkLookupTable.cpp.

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

Definition at line 49 of file mitkLookupTable.cpp.

References m_LookupTable.

Member Function Documentation

void mitk::LookupTable::BuildGrayScaleLookupTable ( )
protectedvirtual

Definition at line 393 of file mitkLookupTable.cpp.

References mitk::New().

Referenced by LookupTable().

void mitk::LookupTable::BuildHotIronLookupTable ( )
protectedvirtual

Definition at line 434 of file mitkLookupTable.cpp.

References HotIron, and mitk::New().

void mitk::LookupTable::BuildInverseGrayScaleLookupTable ( )
protectedvirtual

Definition at line 420 of file mitkLookupTable.cpp.

References mitk::New().

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

Definition at line 450 of file mitkLookupTable.cpp.

References Jet, and mitk::New().

void mitk::LookupTable::BuildLegacyBinaryLookupTable ( )
protectedvirtual

Definition at line 406 of file mitkLookupTable.cpp.

References mitk::New().

void mitk::LookupTable::BuildLegacyRainbowColorLookupTable ( )
protectedvirtual

Definition at line 572 of file mitkLookupTable.cpp.

References mitk::New().

void mitk::LookupTable::BuildMultiLabelLookupTable ( )
protectedvirtual

Definition at line 506 of file mitkLookupTable.cpp.

References mitk::New().

void mitk::LookupTable::BuildPET20LookupTable ( )
protectedvirtual

Definition at line 490 of file mitkLookupTable.cpp.

References mitk::New(), and PET20.

void mitk::LookupTable::BuildPETColorLookupTable ( )
protectedvirtual

Definition at line 473 of file mitkLookupTable.cpp.

References mitk::New(), and PETColor.

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 152 of file mitkLookupTable.cpp.

References MITK_INFO.

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 136 of file mitkLookupTable.cpp.

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

Definition at line 319 of file mitkLookupTable.cpp.

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

Definition at line 291 of file mitkLookupTable.cpp.

References mitk::New().

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

Definition at line 375 of file mitkLookupTable.cpp.

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

Definition at line 352 of file mitkLookupTable.cpp.

References mitk::New().

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

Definition at line 347 of file mitkLookupTable.cpp.

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

Definition at line 324 of file mitkLookupTable.cpp.

References mitk::New().

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

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

Definition at line 131 of file mitkLookupTable.cpp.

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

Definition at line 54 of file mitkLookupTable.h.

virtual const char* mitk::LookupTable::GetClassName ( ) const
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.

Definition at line 171 of file mitkLookupTable.cpp.

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

GetRawLookupTable Getter for the raw lookuptable array.

Definition at line 191 of file mitkLookupTable.cpp.

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

Definition at line 54 of file mitkLookupTable.h.

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 176 of file mitkLookupTable.cpp.

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

GetVtkLookupTable Getter for the internally wrapped vtkLookupTable.

Definition at line 186 of file mitkLookupTable.cpp.

Referenced by operator=(), and operator==().

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

non equality operator implementation

un-equality operator implementation

Definition at line 238 of file mitkLookupTable.cpp.

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

implementation necessary because operator made private in itk::Object

assignment operator implementation

Reimplemented in mitk::LabeledImageLookupTable.

Definition at line 246 of file mitkLookupTable.cpp.

References GetVtkLookupTable().

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

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

equality operator implementation

equality operator inplementation

Definition at line 199 of file mitkLookupTable.cpp.

References GetVtkLookupTable().

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

Definition at line 380 of file mitkLookupTable.cpp.

bool mitk::LookupTable::RequestedRegionIsOutsideOfTheBufferedRegion ( )
overridevirtual

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

Definition at line 271 of file mitkLookupTable.cpp.

virtual void mitk::LookupTable::SetLevel ( float  _arg)
virtual
virtual void mitk::LookupTable::SetOpacity ( float  _arg)
virtual
void mitk::LookupTable::SetRequestedRegion ( const itk::DataObject *  data)
overridevirtual

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

Definition at line 285 of file mitkLookupTable.cpp.

void mitk::LookupTable::SetRequestedRegionToLargestPossibleRegion ( )
overridevirtual

Sets the requested Region to the largest possible region. This method is not implemented, since this is the default behaviour of the itk pipeline and we do not support the requested-region mechanism for lookup-tables

Definition at line 267 of file mitkLookupTable.cpp.

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 181 of file mitkLookupTable.cpp.

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.

Definition at line 70 of file mitkLookupTable.cpp.

References GRAYSCALE, HOT_IRON, INVERSE_GRAYSCALE, JET, JET_TRANSPARENT, LEGACY_BINARY, LEGACY_RAINBOW_COLOR, MITK_ERROR, MULTILABEL, PET_20, and PET_COLOR.

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 115 of file mitkLookupTable.cpp.

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

SetVtkLookupTable Setter for the internal lookuptable.

Parameters
lutThe lookuptable.

Definition at line 59 of file mitkLookupTable.cpp.

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

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

Definition at line 259 of file mitkLookupTable.cpp.

bool mitk::LookupTable::VerifyRequestedRegion ( )
overridevirtual

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 276 of file mitkLookupTable.cpp.

Member Data Documentation

float mitk::LookupTable::m_Level
protected

Definition at line 254 of file mitkLookupTable.h.

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

Definition at line 256 of file mitkLookupTable.h.

LookupTableType mitk::LookupTable::m_type
protected

Definition at line 258 of file mitkLookupTable.h.

float mitk::LookupTable::m_Window
protected

Definition at line 252 of file mitkLookupTable.h.

const char *const mitk::LookupTable::typenameList
static

Definition at line 214 of file mitkLookupTable.h.


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