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

Performs a single iteration of total variation denoising. More...

#include <itkTotalVariationSingleIterationImageFilter.h>

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

Public Types

typedef TInputImage InputImageType
 
typedef TOutputImage OutputImageType
 
typedef itk::Image< float, InputImageDimension > LocalVariationImageType
 
typedef TotalVariationSingleIterationImageFilter 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...
 
virtual void SetLambda (double _arg)
 Set/Get the regularization parameter Lambda. More...
 
virtual double GetLambda ()
 
void SetOriginalImage (InputImageType *in)
 Set the original (undenoised) image used as a reference for the data fidelity term. More...
 
InputImageType::Pointer GetOriginialImage ()
 Get the original (undenoised) image. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

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

Protected Attributes

LocalVariationImageType::Pointer m_LocalVariation
 
InputImageType::Pointer m_OriginalImage
 
double m_Lambda
 

Detailed Description

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

Performs a single iteration of total variation denoising.

This filter implements one step of the iterative total variation (TV) denoising algorithm. Given the current estimate of the denoised image (as the filter input) and the original noisy image (set via SetOriginalImage()), it computes a weighted average at each pixel that balances fidelity to the original with local smoothness.

The weighting is controlled by the Lambda parameter and the local variation in the image (computed via LocalVariationImageFilter in BeforeThreadedGenerateData()). Larger Lambda values favor fidelity to the original image.

This filter is typically not used directly but is called iteratively by TotalVariationDenoisingImageFilter.

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
TotalVariationDenoisingImageFilter
LocalVariationImageFilter
Image
Neighborhood
NeighborhoodOperator
NeighborhoodIterator

Definition at line 51 of file itkTotalVariationSingleIterationImageFilter.h.

Member Typedef Documentation

◆ ConstPointer

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

◆ InputImageRegionType

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

◆ InputImageType

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

Convenient typedefs for simplifying declarations.

Definition at line 59 of file itkTotalVariationSingleIterationImageFilter.h.

◆ InputPixelType

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

Image typedef support.

Definition at line 79 of file itkTotalVariationSingleIterationImageFilter.h.

◆ InputSizeType

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

◆ LocalVariationImageType

template<class TInputImage , class TOutputImage >
typedef itk::Image<float, InputImageDimension> itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::LocalVariationImageType

Float image type used to store the local variation at each pixel.

Definition at line 63 of file itkTotalVariationSingleIterationImageFilter.h.

◆ OutputImageRegionType

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

◆ OutputImageType

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

◆ OutputPixelType

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

◆ Pointer

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

◆ Self

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

Standard class typedefs.

Definition at line 66 of file itkTotalVariationSingleIterationImageFilter.h.

◆ Superclass

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

Constructor & Destructor Documentation

◆ TotalVariationSingleIterationImageFilter()

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

◆ ~TotalVariationSingleIterationImageFilter()

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

Member Function Documentation

◆ BeforeThreadedGenerateData()

template<class TInputImage , class TOutputImage >
void itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::BeforeThreadedGenerateData ( )
overrideprotected

◆ Clone()

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

◆ GenerateInputRequestedRegion()

template<class TInputImage , class TOutputImage >
void itk::TotalVariationSingleIterationImageFilter< 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.

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::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

◆ GetLambda()

template<class TInputImage , class TOutputImage >
virtual double itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::GetLambda ( )
virtual

◆ GetOriginialImage()

template<class TInputImage , class TOutputImage >
InputImageType::Pointer itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::GetOriginialImage ( )
inline

Get the original (undenoised) image.

Returns
Pointer to the original image.

Definition at line 120 of file itkTotalVariationSingleIterationImageFilter.h.

References itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::m_OriginalImage.

◆ itkStaticConstMacro() [1/2]

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

Extract dimension from input and output image.

◆ itkStaticConstMacro() [2/2]

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

◆ New()

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

Method for creation through the object factory.

◆ PrintSelf()

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

◆ SetLambda()

template<class TInputImage , class TOutputImage >
virtual void itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::SetLambda ( double  _arg)
virtual

Set/Get the regularization parameter Lambda.

Lambda controls the trade-off between fidelity to the original image and smoothness in the denoised output. Default is 1.0.

◆ SetOriginalImage()

template<class TInputImage , class TOutputImage >
void itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::SetOriginalImage ( InputImageType *  in)
inline

Set the original (undenoised) image used as a reference for the data fidelity term.

Parameters
[in]inPointer to the original input image.

Definition at line 114 of file itkTotalVariationSingleIterationImageFilter.h.

References itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::m_OriginalImage.

◆ ThreadedGenerateData()

template<class TInputImage , class TOutputImage >
void itk::TotalVariationSingleIterationImageFilter< 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()

Member Data Documentation

◆ m_Lambda

template<class TInputImage , class TOutputImage >
double itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::m_Lambda
protected

◆ m_LocalVariation

template<class TInputImage , class TOutputImage >
LocalVariationImageType::Pointer itk::TotalVariationSingleIterationImageFilter< TInputImage, TOutputImage >::m_LocalVariation
protected

◆ m_OriginalImage


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