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

Calculates the local variation in each pixel. More...

#include <itkLocalVariationImageFilter.h>

Inheritance diagram for itk::LocalVariationImageFilter< TInputImage, TOutputImage >:
Collaboration diagram for itk::LocalVariationImageFilter< TInputImage, TOutputImage >:

Public Types

typedef TInputImage InputImageType
 
typedef TOutputImage OutputImageType
 
typedef LocalVariationImageFilter Self
 
typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass
 
typedef SmartPointer< Self > Pointer
 
typedef SmartPointer< const Self > ConstPointer
 
typedef InputImageType::PixelType InputPixelType
 
typedef OutputImageType::PixelType OutputPixelType
 
typedef InputImageType::RegionType InputImageRegionType
 
typedef OutputImageType::RegionType OutputImageRegionType
 
typedef InputImageType::SizeType InputSizeType
 

Public Member Functions

 itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension)
 
 itkStaticConstMacro (OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
 
Pointer Clone () const
 
virtual const char * GetClassName () const
 
void GenerateInputRequestedRegion () override
 Generates the input requested region, padded by a radius of 1. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 LocalVariationImageFilter ()
 
 ~LocalVariationImageFilter () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
 

Detailed Description

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

Calculates the local variation in each pixel.

For each pixel, this filter computes the local variation as the square root of the sum of squared differences between the pixel and each of its face-connected neighbors. A small epsilon (0.0001) is added inside the square root for numerical stability. The filter uses zero-flux Neumann boundary conditions.

This filter is used internally by TotalVariationSingleIterationImageFilter as part of the total variation denoising pipeline.

Reference: Tony F. Chan et al., The digital TV filter and nonlinear denoising

Template Parameters
TInputImageThe type of the input image.
TOutputImageThe type of the output image.
See also
TotalVariationSingleIterationImageFilter
TotalVariationDenoisingImageFilter
SquaredEuclideanMetric
Image
Neighborhood
NeighborhoodOperator
NeighborhoodIterator

Definition at line 72 of file itkLocalVariationImageFilter.h.

Member Typedef Documentation

◆ ConstPointer

template<class TInputImage , class TOutputImage >
typedef SmartPointer<const Self> itk::LocalVariationImageFilter< TInputImage, TOutputImage >::ConstPointer

Definition at line 87 of file itkLocalVariationImageFilter.h.

◆ InputImageRegionType

template<class TInputImage , class TOutputImage >
typedef InputImageType::RegionType itk::LocalVariationImageFilter< TInputImage, TOutputImage >::InputImageRegionType

Definition at line 100 of file itkLocalVariationImageFilter.h.

◆ InputImageType

template<class TInputImage , class TOutputImage >
typedef TInputImage itk::LocalVariationImageFilter< TInputImage, TOutputImage >::InputImageType

Convenient typedefs for simplifying declarations.

Definition at line 80 of file itkLocalVariationImageFilter.h.

◆ InputPixelType

template<class TInputImage , class TOutputImage >
typedef InputImageType::PixelType itk::LocalVariationImageFilter< TInputImage, TOutputImage >::InputPixelType

Image typedef support.

Definition at line 97 of file itkLocalVariationImageFilter.h.

◆ InputSizeType

template<class TInputImage , class TOutputImage >
typedef InputImageType::SizeType itk::LocalVariationImageFilter< TInputImage, TOutputImage >::InputSizeType

Definition at line 103 of file itkLocalVariationImageFilter.h.

◆ OutputImageRegionType

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

Definition at line 101 of file itkLocalVariationImageFilter.h.

◆ OutputImageType

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

Definition at line 81 of file itkLocalVariationImageFilter.h.

◆ OutputPixelType

template<class TInputImage , class TOutputImage >
typedef OutputImageType::PixelType itk::LocalVariationImageFilter< TInputImage, TOutputImage >::OutputPixelType

Definition at line 98 of file itkLocalVariationImageFilter.h.

◆ Pointer

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

Definition at line 86 of file itkLocalVariationImageFilter.h.

◆ Self

template<class TInputImage , class TOutputImage >
typedef LocalVariationImageFilter itk::LocalVariationImageFilter< TInputImage, TOutputImage >::Self

Standard class typedefs.

Definition at line 84 of file itkLocalVariationImageFilter.h.

◆ Superclass

template<class TInputImage , class TOutputImage >
typedef ImageToImageFilter<InputImageType, OutputImageType> itk::LocalVariationImageFilter< TInputImage, TOutputImage >::Superclass

Definition at line 85 of file itkLocalVariationImageFilter.h.

Constructor & Destructor Documentation

◆ LocalVariationImageFilter()

template<class TInputImage , class TOutputImage >
itk::LocalVariationImageFilter< TInputImage, TOutputImage >::LocalVariationImageFilter ( )
protected

◆ ~LocalVariationImageFilter()

template<class TInputImage , class TOutputImage >
itk::LocalVariationImageFilter< TInputImage, TOutputImage >::~LocalVariationImageFilter ( )
inlineoverrideprotected

Definition at line 121 of file itkLocalVariationImageFilter.h.

Member Function Documentation

◆ Clone()

template<class TInputImage , class TOutputImage >
Pointer itk::LocalVariationImageFilter< TInputImage, TOutputImage >::Clone ( ) const

◆ GenerateInputRequestedRegion()

template<class TInputImage , class TOutputImage >
void itk::LocalVariationImageFilter< TInputImage, TOutputImage >::GenerateInputRequestedRegion ( )
override

Generates the input requested region, padded by a radius of 1.

This filter requires a larger input requested region than the output requested region because it accesses face-connected neighbors. The input region is padded by 1 pixel in each direction.

Exceptions
itk::InvalidRequestedRegionErrorif the padded region falls outside the input's largest possible region.
See also
ImageToImageFilter::GenerateInputRequestedRegion()

◆ GetClassName()

template<class TInputImage , class TOutputImage >
virtual const char* itk::LocalVariationImageFilter< TInputImage, TOutputImage >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

◆ itkStaticConstMacro() [1/2]

template<class TInputImage , class TOutputImage >
itk::LocalVariationImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( InputImageDimension  ,
unsigned int  ,
TInputImage::ImageDimension   
)

Extract dimension from input and output image.

◆ itkStaticConstMacro() [2/2]

template<class TInputImage , class TOutputImage >
itk::LocalVariationImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( OutputImageDimension  ,
unsigned int  ,
TOutputImage::ImageDimension   
)

◆ New()

template<class TInputImage , class TOutputImage >
static Pointer itk::LocalVariationImageFilter< TInputImage, TOutputImage >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<class TInputImage , class TOutputImage >
void itk::LocalVariationImageFilter< TInputImage, TOutputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotected

◆ ThreadedGenerateData()

template<class TInputImage , class TOutputImage >
void itk::LocalVariationImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData ( const OutputImageRegionType &  outputRegionForThread,
ThreadIdType  threadId 
)
overrideprotected

MedianImageFilter 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: