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 
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  bool
40  operator==(const LandweberMethod &) const
41  {
42  return true;
43  }
44 
45  ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(LandweberMethod);
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 
95 template <typename TInputImage,
96  typename TKernelImage = TInputImage,
97  typename TOutputImage = TInputImage,
98  typename TInternalPrecision = double>
99 class ITK_TEMPLATE_EXPORT LandweberDeconvolutionImageFilter
100  : public IterativeDeconvolutionImageFilter<TInputImage, TKernelImage, TOutputImage, TInternalPrecision>
101 {
102 public:
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);
134 protected:
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 
153 private:
154  double m_Alpha{};
155 
156  InternalComplexImagePointerType m_TransformedInput{};
157 
158  using LandweberFunctor =
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
itk::Functor::LandweberMethod::operator==
bool operator==(const LandweberMethod &) const
Definition: itkLandweberDeconvolutionImageFilter.h:40
itk::Functor::LandweberMethod::m_Alpha
TInput1::value_type m_Alpha
Definition: itkLandweberDeconvolutionImageFilter.h:54
itk::ConvolutionImageFilterBase::KernelImageType
TKernelImage KernelImageType
Definition: itkConvolutionImageFilterBase.h:75
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:158
itk::Functor::LandweberMethod
Functor class for computing a Landweber iteration.
Definition: itkLandweberDeconvolutionImageFilter.h:36
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:99
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:48
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
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