ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkScalarToRGBColormapImageFilter.h>
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
Definition at line 77 of file itkScalarToRGBColormapImageFilter.h.
typedef Function::ColormapFunction< InputImagePixelType, OutputImagePixelType > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ColormapType |
Definition at line 104 of file itkScalarToRGBColormapImageFilter.h.
typedef SmartPointer< const Self > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ConstPointer |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 85 of file itkScalarToRGBColormapImageFilter.h.
typedef InputImageType::PixelType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImagePixelType |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 97 of file itkScalarToRGBColormapImageFilter.h.
typedef InputImageType::ConstPointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImagePointer |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 95 of file itkScalarToRGBColormapImageFilter.h.
typedef InputImageType::RegionType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImageRegionType |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 96 of file itkScalarToRGBColormapImageFilter.h.
typedef TInputImage itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::InputImageType |
Some typedefs.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 91 of file itkScalarToRGBColormapImageFilter.h.
typedef OutputImageType::PixelType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImagePixelType |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 101 of file itkScalarToRGBColormapImageFilter.h.
typedef OutputImageType::Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImagePointer |
Reimplemented from itk::ImageSource< TOutputImage >.
Definition at line 99 of file itkScalarToRGBColormapImageFilter.h.
typedef OutputImageType::RegionType itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImageRegionType |
Superclass typedefs.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 100 of file itkScalarToRGBColormapImageFilter.h.
typedef TOutputImage itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::OutputImageType |
Some convenient typedefs.
Reimplemented from itk::ImageSource< TOutputImage >.
Definition at line 98 of file itkScalarToRGBColormapImageFilter.h.
typedef SmartPointer< Self > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::Pointer |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 84 of file itkScalarToRGBColormapImageFilter.h.
typedef ScalarToRGBColormapImageFilter itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::Self |
Standard class typedefs.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 82 of file itkScalarToRGBColormapImageFilter.h.
typedef ImageToImageFilter< TInputImage, TOutputImage > itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::Superclass |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Definition at line 83 of file itkScalarToRGBColormapImageFilter.h.
enum itk::ScalarToRGBColormapImageFilter::ColormapEnumType |
Enum type that provides for an easy interface to existing colormaps.
Definition at line 116 of file itkScalarToRGBColormapImageFilter.h.
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.
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.
itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::ScalarToRGBColormapImageFilter | ( | const Self & | ) | [private] |
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::BeforeThreadedGenerateData | ( | ) | [protected, virtual] |
Process to execute before entering the multithreaded section
Reimplemented from itk::ImageSource< 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.
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.
virtual ColormapType* itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::GetColormap | ( | ) | [virtual] |
Set/Get the colormap object.
virtual const char* itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::GetNameOfClass | ( | ) | const [virtual] |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageFilter< TInputImage, 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.
static Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::New | ( | ) | [static] |
Method for creation through the object factory.
Reimplemented from itk::Object.
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 >.
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 >.
virtual void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::SetColormap | ( | ColormapType * | _arg | ) | [virtual] |
Set/Get the colormap object.
void itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::SetColormap | ( | ColormapEnumType | ) |
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.
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"
Reimplemented from itk::ImageSource< 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.
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.
ColormapType::Pointer itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::m_Colormap [private] |
Definition at line 175 of file itkScalarToRGBColormapImageFilter.h.
bool itk::ScalarToRGBColormapImageFilter< TInputImage, TOutputImage >::m_UseInputImageExtremaForScaling [private] |
Definition at line 177 of file itkScalarToRGBColormapImageFilter.h.