ITK  5.3.0
Insight Toolkit
itkLandweberDeconvolutionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkLandweberDeconvolutionImageFilter_h
19 #define itkLandweberDeconvolutionImageFilter_h
20 
22 
25 
26 namespace itk
27 {
28 namespace Functor
29 {
35 template <typename TInput1, typename TInput2, typename TInput3, typename TOutput>
36 class ITK_TEMPLATE_EXPORT LandweberMethod
37 {
38 public:
39  LandweberMethod() = default;
40  ~LandweberMethod() = default;
43  bool
44  operator==(const LandweberMethod &) const
45  {
46  return true;
47  }
48 
49  ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(LandweberMethod);
50 
51  inline TOutput
52  operator()(const TInput1 & estimateFT, const TInput2 & kernelFT, const TInput2 & inputFT) const
53  {
54  return m_Alpha * std::conj(kernelFT) * inputFT +
55  (NumericTraits<typename TInput1::value_type>::OneValue() - m_Alpha * std::norm(kernelFT)) * estimateFT;
56  }
57 
58  typename TInput1::value_type m_Alpha;
59 };
60 } // end namespace Functor
61 
99 template <typename TInputImage,
100  typename TKernelImage = TInputImage,
101  typename TOutputImage = TInputImage,
102  typename TInternalPrecision = double>
103 class ITK_TEMPLATE_EXPORT LandweberDeconvolutionImageFilter
104  : public IterativeDeconvolutionImageFilter<TInputImage, TKernelImage, TOutputImage, TInternalPrecision>
105 {
106 public:
107  ITK_DISALLOW_COPY_AND_MOVE(LandweberDeconvolutionImageFilter);
108 
114 
116  using InputImageType = TInputImage;
117  using KernelImageType = TKernelImage;
118  using OutputImageType = TOutputImage;
119 
121  using typename Superclass::InternalImageType;
122  using typename Superclass::InternalImagePointerType;
123  using typename Superclass::InternalComplexType;
124  using typename Superclass::InternalComplexImageType;
125  using typename Superclass::InternalComplexImagePointerType;
126 
128  itkNewMacro(Self);
129 
132 
134  itkSetMacro(Alpha, double);
135  itkGetMacro(Alpha, double);
138 protected:
141 
142  void
143  Initialize(ProgressAccumulator * progress, float progressWeight, float iterationProgressWeight) override;
144 
145  void
146  Iteration(ProgressAccumulator * progress, float iterationProgressWeight) override;
147 
148  void
149  Finish(ProgressAccumulator * progress, float progressWeight) override;
150 
151  using typename Superclass::FFTFilterType;
152  using typename Superclass::IFFTFilterType;
153 
154  void
155  PrintSelf(std::ostream & os, Indent indent) const override;
156 
157 private:
158  double m_Alpha;
159 
161 
162  using LandweberFunctor =
168 
171 };
172 
173 } // end namespace itk
174 
175 #ifndef ITK_MANUAL_INSTANTIATION
176 # include "itkLandweberDeconvolutionImageFilter.hxx"
177 #endif
178 
179 #endif
itk::Functor::LandweberMethod::operator==
bool operator==(const LandweberMethod &) const
Definition: itkLandweberDeconvolutionImageFilter.h:44
itk::Functor::LandweberMethod::m_Alpha
TInput1::value_type m_Alpha
Definition: itkLandweberDeconvolutionImageFilter.h:58
itk::ConvolutionImageFilterBase::KernelImageType
TKernelImage KernelImageType
Definition: itkConvolutionImageFilterBase.h:76
itk::LandweberDeconvolutionImageFilter::m_LandweberFilter
LandweberFilterType::Pointer m_LandweberFilter
Definition: itkLandweberDeconvolutionImageFilter.h:169
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FFTConvolutionImageFilter::InternalComplexImagePointerType
typename InternalComplexImageType::Pointer InternalComplexImagePointerType
Definition: itkFFTConvolutionImageFilter.h:106
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::TernaryGeneratorImageFilter
Implements pixel-wise generic operation of three images or images with constants.
Definition: itkTernaryGeneratorImageFilter.h:54
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:156
itk::LandweberDeconvolutionImageFilter::m_IFFTFilter
IFFTFilterType::Pointer m_IFFTFilter
Definition: itkLandweberDeconvolutionImageFilter.h:170
itk::Functor::LandweberMethod
Functor class for computing a Landweber iteration.
Definition: itkLandweberDeconvolutionImageFilter.h:36
itk::LandweberDeconvolutionImageFilter::m_Alpha
double m_Alpha
Definition: itkLandweberDeconvolutionImageFilter.h:158
itkComplexConjugateImageAdaptor.h
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::ProgressAccumulator
Facilitates progress reporting for filters that wrap around multiple other filters.
Definition: itkProgressAccumulator.h:40
itkIterativeDeconvolutionImageFilter.h
itk::LandweberDeconvolutionImageFilter
Deconvolve an image using the Landweber deconvolution algorithm.
Definition: itkLandweberDeconvolutionImageFilter.h:103
itk::IterativeDeconvolutionImageFilter
Abstract base class for filters that implement iterative deconvolution algorithms.
Definition: itkIterativeDeconvolutionImageFilter.h:55
itk::Functor::LandweberMethod::operator()
TOutput operator()(const TInput1 &estimateFT, const TInput2 &kernelFT, const TInput2 &inputFT) const
Definition: itkLandweberDeconvolutionImageFilter.h:52
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itkTernaryGeneratorImageFilter.h
itk::LandweberDeconvolutionImageFilter::m_TransformedInput
InternalComplexImagePointerType m_TransformedInput
Definition: itkLandweberDeconvolutionImageFilter.h:160