Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef __itkTotalVariationDenoisingImageFilter_h
18 #define __itkTotalVariationDenoisingImageFilter_h
19 
20 #include "itkCastImageFilter.h"
21 #include "itkImage.h"
22 #include "itkImageToImageFilter.h"
24 
25 namespace itk
26 {
39  template <class TInputImage, class TOutputImage>
40  class TotalVariationDenoisingImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
41  {
42  public:
44  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
45  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
46 
48  typedef TInputImage InputImageType;
49  typedef TOutputImage OutputImageType;
50 
53  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
56 
58  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
59 
61  itkTypeMacro(TotalVariationDenoisingImageFilter, ImageToImageFilter);
62 
64  typedef typename InputImageType::PixelType InputPixelType;
65  typedef typename OutputImageType::PixelType OutputPixelType;
66 
67  typedef typename InputImageType::RegionType InputImageRegionType;
68  typedef typename OutputImageType::RegionType OutputImageRegionType;
69 
70  typedef typename InputImageType::SizeType InputSizeType;
71 
73 
74  typedef typename itk::CastImageFilter<TInputImage, TOutputImage> CastType;
75 
76  itkSetMacro(Lambda, double);
77  itkGetMacro(Lambda, double);
78 
79  itkSetMacro(NumberIterations, int);
80  itkGetMacro(NumberIterations, int);
81 
82  protected:
83  TotalVariationDenoisingImageFilter();
84  virtual ~TotalVariationDenoisingImageFilter() {}
85  void PrintSelf(std::ostream &os, Indent indent) const;
86 
87  void GenerateData();
88 
89  double m_Lambda;
90 
92 
93  private:
94  TotalVariationDenoisingImageFilter(const Self &); // purposely not implemented
95  void operator=(const Self &); // purposely not implemented
96  };
97 
98 } // end namespace itk
99 
100 #ifndef ITK_MANUAL_INSTANTIATION
102 #endif
103 
104 #endif //__itkTotalVariationDenoisingImageFilter__
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
ImageToImageFilter< InputImageType, OutputImageType > Superclass
Applies a total variation denoising filter to an image.
void PrintSelf(std::ostream &os, Indent indent) const
Applies a total variation denoising filter to an image.
itk::CastImageFilter< TInputImage, TOutputImage > CastType
unsigned short PixelType