ITK  5.2.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  * http://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;
42 
43  bool
44  operator!=(const LandweberMethod &) const
45  {
46  return false;
47  }
48 
49  bool
50  operator==(const LandweberMethod & other) const
51  {
52  return !(*this != other);
53  }
54 
55  inline TOutput
56  operator()(const TInput1 & estimateFT, const TInput2 & kernelFT, const TInput2 & inputFT) const
57  {
58  return m_Alpha * std::conj(kernelFT) * inputFT +
59  (NumericTraits<typename TInput1::value_type>::OneValue() - m_Alpha * std::norm(kernelFT)) * estimateFT;
60  }
61 
62  typename TInput1::value_type m_Alpha;
63 };
64 } // end namespace Functor
65 
103 template <typename TInputImage,
104  typename TKernelImage = TInputImage,
105  typename TOutputImage = TInputImage,
106  typename TInternalPrecision = double>
107 class ITK_TEMPLATE_EXPORT LandweberDeconvolutionImageFilter
108  : public IterativeDeconvolutionImageFilter<TInputImage, TKernelImage, TOutputImage, TInternalPrecision>
109 {
110 public:
111  ITK_DISALLOW_COPY_AND_ASSIGN(LandweberDeconvolutionImageFilter);
112 
118 
120  using InputImageType = TInputImage;
121  using KernelImageType = TKernelImage;
122  using OutputImageType = TOutputImage;
123 
125  using InternalImageType = typename Superclass::InternalImageType;
126  using InternalImagePointerType = typename Superclass::InternalImagePointerType;
127  using InternalComplexType = typename Superclass::InternalComplexType;
128  using InternalComplexImageType = typename Superclass::InternalComplexImageType;
130 
132  itkNewMacro(Self);
133 
136 
138  itkSetMacro(Alpha, double);
139  itkGetMacro(Alpha, double);
141 
142 protected:
145 
146  void
147  Initialize(ProgressAccumulator * progress, float progressWeight, float iterationProgressWeight) override;
148 
149  void
150  Iteration(ProgressAccumulator * progress, float iterationProgressWeight) override;
151 
152  void
153  Finish(ProgressAccumulator * progress, float progressWeight) override;
154 
155  using FFTFilterType = typename Superclass::FFTFilterType;
156  using IFFTFilterType = typename Superclass::IFFTFilterType;
157 
158  void
159  PrintSelf(std::ostream & os, Indent indent) const override;
160 
161 private:
162  double m_Alpha;
163 
165 
166  using LandweberFunctor =
173 
176 };
177 
178 } // end namespace itk
179 
180 #ifndef ITK_MANUAL_INSTANTIATION
181 # include "itkLandweberDeconvolutionImageFilter.hxx"
182 #endif
183 
184 #endif
itk::Functor::LandweberMethod::m_Alpha
TInput1::value_type m_Alpha
Definition: itkLandweberDeconvolutionImageFilter.h:62
itk::ConvolutionImageFilterBase::KernelImageType
TKernelImage KernelImageType
Definition: itkConvolutionImageFilterBase.h:76
itkTernaryFunctorImageFilter.h
itk::LandweberDeconvolutionImageFilter::m_LandweberFilter
LandweberFilterType::Pointer m_LandweberFilter
Definition: itkLandweberDeconvolutionImageFilter.h:174
itk::RealToHalfHermitianForwardFFTImageFilter
Base class for specialized real-to-complex forward Fast Fourier Transform.
Definition: itkRealToHalfHermitianForwardFFTImageFilter.h:56
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Functor::LandweberMethod::operator!=
bool operator!=(const LandweberMethod &) const
Definition: itkLandweberDeconvolutionImageFilter.h:44
itk::FFTConvolutionImageFilter::InternalComplexImagePointerType
typename InternalComplexImageType::Pointer InternalComplexImagePointerType
Definition: itkFFTConvolutionImageFilter.h:101
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::LandweberMethod::operator==
bool operator==(const LandweberMethod &other) const
Definition: itkLandweberDeconvolutionImageFilter.h:50
itk::FFTConvolutionImageFilter::InternalComplexType
std::complex< TInternalPrecision > InternalComplexType
Definition: itkFFTConvolutionImageFilter.h:99
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:156
itk::IterativeDeconvolutionImageFilter::InternalComplexImagePointerType
typename Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
Definition: itkIterativeDeconvolutionImageFilter.h:77
itk::LandweberDeconvolutionImageFilter::m_IFFTFilter
IFFTFilterType::Pointer m_IFFTFilter
Definition: itkLandweberDeconvolutionImageFilter.h:175
itk::Functor::LandweberMethod
Functor class for computing a Landweber iteration.
Definition: itkLandweberDeconvolutionImageFilter.h:36
itk::LandweberDeconvolutionImageFilter::m_Alpha
double m_Alpha
Definition: itkLandweberDeconvolutionImageFilter.h:162
itk::TernaryFunctorImageFilter
Implements pixel-wise generic operation of three images.
Definition: itkTernaryFunctorImageFilter.h:43
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:107
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:56
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:138
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::HalfHermitianToRealInverseFFTImageFilter
Base class for specialized complex-to-real inverse Fast Fourier Transform.
Definition: itkHalfHermitianToRealInverseFFTImageFilter.h:56
itk::FFTConvolutionImageFilter::InternalImagePointerType
typename InternalImageType::Pointer InternalImagePointerType
Definition: itkFFTConvolutionImageFilter.h:98
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::LandweberDeconvolutionImageFilter::m_TransformedInput
InternalComplexImagePointerType m_TransformedInput
Definition: itkLandweberDeconvolutionImageFilter.h:164