Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
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 (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 __itkTotalVariationSingleIterationImageFilter_h
14 #define __itkTotalVariationSingleIterationImageFilter_h
15 
16 #include "itkImage.h"
17 #include "itkImageToImageFilter.h"
18 
19 namespace itk
20 {
33  template <class TInputImage, class TOutputImage>
34  class TotalVariationSingleIterationImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
35  {
36  public:
38  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
39  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
40 
42  typedef TInputImage InputImageType;
43  typedef TOutputImage OutputImageType;
44 
45  typedef itk::Image<float, InputImageDimension> LocalVariationImageType;
46 
49  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
52 
54  itkFactorylessNewMacro(Self);
55  itkCloneMacro(Self);
56 
58  itkTypeMacro(TotalVariationSingleIterationImageFilter, 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 
75  void GenerateInputRequestedRegion() override;
76 
77  itkSetMacro(Lambda, double);
78  itkGetMacro(Lambda, double);
79 
81  typename InputImageType::Pointer GetOriginialImage() { return this->m_OriginalImage; }
82  protected:
85  void PrintSelf(std::ostream &os, Indent indent) const override;
86 
97  void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override;
98 
99  void BeforeThreadedGenerateData() override;
100 
101  typename LocalVariationImageType::Pointer m_LocalVariation;
102 
103  typename InputImageType::Pointer m_OriginalImage;
104 
105  double m_Lambda;
106 
107  private:
109 
110  void operator=(const Self &);
111  };
112 
113 } // end namespace itk
114 
115 #ifndef ITK_MANUAL_INSTANTIATION
116 #include "itkTotalVariationSingleIterationImageFilter.txx"
117 #endif
118 
119 #endif //__itkTotalVariationSingleIterationImageFilter__
itk::TotalVariationSingleIterationImageFilter::InputSizeType
InputImageType::SizeType InputSizeType
Definition: itkTotalVariationSingleIterationImageFilter.h:67
itk::TotalVariationSingleIterationImageFilter
Applies a total variation denoising filter to an image.
Definition: itkTotalVariationSingleIterationImageFilter.h:34
itk::TotalVariationSingleIterationImageFilter::~TotalVariationSingleIterationImageFilter
~TotalVariationSingleIterationImageFilter() override
Definition: itkTotalVariationSingleIterationImageFilter.h:84
itk::TotalVariationSingleIterationImageFilter::GetOriginialImage
InputImageType::Pointer GetOriginialImage()
Definition: itkTotalVariationSingleIterationImageFilter.h:81
itk::TotalVariationSingleIterationImageFilter::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: itkTotalVariationSingleIterationImageFilter.h:62
itk::TotalVariationSingleIterationImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: itkTotalVariationSingleIterationImageFilter.h:64
itk::TotalVariationSingleIterationImageFilter::m_OriginalImage
InputImageType::Pointer m_OriginalImage
Definition: itkTotalVariationSingleIterationImageFilter.h:103
itk::SmartPointer< Self >
itk::TotalVariationSingleIterationImageFilter::ThreadedGenerateData
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
itk::TotalVariationSingleIterationImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: itkTotalVariationSingleIterationImageFilter.h:65
itk::TotalVariationSingleIterationImageFilter::InputImageType
TInputImage InputImageType
Definition: itkTotalVariationSingleIterationImageFilter.h:42
itk::TotalVariationSingleIterationImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::TotalVariationSingleIterationImageFilter::GenerateInputRequestedRegion
void GenerateInputRequestedRegion() override
itk::TotalVariationSingleIterationImageFilter::Pointer
SmartPointer< Self > Pointer
Definition: itkTotalVariationSingleIterationImageFilter.h:50
itk::TotalVariationSingleIterationImageFilter::Superclass
ImageToImageFilter< InputImageType, OutputImageType > Superclass
Definition: itkTotalVariationSingleIterationImageFilter.h:49
itk::TotalVariationSingleIterationImageFilter::Self
TotalVariationSingleIterationImageFilter Self
Definition: itkTotalVariationSingleIterationImageFilter.h:48
itk::TotalVariationSingleIterationImageFilter::SetOriginalImage
void SetOriginalImage(InputImageType *in)
Definition: itkTotalVariationSingleIterationImageFilter.h:80
itk::TotalVariationSingleIterationImageFilter::m_Lambda
double m_Lambda
Definition: itkTotalVariationSingleIterationImageFilter.h:105
itk::TotalVariationSingleIterationImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: itkTotalVariationSingleIterationImageFilter.h:43
itk::TotalVariationSingleIterationImageFilter::TotalVariationSingleIterationImageFilter
TotalVariationSingleIterationImageFilter()
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
itk::TotalVariationSingleIterationImageFilter::BeforeThreadedGenerateData
void BeforeThreadedGenerateData() override
itk::TotalVariationSingleIterationImageFilter::m_LocalVariation
LocalVariationImageType::Pointer m_LocalVariation
Definition: itkTotalVariationSingleIterationImageFilter.h:101
itk::TotalVariationSingleIterationImageFilter::LocalVariationImageType
itk::Image< float, InputImageDimension > LocalVariationImageType
Definition: itkTotalVariationSingleIterationImageFilter.h:45
itk::TotalVariationSingleIterationImageFilter::itkStaticConstMacro
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
itk::TotalVariationSingleIterationImageFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: itkTotalVariationSingleIterationImageFilter.h:58
itk::TotalVariationSingleIterationImageFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkTotalVariationSingleIterationImageFilter.h:51