SimpleITK  2.1.0.dev86
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::ScalarToRGBColormapImageFilter Class Reference

Implements pixel-wise intensity->rgb mapping operation on one image. More...

#include <sitkScalarToRGBColormapImageFilter.h>

+ Inheritance diagram for itk::simple::ScalarToRGBColormapImageFilter:
+ Collaboration diagram for itk::simple::ScalarToRGBColormapImageFilter:

Public Types

enum  ColormapType {
  Red,
  Green,
  Blue,
  Grey,
  Hot,
  Cool,
  Spring,
  Summer,
  Autumn,
  Winter,
  Copper,
  Jet,
  HSV,
  OverUnder
}
 
using PixelIDTypeList = BasicPixelIDTypeList
 
using Self = ScalarToRGBColormapImageFilter
 
- Public Types inherited from itk::simple::ImageFilter
using Self = ImageFilter
 
- Public Types inherited from itk::simple::ProcessObject
using Self = ProcessObject
 

Public Member Functions

Image Execute (const Image &image1)
 
ColormapType GetColormap () const
 
std::string GetName () const
 
bool GetUseInputImageExtremaForScaling () const
 
 ScalarToRGBColormapImageFilter ()
 
SelfSetColormap (ColormapType Colormap)
 
SelfSetUseInputImageExtremaForScaling (bool UseInputImageExtremaForScaling)
 
std::string ToString () const
 
SelfUseInputImageExtremaForScalingOff ()
 
SelfUseInputImageExtremaForScalingOn ()
 
virtual ~ScalarToRGBColormapImageFilter ()
 
- Public Member Functions inherited from itk::simple::ImageFilter
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
virtual int AddCommand (itk::simple::EventEnum event, const std::function< void()> &func)
 Directly add a callback to observe an event. More...
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event. More...
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution. More...
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event. More...
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands. More...
 
virtual ~ProcessObject ()
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
virtual bool GetDebug () const
 
virtual void SetDebug (bool debugFlag)
 
virtual void SetNumberOfThreads (unsigned int n)
 
virtual unsigned int GetNumberOfThreads () const
 
virtual void SetNumberOfWorkUnits (unsigned int n)
 
virtual unsigned int GetNumberOfWorkUnits () const
 

Private Types

using MemberFunctionType = Image(Self::*)(const Image &image1)
 

Private Member Functions

template<class TImageType >
Image ExecuteInternal (const Image &image1)
 

Private Attributes

ColormapType m_Colormap {itk::simple::ScalarToRGBColormapImageFilter::Grey}
 
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
bool m_UseInputImageExtremaForScaling {true}
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ProcessObject
static bool GetGlobalDefaultDebug ()
 
static void GlobalDefaultDebugOff ()
 
static void GlobalDefaultDebugOn ()
 
static void SetGlobalDefaultDebug (bool debugFlag)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static double GetGlobalDefaultCoordinateTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects. More...
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects. More...
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects. More...
 
- Protected Member Functions inherited from itk::simple::ImageFilter
void CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name)
 
- Protected Member Functions inherited from itk::simple::ProcessObject
virtual unsigned long AddITKObserver (const itk::EventObject &, itk::Command *)
 
virtual itk::ProcessObjectGetActiveProcess ()
 
virtual void OnActiveProcessDelete ()
 
virtual void onCommandDelete (const itk::simple::Command *cmd) noexcept
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter
template<class TImageType >
static void FixNonZeroIndex (TImageType *img)
 
- Static Protected Member Functions inherited from itk::simple::ProcessObject
template<class TImageType >
static TImageType::ConstPointer CastImageToITK (const Image &img)
 
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img)
 
template<class TImageType >
static Image CastITKToImage (TImageType *img)
 
static const itk::EventObjectGetITKEventObject (EventEnum e)
 
template<typename T >
static std::ostream & ToStringHelper (std::ostream &os, const T &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const signed char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const unsigned char &v)
 

Detailed Description

Implements pixel-wise intensity->rgb mapping operation on one image.

This class is parameterized over the type of the input image and the type of the output image.

The input image's scalar pixel values are mapped into a color map. The color map is specified by passing the SetColormap function one of the predefined maps. The following selects the "RGBColormapFilterEnum::Hot" colormap:

RGBFilterType::Pointer colormapImageFilter = RGBFilterType::New();
colormapImageFilter->SetColormap( RGBFilterType::Hot );

You can also specify a custom color map. This is done by creating a CustomColormapFunction, and then creating lists of values for the red, green, and blue channel. An example of setting the red channel of a colormap with only 2 colors is given below. The blue and green channels should be specified in the same manner.

// Create the custom colormap
using ColormapType = itk::Function::CustomColormapFunction<RealImageType::PixelType,
RGBImageType::PixelType>;
ColormapType::Pointer colormap = ColormapType::New();
// Setup the red channel of the colormap
ColormapType::ChannelType redChannel;
redChannel.push_back(0); redChannel.push_back(255);
colormap->SetRedChannel( channel );

The range of values present in the input image is the range that is mapped to the entire range of colors.

This code was contributed in the Insight Journal paper: "Meeting Andy Warhol Somewhere Over the Rainbow: RGB Colormapping and ITK" by Tustison N., Zhang H., Lehmann G., Yushkevich P., Gee J. https://hdl.handle.net/1926/1452 http://www.insight-journal.org/browse/publication/285

See also
BinaryFunctionImageFilter TernaryFunctionImageFilter
itk::simple::ScalarToRGBColormap for the procedural interface
itk::ScalarToRGBColormapImageFilter for the Doxygen on the original ITK class.

Definition at line 78 of file sitkScalarToRGBColormapImageFilter.h.

Member Typedef Documentation

◆ MemberFunctionType

Setup for member function dispatching

Definition at line 133 of file sitkScalarToRGBColormapImageFilter.h.

◆ PixelIDTypeList

Define the pixels types supported by this filter

Definition at line 90 of file sitkScalarToRGBColormapImageFilter.h.

◆ Self

Definition at line 80 of file sitkScalarToRGBColormapImageFilter.h.

Member Enumeration Documentation

◆ ColormapType

Enumerator
Red 
Green 
Blue 
Grey 
Hot 
Cool 
Spring 
Summer 
Autumn 
Winter 
Copper 
Jet 
HSV 
OverUnder 

Definition at line 93 of file sitkScalarToRGBColormapImageFilter.h.

Constructor & Destructor Documentation

◆ ~ScalarToRGBColormapImageFilter()

virtual itk::simple::ScalarToRGBColormapImageFilter::~ScalarToRGBColormapImageFilter ( )
virtual

Destructor

◆ ScalarToRGBColormapImageFilter()

itk::simple::ScalarToRGBColormapImageFilter::ScalarToRGBColormapImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ Execute()

Image itk::simple::ScalarToRGBColormapImageFilter::Execute ( const Image image1)

Execute the filter on the input image

◆ ExecuteInternal()

template<class TImageType >
Image itk::simple::ScalarToRGBColormapImageFilter::ExecuteInternal ( const Image image1)
private

◆ GetColormap()

ColormapType itk::simple::ScalarToRGBColormapImageFilter::GetColormap ( ) const
inline

Set/Get the colormap object.

Definition at line 102 of file sitkScalarToRGBColormapImageFilter.h.

◆ GetName()

std::string itk::simple::ScalarToRGBColormapImageFilter::GetName ( ) const
inlinevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 119 of file sitkScalarToRGBColormapImageFilter.h.

◆ GetUseInputImageExtremaForScaling()

bool itk::simple::ScalarToRGBColormapImageFilter::GetUseInputImageExtremaForScaling ( ) const
inline

Set/Get UseInputImageExtremaForScaling. If true, the colormap uses the min and max values from the image to scale appropriately. Otherwise, these values can be set in the colormap manually.

Definition at line 116 of file sitkScalarToRGBColormapImageFilter.h.

◆ SetColormap()

Self& itk::simple::ScalarToRGBColormapImageFilter::SetColormap ( ColormapType  Colormap)
inline

Definition at line 97 of file sitkScalarToRGBColormapImageFilter.h.

◆ SetUseInputImageExtremaForScaling()

Self& itk::simple::ScalarToRGBColormapImageFilter::SetUseInputImageExtremaForScaling ( bool  UseInputImageExtremaForScaling)
inline

Set/Get UseInputImageExtremaForScaling. If true, the colormap uses the min and max values from the image to scale appropriately. Otherwise, these values can be set in the colormap manually.

Definition at line 107 of file sitkScalarToRGBColormapImageFilter.h.

◆ ToString()

std::string itk::simple::ScalarToRGBColormapImageFilter::ToString ( ) const
virtual

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

◆ UseInputImageExtremaForScalingOff()

Self& itk::simple::ScalarToRGBColormapImageFilter::UseInputImageExtremaForScalingOff ( )
inline

Definition at line 111 of file sitkScalarToRGBColormapImageFilter.h.

◆ UseInputImageExtremaForScalingOn()

Self& itk::simple::ScalarToRGBColormapImageFilter::UseInputImageExtremaForScalingOn ( )
inline

Set the value of UseInputImageExtremaForScaling to true or false respectfully.

Definition at line 110 of file sitkScalarToRGBColormapImageFilter.h.

Friends And Related Function Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Definition at line 137 of file sitkScalarToRGBColormapImageFilter.h.

Member Data Documentation

◆ m_Colormap

ColormapType itk::simple::ScalarToRGBColormapImageFilter::m_Colormap {itk::simple::ScalarToRGBColormapImageFilter::Grey}
private

Definition at line 142 of file sitkScalarToRGBColormapImageFilter.h.

◆ m_MemberFactory

std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::ScalarToRGBColormapImageFilter::m_MemberFactory
private

Definition at line 139 of file sitkScalarToRGBColormapImageFilter.h.

◆ m_UseInputImageExtremaForScaling

bool itk::simple::ScalarToRGBColormapImageFilter::m_UseInputImageExtremaForScaling {true}
private

Definition at line 144 of file sitkScalarToRGBColormapImageFilter.h.


The documentation for this class was generated from the following file:
itk::simple::ScalarToRGBColormapImageFilter::ColormapType
ColormapType
Definition: sitkScalarToRGBColormapImageFilter.h:93
itk::Function::CustomColormapFunction