ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
itk::ColorTable< TComponent > Class Template Reference

#include <itkColorTable.h>

Detailed Description

template<typename TComponent>
class itk::ColorTable< TComponent >

Define a color table for image visualisation.

Generates color lookup tables of various types. The lookup table value range differs for integral and continuous data types. Consult the documentation for each lookup table generator.

Definition at line 40 of file itkColorTable.h.

+ Inheritance diagram for itk::ColorTable< TComponent >:
+ Collaboration diagram for itk::ColorTable< TComponent >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = ColorTable
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

unsigned int GetClosestColorTableId (TComponent r, TComponent g, TComponent b)
 
RGBPixel< TComponent > GetColor (unsigned int c)
 
TComponent GetColorComponent (unsigned int c, char rgb)
 
std::string GetColorName (unsigned int c)
 
const char * GetNameOfClass () const override
 
virtual unsigned int GetNumberOfColors () const
 
void UseDiscreteColors ()
 
void UseGrayColors (unsigned int n=256)
 
void UseHeatColors (unsigned int n=256)
 
void UseRandomColors (unsigned int n=256)
 
bool SetColor (unsigned int c, TComponent r, TComponent g, TComponent b, const char *name="UserDefined")
 
bool SetColor (unsigned int c, RGBPixel< TComponent > pixel, const char *name="UserDefined")
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
const char * GetNameOfClass () const override
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual Pointer CreateAnother () const
 
virtual void Delete ()
 
virtual const char * GetNameOfClass () const
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 
virtual void Register () const
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const noexcept
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 ColorTable ()=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Types

using ColorNameVectorType = std::vector< std::string >
 
using ColorVectorType = std::vector< RGBPixel< TComponent > >
 

Private Member Functions

void DeleteColors ()
 

Private Attributes

ColorVectorType m_Color {}
 
ColorNameVectorType m_ColorName {}
 
unsigned int m_NumberOfColors { 0 }
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ColorNameVectorType

template<typename TComponent >
using itk::ColorTable< TComponent >::ColorNameVectorType = std::vector<std::string>
private

Definition at line 126 of file itkColorTable.h.

◆ ColorVectorType

template<typename TComponent >
using itk::ColorTable< TComponent >::ColorVectorType = std::vector<RGBPixel<TComponent> >
private

Definition at line 127 of file itkColorTable.h.

◆ ConstPointer

template<typename TComponent >
using itk::ColorTable< TComponent >::ConstPointer = SmartPointer<const Self>

Definition at line 49 of file itkColorTable.h.

◆ Pointer

template<typename TComponent >
using itk::ColorTable< TComponent >::Pointer = SmartPointer<Self>

Definition at line 48 of file itkColorTable.h.

◆ Self

template<typename TComponent >
using itk::ColorTable< TComponent >::Self = ColorTable

Standard class type aliases.

Definition at line 46 of file itkColorTable.h.

◆ Superclass

template<typename TComponent >
using itk::ColorTable< TComponent >::Superclass = Object

Definition at line 47 of file itkColorTable.h.

Constructor & Destructor Documentation

◆ ColorTable()

template<typename TComponent >
itk::ColorTable< TComponent >::ColorTable ( )
protecteddefault

Member Function Documentation

◆ DeleteColors()

template<typename TComponent >
void itk::ColorTable< TComponent >::DeleteColors ( )
private

◆ GetClosestColorTableId()

template<typename TComponent >
unsigned int itk::ColorTable< TComponent >::GetClosestColorTableId ( TComponent  r,
TComponent  g,
TComponent  b 
)

Find the color closest to a given pixel. Uses a L2 distance metric.

◆ GetColor()

template<typename TComponent >
RGBPixel< TComponent > itk::ColorTable< TComponent >::GetColor ( unsigned int  c)

Get the color stored at a given index.

◆ GetColorComponent()

template<typename TComponent >
TComponent itk::ColorTable< TComponent >::GetColorComponent ( unsigned int  c,
char  rgb 
)

Given the position in the table and the color returns the value.

◆ GetColorName()

template<typename TComponent >
std::string itk::ColorTable< TComponent >::GetColorName ( unsigned int  c)

Get the name of the color at a given index.

◆ GetNameOfClass()

template<typename TComponent >
const char * itk::ColorTable< TComponent >::GetNameOfClass ( ) const
overridevirtual
See also
LightObject::GetNameOfClass()

Reimplemented from itk::LightObject.

◆ GetNumberOfColors()

template<typename TComponent >
virtual unsigned int itk::ColorTable< TComponent >::GetNumberOfColors ( ) const
virtual

Get the number of colors in the lookup table.

◆ New()

template<typename TComponent >
static Pointer itk::ColorTable< TComponent >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<typename TComponent >
void itk::ColorTable< TComponent >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::LightObject.

◆ SetColor() [1/2]

template<typename TComponent >
bool itk::ColorTable< TComponent >::SetColor ( unsigned int  c,
RGBPixel< TComponent >  pixel,
const char *  name = "UserDefined" 
)

Set the color at a given index. Optionally provide a name for the color. If a name is not provided, the name "UserDefined" is used.

◆ SetColor() [2/2]

template<typename TComponent >
bool itk::ColorTable< TComponent >::SetColor ( unsigned int  c,
TComponent  r,
TComponent  g,
TComponent  b,
const char *  name = "UserDefined" 
)

Set the color at a given index. Optionally provide a name for the color. If a name is not provided, the name "UserDefined" is used.

◆ UseDiscreteColors()

template<typename TComponent >
void itk::ColorTable< TComponent >::UseDiscreteColors ( )

Generate a lookup table of 8 discrete colors. The colors are Red, Purple, Aqua, Yellow, Green, Blue, Grey0.70, White. For integral pixel types, the color range is between NonpositiveMin() and max(). For continuous types, the range is 0.0 to 1.0.

◆ UseGrayColors()

template<typename TComponent >
void itk::ColorTable< TComponent >::UseGrayColors ( unsigned int  n = 256)

Generate a lookup table of n grayscale values. For integral pixel types, a ramp is generated from NonpositiveMin() to max() of the pixel type. For continuous pixel types, the range is 0.0 to 1.0.

◆ UseHeatColors()

template<typename TComponent >
void itk::ColorTable< TComponent >::UseHeatColors ( unsigned int  n = 256)

Generate a lookup table of n values good for showing "temperatures". For integral pixel types, the color range is between NonpositiveMin() and max(). For continuous types, the range is 0.0 to 1.0.

◆ UseRandomColors()

template<typename TComponent >
void itk::ColorTable< TComponent >::UseRandomColors ( unsigned int  n = 256)

Generate a lookup table of n random values. For integral pixel types, the color range is between NonpositiveMin() and max(). For continuous types, the range is 0.0 to 1.0.

Member Data Documentation

◆ m_Color

template<typename TComponent >
ColorVectorType itk::ColorTable< TComponent >::m_Color {}
private

Definition at line 135 of file itkColorTable.h.

◆ m_ColorName

template<typename TComponent >
ColorNameVectorType itk::ColorTable< TComponent >::m_ColorName {}
private

Definition at line 134 of file itkColorTable.h.

◆ m_NumberOfColors

template<typename TComponent >
unsigned int itk::ColorTable< TComponent >::m_NumberOfColors { 0 }
private

Definition at line 132 of file itkColorTable.h.


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