Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
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 {
35  template <class TInputImage, class TOutputImage>
36  class TotalVariationDenoisingImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
37  {
38  public:
40  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
41  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
42 
44  typedef TInputImage InputImageType;
45  typedef TOutputImage OutputImageType;
46 
49  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
52 
54  itkFactorylessNewMacro(Self);
55  itkCloneMacro(Self);
56 
58  itkTypeMacro(TotalVariationDenoisingImageFilter, ImageToImageFilter);
59 
61  typedef typename InputImageType::PixelType InputPixelType;
62  typedef typename OutputImageType::PixelType OutputPixelType;
63 
64  typedef typename InputImageType::RegionType InputImageRegionType;
65  typedef typename OutputImageType::RegionType OutputImageRegionType;
66 
67  typedef typename InputImageType::SizeType InputSizeType;
68 
70 
71  typedef typename itk::CastImageFilter<TInputImage, TOutputImage> CastType;
72 
73  itkSetMacro(Lambda, double);
74  itkGetMacro(Lambda, double);
75 
76  itkSetMacro(NumberIterations, int);
77  itkGetMacro(NumberIterations, int);
78 
79  protected:
82  void PrintSelf(std::ostream &os, Indent indent) const override;
83 
84  void GenerateData() override;
85 
86  double m_Lambda;
87 
89 
90  private:
91  TotalVariationDenoisingImageFilter(const Self &); // purposely not implemented
92  void operator=(const Self &); // purposely not implemented
93  };
94 
95 } // end namespace itk
96 
97 #ifndef ITK_MANUAL_INSTANTIATION
99 #endif
100 
101 #endif //__itkTotalVariationDenoisingImageFilter__
void PrintSelf(std::ostream &os, Indent indent) const override
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
ImageToImageFilter< InputImageType, OutputImageType > Superclass
Applies a total variation denoising filter to an image.
TotalVariationSingleIterationImageFilter< TOutputImage, TOutputImage > SingleIterationFilterType
Applies a total variation denoising filter to an image.
itk::CastImageFilter< TInputImage, TOutputImage > CastType