ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | List of all members
itk::ColorTable< TPixel > Class Template Reference

#include <itkColorTable.h>

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

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

virtual ::itk::LightObject::Pointer CreateAnother () const
 
RGBPixel< TPixel > GetColor (unsigned int c)
 
virtual const char * GetNameOfClass () const
 
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)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) 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
 
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)
 
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 void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

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 ()
 
using ColorNameVectorType = std::vector< std::string >
 
using ColorVectorType = std::vector< RGBPixel< TPixel > >
 
unsigned int m_NumberOfColors { 0 }
 
ColorNameVectorType m_ColorName
 
ColorVectorType m_Color
 
bool SetColor (unsigned int c, TPixel r, TPixel g, TPixel b, const char *name="UserDefined")
 
bool SetColor (unsigned int c, RGBPixel< TPixel > pixel, const char *name="UserDefined")
 
TPixel GetColorComponent (unsigned int c, char rgb)
 
std::string GetColorName (unsigned int c)
 
unsigned int GetClosestColorTableId (TPixel r, TPixel g, TPixel b)
 
 ColorTable ()=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void DeleteColors ()
 

Additional Inherited Members

- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

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

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.

Member Typedef Documentation

◆ ColorNameVectorType

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

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.

Definition at line 126 of file itkColorTable.h.

◆ ColorVectorType

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

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.

Definition at line 127 of file itkColorTable.h.

◆ ConstPointer

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

Definition at line 49 of file itkColorTable.h.

◆ Pointer

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

Definition at line 48 of file itkColorTable.h.

◆ Self

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

Standard class type aliases.

Definition at line 46 of file itkColorTable.h.

◆ Superclass

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

Definition at line 47 of file itkColorTable.h.

Constructor & Destructor Documentation

◆ ColorTable()

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

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.

Member Function Documentation

◆ CreateAnother()

template<typename TPixel >
virtual::itk::LightObject::Pointer itk::ColorTable< TPixel >::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightObject.

◆ DeleteColors()

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

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.

◆ GetClosestColorTableId()

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

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

◆ GetColor()

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

Get the color stored at a given index.

◆ GetColorComponent()

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

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

◆ GetColorName()

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

Get the name of the color at a given index.

◆ GetNameOfClass()

template<typename TPixel >
virtual const char* itk::ColorTable< TPixel >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

◆ GetNumberOfColors()

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

Get the number of colors in the lookup table.

◆ New()

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

Method for creation through the object factory.

◆ PrintSelf()

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

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.

Reimplemented from itk::LightObject.

◆ SetColor() [1/2]

template<typename TPixel >
bool itk::ColorTable< TPixel >::SetColor ( unsigned int  c,
RGBPixel< TPixel >  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 TPixel >
bool itk::ColorTable< TPixel >::SetColor ( unsigned int  c,
TPixel  r,
TPixel  g,
TPixel  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 TPixel >
void itk::ColorTable< TPixel >::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 TPixel >
void itk::ColorTable< TPixel >::UseGrayColors ( unsigned int  n = 256)

Generate a lookuptable 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 TPixel >
void itk::ColorTable< TPixel >::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 TPixel >
void itk::ColorTable< TPixel >::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 TPixel >
ColorVectorType itk::ColorTable< TPixel >::m_Color
private

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.

Definition at line 135 of file itkColorTable.h.

◆ m_ColorName

template<typename TPixel >
ColorNameVectorType itk::ColorTable< TPixel >::m_ColorName
private

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.

Definition at line 134 of file itkColorTable.h.

◆ m_NumberOfColors

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

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.

Definition at line 132 of file itkColorTable.h.


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