Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
itkTotalVariationDenoisingImageFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef itkTotalVariationDenoisingImageFilter_h
14 #define itkTotalVariationDenoisingImageFilter_h
15 
16 #include <itkCastImageFilter.h>
17 #include <itkImage.h>
18 #include <itkImageToImageFilter.h>
20 
21 namespace itk
22 {
50  template <class TInputImage, class TOutputImage>
51  class TotalVariationDenoisingImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
52  {
53  public:
55  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
56  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
57 
59  typedef TInputImage InputImageType;
60  typedef TOutputImage OutputImageType;
61 
64  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
67 
69  itkFactorylessNewMacro(Self);
70  itkCloneMacro(Self);
71 
73  itkTypeMacro(TotalVariationDenoisingImageFilter, ImageToImageFilter);
74 
76  typedef typename InputImageType::PixelType InputPixelType;
77  typedef typename OutputImageType::PixelType OutputPixelType;
78 
79  typedef typename InputImageType::RegionType InputImageRegionType;
80  typedef typename OutputImageType::RegionType OutputImageRegionType;
81 
82  typedef typename InputImageType::SizeType InputSizeType;
83 
86 
88  typedef typename itk::CastImageFilter<TInputImage, TOutputImage> CastType;
89 
97  itkSetMacro(Lambda, double);
98  itkGetMacro(Lambda, double);
99 
107  itkSetMacro(NumberIterations, int);
108  itkGetMacro(NumberIterations, int);
109 
110  protected:
113  void PrintSelf(std::ostream &os, Indent indent) const override;
114 
115  void GenerateData() override;
116 
117  double m_Lambda;
118 
120 
121  private:
122  TotalVariationDenoisingImageFilter(const Self &); // purposely not implemented
123  void operator=(const Self &); // purposely not implemented
124  };
125 
126 } // end namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include <itkTotalVariationDenoisingImageFilter.tpp>
130 #endif
131 
132 #endif //__itkTotalVariationDenoisingImageFilter__
Applies iterative total variation (TV) denoising to an image.
TotalVariationSingleIterationImageFilter< TOutputImage, TOutputImage > SingleIterationFilterType
void PrintSelf(std::ostream &os, Indent indent) const override
itk::CastImageFilter< TInputImage, TOutputImage > CastType
ImageToImageFilter< InputImageType, OutputImageType > Superclass
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
Performs a single iteration of total variation denoising.