Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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) itkCloneMacro(Self)
55 
56 
57  itkTypeMacro(TotalVariationDenoisingImageFilter, ImageToImageFilter);
58 
60  typedef typename InputImageType::PixelType InputPixelType;
61  typedef typename OutputImageType::PixelType OutputPixelType;
62 
63  typedef typename InputImageType::RegionType InputImageRegionType;
64  typedef typename OutputImageType::RegionType OutputImageRegionType;
65 
66  typedef typename InputImageType::SizeType InputSizeType;
67 
69 
70  typedef typename itk::CastImageFilter<TInputImage, TOutputImage> CastType;
71 
72  itkSetMacro(Lambda, double);
73  itkGetMacro(Lambda, double);
74 
75  itkSetMacro(NumberIterations, int);
76  itkGetMacro(NumberIterations, int);
77 
78  protected:
79  TotalVariationDenoisingImageFilter();
80  ~TotalVariationDenoisingImageFilter() override {}
81  void PrintSelf(std::ostream &os, Indent indent) const override;
82 
83  void GenerateData() override;
84 
85  double m_Lambda;
86 
88 
89  private:
90  TotalVariationDenoisingImageFilter(const Self &); // purposely not implemented
91  void operator=(const Self &); // purposely not implemented
92  };
93 
94 } // end namespace itk
95 
96 #ifndef ITK_MANUAL_INSTANTIATION
98 #endif
99 
100 #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.
Applies a total variation denoising filter to an image.
itk::CastImageFilter< TInputImage, TOutputImage > CastType
unsigned short PixelType