ITK  6.0.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
26namespace itk
27{
28namespace Functor
29{
35template <typename TInput1, typename TInput2, typename TInput3, typename TOutput>
36class ITK_TEMPLATE_EXPORT LandweberMethod
37{
38public:
39 bool
41 {
42 return true;
43 }
44
46
47 inline TOutput
48 operator()(const TInput1 & estimateFT, const TInput2 & kernelFT, const TInput2 & inputFT) const
49 {
50 return m_Alpha * std::conj(kernelFT) * inputFT +
51 (NumericTraits<typename TInput1::value_type>::OneValue() - m_Alpha * std::norm(kernelFT)) * estimateFT;
52 }
53
54 typename TInput1::value_type m_Alpha;
55};
56} // end namespace Functor
57
95template <typename TInputImage,
96 typename TKernelImage = TInputImage,
97 typename TOutputImage = TInputImage,
98 typename TInternalPrecision = double>
99class ITK_TEMPLATE_EXPORT LandweberDeconvolutionImageFilter
100 : public IterativeDeconvolutionImageFilter<TInputImage, TKernelImage, TOutputImage, TInternalPrecision>
101{
102public:
103 ITK_DISALLOW_COPY_AND_MOVE(LandweberDeconvolutionImageFilter);
104
110
112 using InputImageType = TInputImage;
113 using KernelImageType = TKernelImage;
114 using OutputImageType = TOutputImage;
115
117 using typename Superclass::InternalImageType;
118 using typename Superclass::InternalImagePointerType;
119 using typename Superclass::InternalComplexType;
120 using typename Superclass::InternalComplexImageType;
121 using typename Superclass::InternalComplexImagePointerType;
122
124 itkNewMacro(Self);
125
127 itkOverrideGetNameOfClassMacro(LandweberDeconvolutionImageFilter);
128
130 itkSetMacro(Alpha, double);
131 itkGetMacro(Alpha, double);
134protected:
137
138 void
139 Initialize(ProgressAccumulator * progress, float progressWeight, float iterationProgressWeight) override;
140
141 void
142 Iteration(ProgressAccumulator * progress, float iterationProgressWeight) override;
143
144 void
145 Finish(ProgressAccumulator * progress, float progressWeight) override;
146
147 using typename Superclass::FFTFilterType;
148 using typename Superclass::IFFTFilterType;
149
150 void
151 PrintSelf(std::ostream & os, Indent indent) const override;
152
153private:
154 double m_Alpha{};
155
157
164
165 typename LandweberFilterType::Pointer m_LandweberFilter{};
166 typename IFFTFilterType::Pointer m_IFFTFilter{};
167};
168
169} // end namespace itk
170
171#ifndef ITK_MANUAL_INSTANTIATION
172# include "itkLandweberDeconvolutionImageFilter.hxx"
173#endif
174
175#endif
Functor class for computing a Landweber iteration.
bool operator==(const LandweberMethod &) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(LandweberMethod)
TOutput operator()(const TInput1 &estimateFT, const TInput2 &kernelFT, const TInput2 &inputFT) const
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Abstract base class for filters that implement iterative deconvolution algorithms.
Deconvolve an image using the Landweber deconvolution algorithm.
void Finish(ProgressAccumulator *progress, float progressWeight) override
void Initialize(ProgressAccumulator *progress, float progressWeight, float iterationProgressWeight) override
void Iteration(ProgressAccumulator *progress, float iterationProgressWeight) override
void PrintSelf(std::ostream &os, Indent indent) const override
Light weight base class for most itk classes.
Facilitates progress reporting for filters that wrap around multiple other filters.
Implements pixel-wise generic operation of three images or images with constants.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....