ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLandweberDeconvolutionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
34 template< typename TInput1, typename TInput2, typename TInput3, typename TOutput >
35 class ITK_TEMPLATE_EXPORT LandweberMethod
36 {
37 public:
38  LandweberMethod() = default;
39  ~LandweberMethod() = default;
40 
41  bool operator!=(const LandweberMethod &) const
42  {
43  return false;
44  }
45 
46  bool operator==(const LandweberMethod & other) const
47  {
48  return !( *this != other );
49  }
50 
51  inline TOutput operator()(const TInput1 & estimateFT,
52  const TInput2 & kernelFT,
53  const TInput2 & inputFT) const
54  {
55  return m_Alpha * std::conj( kernelFT ) * inputFT +
56  ( NumericTraits< typename TInput1::value_type >::OneValue() - m_Alpha * std::norm( kernelFT ) ) * estimateFT;
57  }
58 
59  typename TInput1::value_type m_Alpha;
60 
61 };
62 } // end namespace Functor
63 
100 template< typename TInputImage, typename TKernelImage=TInputImage, typename TOutputImage=TInputImage, typename TInternalPrecision=double >
101 class ITK_TEMPLATE_EXPORT LandweberDeconvolutionImageFilter :
102  public IterativeDeconvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision >
103 {
104 public:
105  ITK_DISALLOW_COPY_AND_ASSIGN(LandweberDeconvolutionImageFilter);
106 
109  using Superclass = IterativeDeconvolutionImageFilter< TInputImage,
110  TKernelImage,
111  TOutputImage,
112  TInternalPrecision >;
115 
117  using InputImageType = TInputImage;
118  using KernelImageType = TKernelImage;
119  using OutputImageType = TOutputImage;
120 
122  using InternalImageType = typename Superclass::InternalImageType;
123  using InternalImagePointerType = typename Superclass::InternalImagePointerType;
124  using InternalComplexType = typename Superclass::InternalComplexType;
125  using InternalComplexImageType = typename Superclass::InternalComplexImageType;
127 
129  itkNewMacro(Self);
130 
134 
136  itkSetMacro(Alpha, double);
137  itkGetMacro(Alpha, double);
139 
140 protected:
143 
144  void Initialize(ProgressAccumulator * progress,
145  float progressWeight,
146  float iterationProgressWeight) override;
147 
148  void Iteration(ProgressAccumulator * progress,
149  float iterationProgressWeight) override;
150 
151  void Finish(ProgressAccumulator *progress, float progressWeight) override;
152 
153  using FFTFilterType = typename Superclass::FFTFilterType;
154  using IFFTFilterType = typename Superclass::IFFTFilterType;
155 
156  void PrintSelf(std::ostream & os, Indent indent) const override;
157 
158 private:
159  double m_Alpha;
160 
162 
172 
175 };
176 
177 } // end namespace itk
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkLandweberDeconvolutionImageFilter.hxx"
181 #endif
182 
183 #endif
typename InternalImageType::Pointer InternalImagePointerType
Define numeric traits for std::vector.
typename Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Implements pixel-wise generic operation of three images.
Base class for all process objects that output image data.
Base class for specialized complex-to-real inverse Fast Fourier Transform.
bool operator==(const LandweberMethod &other) const
typename InternalComplexImageType::Pointer InternalComplexImagePointerType
std::complex< TInternalPrecision > InternalComplexType
TOutputImage OutputImageType
Facilitates progress reporting for filters that wrap around multiple other filters.
Deconvolve an image using the Landweber deconvolution algorithm.
bool operator!=(const LandweberMethod &) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base class for filters that implement iterative deconvolution algorithms.
Base class for specialized real-to-complex forward Fast Fourier Transform.
TOutput operator()(const TInput1 &estimateFT, const TInput2 &kernelFT, const TInput2 &inputFT) const
Functor class for computing a Landweber iteration.
Templated n-dimensional image class.
Definition: itkImage.h:75