ITK  4.1.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage > Class Template Reference

#include <itkScalarToRGBColormapImageFilter.h>

+ Inheritance diagram for itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >:
+ Collaboration diagram for itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >:

List of all members.

Public Types

enum  ColormapEnumType {
  Red,
  Green,
  Blue,
  Grey,
  Hot,
  Cool,
  Spring,
  Summer,
  Autumn,
  Winter,
  Copper,
  Jet,
  HSV,
  OverUnder
}
typedef
Function::ColormapFunction
< InputImagePixelType,
OutputImagePixelType
ColormapType
typedef SmartPointer< const SelfConstPointer
typedef InputImageType::PixelType InputImagePixelType
typedef
InputImageType::ConstPointer 
InputImagePointer
typedef InputImageType::RegionType InputImageRegionType
typedef TInputImage InputImageType
typedef OutputImageType::PixelType OutputImagePixelType
typedef OutputImageType::Pointer OutputImagePointer
typedef OutputImageType::RegionType OutputImageRegionType
typedef TOutputImage OutputImageType
typedef SmartPointer< SelfPointer
typedef
ScalarToRGBColormapImageFilter 
Self
typedef ImageToImageFilter
< TInputImage, TOutputImage > 
Superclass

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual const char * GetNameOfClass () const
void SetColormap (ColormapEnumType)
virtual void SetColormap (ColormapType *_arg)
virtual ColormapTypeGetColormap ()

Static Public Member Functions

static Pointer New ()

Protected Member Functions

void BeforeThreadedGenerateData ()
virtual void GenerateOutputInformation ()
void PrintSelf (std::ostream &os, Indent indent) const
void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)

Private Member Functions

void operator= (const Self &)
 ScalarToRGBColormapImageFilter (const Self &)

Private Attributes

ColormapType::Pointer m_Colormap
bool m_UseInputImageExtremaForScaling
virtual void SetUseInputImageExtremaForScaling (bool _arg)
virtual bool GetUseInputImageExtremaForScaling () const
virtual void UseInputImageExtremaForScalingOn ()
virtual void UseInputImageExtremaForScalingOff ()
 ScalarToRGBColormapImageFilter ()
virtual ~ScalarToRGBColormapImageFilter ()

Detailed Description

template<class TInputImage, class TOutputImage>
class itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >

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 "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
 typedef itk::Function::CustomColormapFunction<RealImageType::PixelType,
 RGBImageType::PixelType> ColormapType;
 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. http://hdl.handle.net/1926/1452 http://www.insight-journal.org/browse/publication/285

See also:
BinaryFunctionImageFilter TernaryFunctionImageFilter
Wiki Examples:

Definition at line 77 of file itkScalarToRGBColormapImageFilter.h.


Member Typedef Documentation

template<class TInputImage , class TOutputImage >
typedef Function::ColormapFunction< InputImagePixelType, OutputImagePixelType > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ColormapType

Definition at line 104 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef SmartPointer< const Self > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ConstPointer
template<class TInputImage , class TOutputImage >
typedef InputImageType::PixelType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImagePixelType
template<class TInputImage , class TOutputImage >
typedef InputImageType::ConstPointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImagePointer
template<class TInputImage , class TOutputImage >
typedef InputImageType::RegionType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImageRegionType
template<class TInputImage , class TOutputImage >
typedef TInputImage itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImageType

Some typedefs.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Definition at line 91 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef OutputImageType::PixelType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImagePixelType
template<class TInputImage , class TOutputImage >
typedef OutputImageType::Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImagePointer

Reimplemented from itk::ImageSource< TOutputImage >.

Definition at line 99 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef OutputImageType::RegionType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImageRegionType

Superclass typedefs.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Definition at line 100 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef TOutputImage itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImageType

Some convenient typedefs.

Reimplemented from itk::ImageSource< TOutputImage >.

Definition at line 98 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef SmartPointer< Self > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::Pointer
template<class TInputImage , class TOutputImage >
typedef ScalarToRGBColormapImageFilter itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::Self

Standard class typedefs.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

Definition at line 82 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::Superclass

Member Enumeration Documentation

template<class TInputImage , class TOutputImage >
enum itk::ScalarToRGBColormapImageFilter::ColormapEnumType

Enum type that provides for an easy interface to existing colormaps.

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

Definition at line 116 of file itkScalarToRGBColormapImageFilter.h.


Constructor & Destructor Documentation

template<class TInputImage , class TOutputImage >
itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ScalarToRGBColormapImageFilter ( ) [protected]

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.

template<class TInputImage , class TOutputImage >
virtual itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::~ScalarToRGBColormapImageFilter ( ) [inline, protected, virtual]

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 131 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ScalarToRGBColormapImageFilter ( const Self ) [private]

Member Function Documentation

template<class TInputImage , class TOutputImage >
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::BeforeThreadedGenerateData ( ) [protected, virtual]

Process to execute before entering the multithreaded section

Reimplemented from itk::ImageSource< TOutputImage >.

template<class TInputImage , class TOutputImage >
virtual::itk::LightObject::Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::CreateAnother ( void  ) 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::Object.

template<class TInputImage , class TOutputImage >
virtual void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::GenerateOutputInformation ( ) [inline, protected, virtual]

Generate the information decribing the output data. The default implementation of this method will copy information from the input to the output. A filter may override this method if its output will have different information than its input. For instance, a filter that shrinks an image will need to provide an implementation for this method that changes the spacing of the pixels. Such filters should call their superclass' implementation of this method prior to changing the information values they need (i.e. GenerateOutputInformation() should call Superclass::GenerateOutputInformation() prior to changing the information.

Reimplemented from itk::ProcessObject.

Definition at line 136 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
virtual ColormapType* itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::GetColormap ( ) [virtual]

Set/Get the colormap object.

template<class TInputImage , class TOutputImage >
virtual const char* itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::GetNameOfClass ( ) const [virtual]

Run-time type information (and related methods).

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

template<class TInputImage , class TOutputImage >
virtual bool itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::GetUseInputImageExtremaForScaling ( ) const [virtual]

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.

template<class TInputImage , class TOutputImage >
static Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::New ( ) [static]

Method for creation through the object factory.

Reimplemented from itk::Object.

template<class TInputImage , class TOutputImage >
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::operator= ( const Self ) [private]

PushBackInput(), PushFronInput() in the public section force the input to be the type expected by an ImageToImageFilter. However, these methods end of "hiding" the versions from the superclass (ProcessObject) whose arguments are DataObjects. Here, we re-expose the versions from ProcessObject to avoid warnings about hiding methods from the superclass.

Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.

template<class TInputImage , class TOutputImage >
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

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::ImageToImageFilter< TInputImage, TOutputImage >.

template<class TInputImage , class TOutputImage >
virtual void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::SetColormap ( ColormapType _arg) [virtual]

Set/Get the colormap object.

template<class TInputImage , class TOutputImage >
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::SetColormap ( ColormapEnumType  )
template<class TInputImage , class TOutputImage >
virtual void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::SetUseInputImageExtremaForScaling ( bool  _arg) [virtual]

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.

template<class TInputImage , class TOutputImage >
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData ( const OutputImageRegionType outputRegionForThread,
ThreadIdType  threadId 
) [protected, virtual]

ScalarToRGBColormapImageFilter can be implemented as a multithreaded filter. Therefore, this implementation provides a ThreadedGenerateData() routine which is called for each processing thread. The output image data is allocated automatically by the superclass prior to calling ThreadedGenerateData(). ThreadedGenerateData can only write to the portion of the output image specified by the parameter "outputRegionForThread"

See also:
ImageToImageFilter::ThreadedGenerateData(), ImageToImageFilter::GenerateData()

Reimplemented from itk::ImageSource< TOutputImage >.

template<class TInputImage , class TOutputImage >
virtual void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::UseInputImageExtremaForScalingOff ( ) [virtual]

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.

template<class TInputImage , class TOutputImage >
virtual void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::UseInputImageExtremaForScalingOn ( ) [virtual]

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.


Member Data Documentation

template<class TInputImage , class TOutputImage >
ColormapType::Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::m_Colormap [private]

Definition at line 175 of file itkScalarToRGBColormapImageFilter.h.

template<class TInputImage , class TOutputImage >
bool itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::m_UseInputImageExtremaForScaling [private]

Definition at line 177 of file itkScalarToRGBColormapImageFilter.h.


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