Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction > Class Template Reference

Perform a generic pixel-wise, index-aware operation on an input image to produce an output image. More...

#include <itkIndexedUnaryFunctorImageFilter.h>

Inheritance diagram for itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >:
Collaboration diagram for itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >:

Public Types

typedef IndexedUnaryFunctorImageFilter Self
 Standard class typedefs. More...
 
typedef InPlaceImageFilter< TInputImage, TOutputImage > Superclass
 
typedef SmartPointer< Self > Pointer
 
typedef SmartPointer< const Self > ConstPointer
 
typedef TFunction FunctorType
 Type of the functor used for the pixel-wise operation. More...
 
typedef TInputImage InputImageType
 Input image type. More...
 
typedef InputImageType::ConstPointer InputImagePointer
 Input image const pointer type. More...
 
typedef InputImageType::RegionType InputImageRegionType
 Input image region type. More...
 
typedef InputImageType::PixelType InputImagePixelType
 Input pixel type. More...
 
typedef TOutputImage OutputImageType
 Output image type. More...
 
typedef OutputImageType::Pointer OutputImagePointer
 Output image pointer type. More...
 
typedef OutputImageType::RegionType OutputImageRegionType
 Output image region type. More...
 
typedef OutputImageType::PixelType OutputImagePixelType
 Output pixel type. More...
 

Public Member Functions

virtual const char * GetClassName () const
 Run-time type information (and related methods). More...
 
FunctorType & GetFunctor ()
 Get a mutable reference to the functor object. More...
 
const FunctorType & GetFunctor () const
 Get a const reference to the functor object. More...
 
void SetFunctor (const FunctorType &functor)
 Set the functor object. More...
 

Static Public Member Functions

static Pointer New ()
 Method for creation through the object factory. More...
 

Protected Member Functions

 IndexedUnaryFunctorImageFilter ()
 
virtual ~IndexedUnaryFunctorImageFilter ()
 
void GenerateOutputInformation () override
 
void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
 

Detailed Description

template<typename TInputImage, typename TOutputImage, typename TFunction>
class itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >

Perform a generic pixel-wise, index-aware operation on an input image to produce an output image.

This filter is similar to itk::UnaryFunctorImageFilter, but it passes both the pixel value and its image index to the functor. This is useful for operations where the spatial position of a pixel within the image is relevant for computing the output (e.g., spatially varying decay correction in PET SUV calculations).

Why a custom filter?

No upstream ITK filter exposes "(pixel value, image index) -> output pixel" directly. itk::UnaryFunctorImageFilter passes only the pixel value; itk::UnaryGeneratorImageFilter is region-based (functor signature is (input, region, threadId, ProgressReporter)) and not pixel-based. Hand-rolling around itk::ImageRegionConstIteratorWithIndex / itk::ImageRegionIterator – which is what this filter does – is the standard way to close that gap.

Template Parameters
TInputImageType of the input image.
TOutputImageType of the output image.
TFunctionFunctor type. Must define operator()(const InputPixelType&, const IndexType&) and operator!=().

The functor is called for each pixel as:

output[index] = functor(input[index], index);
See also
itk::UnaryFunctorImageFilter, itk::UnaryGeneratorImageFilter, SUVFunctorPolicy

Definition at line 56 of file itkIndexedUnaryFunctorImageFilter.h.

Member Typedef Documentation

◆ ConstPointer

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef SmartPointer< const Self > itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::ConstPointer

Definition at line 63 of file itkIndexedUnaryFunctorImageFilter.h.

◆ FunctorType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef TFunction itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::FunctorType

Type of the functor used for the pixel-wise operation.

Definition at line 72 of file itkIndexedUnaryFunctorImageFilter.h.

◆ InputImagePixelType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef InputImageType::PixelType itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::InputImagePixelType

Input pixel type.

Definition at line 77 of file itkIndexedUnaryFunctorImageFilter.h.

◆ InputImagePointer

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef InputImageType::ConstPointer itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::InputImagePointer

Input image const pointer type.

Definition at line 75 of file itkIndexedUnaryFunctorImageFilter.h.

◆ InputImageRegionType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef InputImageType::RegionType itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::InputImageRegionType

Input image region type.

Definition at line 76 of file itkIndexedUnaryFunctorImageFilter.h.

◆ InputImageType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef TInputImage itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::InputImageType

Input image type.

Definition at line 74 of file itkIndexedUnaryFunctorImageFilter.h.

◆ OutputImagePixelType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef OutputImageType::PixelType itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::OutputImagePixelType

Output pixel type.

Definition at line 82 of file itkIndexedUnaryFunctorImageFilter.h.

◆ OutputImagePointer

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef OutputImageType::Pointer itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::OutputImagePointer

Output image pointer type.

Definition at line 80 of file itkIndexedUnaryFunctorImageFilter.h.

◆ OutputImageRegionType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef OutputImageType::RegionType itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::OutputImageRegionType

Output image region type.

Definition at line 81 of file itkIndexedUnaryFunctorImageFilter.h.

◆ OutputImageType

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef TOutputImage itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::OutputImageType

Output image type.

Definition at line 79 of file itkIndexedUnaryFunctorImageFilter.h.

◆ Pointer

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef SmartPointer< Self > itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::Pointer

Definition at line 62 of file itkIndexedUnaryFunctorImageFilter.h.

◆ Self

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef IndexedUnaryFunctorImageFilter itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::Self

Standard class typedefs.

Definition at line 60 of file itkIndexedUnaryFunctorImageFilter.h.

◆ Superclass

template<typename TInputImage , typename TOutputImage , typename TFunction >
typedef InPlaceImageFilter< TInputImage, TOutputImage > itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::Superclass

Definition at line 61 of file itkIndexedUnaryFunctorImageFilter.h.

Constructor & Destructor Documentation

◆ IndexedUnaryFunctorImageFilter()

template<typename TInputImage , typename TOutputImage , typename TFunction >
itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::IndexedUnaryFunctorImageFilter ( )
protected

◆ ~IndexedUnaryFunctorImageFilter()

template<typename TInputImage , typename TOutputImage , typename TFunction >
virtual itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::~IndexedUnaryFunctorImageFilter ( )
inlineprotectedvirtual

Definition at line 121 of file itkIndexedUnaryFunctorImageFilter.h.

Member Function Documentation

◆ GenerateOutputInformation()

template<typename TInputImage , typename TOutputImage , typename TFunction >
void itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::GenerateOutputInformation ( )
overrideprotected

IndexedUnaryFunctorImageFilter can produce an image which is a different resolution than its input image. As such, IndexedUnaryFunctorImageFilter needs to provide an implementation for GenerateOutputInformation() in order to inform the pipeline execution model. The original documentation of this method is below.

See also
ProcessObject::GenerateOutputInformaton()

◆ GetClassName()

template<typename TInputImage , typename TOutputImage , typename TFunction >
virtual const char* itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

◆ GetFunctor() [1/2]

template<typename TInputImage , typename TOutputImage , typename TFunction >
FunctorType& itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::GetFunctor ( )
inline

Get a mutable reference to the functor object.

The functor is returned by reference because functors do not have to derive from itk::LightObject and thus may not have a reference count.

Returns
Mutable reference to the functor.

Definition at line 92 of file itkIndexedUnaryFunctorImageFilter.h.

◆ GetFunctor() [2/2]

template<typename TInputImage , typename TOutputImage , typename TFunction >
const FunctorType& itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::GetFunctor ( ) const
inline

Get a const reference to the functor object.

Returns
Const reference to the functor.

Definition at line 99 of file itkIndexedUnaryFunctorImageFilter.h.

◆ New()

template<typename TInputImage , typename TOutputImage , typename TFunction >
static Pointer itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::New ( )
static

Method for creation through the object factory.

◆ SetFunctor()

template<typename TInputImage , typename TOutputImage , typename TFunction >
void itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::SetFunctor ( const FunctorType &  functor)
inline

Set the functor object.

Replaces the current functor with a copy of the specified functor. This allows configuring functor parameters (e.g., injected activity, body weight) before running the filter. Requires operator!=() to be defined on the functor type.

Parameters
[in]functorThe functor to copy into this filter.

Definition at line 110 of file itkIndexedUnaryFunctorImageFilter.h.

◆ ThreadedGenerateData()

template<typename TInputImage , typename TOutputImage , typename TFunction >
void itk::IndexedUnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::ThreadedGenerateData ( const OutputImageRegionType &  outputRegionForThread,
ThreadIdType  threadId 
)
overrideprotected

IndexedUnaryFunctorImageFilter 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()

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