Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
itkTotalVariationSingleIterationImageFilter.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 __itkTotalVariationSingleIterationImageFilter_h
18 #define __itkTotalVariationSingleIterationImageFilter_h
19 
20 #include "itkImage.h"
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
37  template <class TInputImage, class TOutputImage>
38  class TotalVariationSingleIterationImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
39  {
40  public:
42  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
43  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
44 
46  typedef TInputImage InputImageType;
47  typedef TOutputImage OutputImageType;
48 
49  typedef itk::Image<float, InputImageDimension> LocalVariationImageType;
50 
53  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
56 
58  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
59 
61  itkTypeMacro(TotalVariationSingleIterationImageFilter, 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 
78  virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
79 
80  itkSetMacro(Lambda, double);
81  itkGetMacro(Lambda, double);
82 
83  void SetOriginalImage(InputImageType *in) { this->m_OriginalImage = in; }
85  protected:
88  void PrintSelf(std::ostream &os, Indent indent) const;
89 
100  void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId);
101 
103 
105 
107 
108  double m_Lambda;
109 
110  private:
112 
113  void operator=(const Self &);
114  };
115 
116 } // end namespace itk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
120 #endif
121 
122 #endif //__itkTotalVariationSingleIterationImageFilter__
ImageToImageFilter< InputImageType, OutputImageType > Superclass
itk::SmartPointer< Self > Pointer
Applies a total variation denoising filter to an image.
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
Definition: jsoncpp.cpp:244
void PrintSelf(std::ostream &os, Indent indent) const
unsigned short PixelType