ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkParametricBlindLeastSquaresDeconvolutionImageFilter.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 itkParametricBlindLeastSquaresDeconvolutionImageFilter_h
19 #define itkParametricBlindLeastSquaresDeconvolutionImageFilter_h
20 
22 
25 
26 namespace itk
27 {
57 template< typename TInputImage, typename TKernelSource, typename TOutputImage=TInputImage >
59  public IterativeDeconvolutionImageFilter< TInputImage, typename TKernelSource::OutputImageType, TOutputImage >
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_ASSIGN(ParametricBlindLeastSquaresDeconvolutionImageFilter);
63 
66  using Superclass = IterativeDeconvolutionImageFilter< TInputImage,
67  typename TKernelSource::OutputImageType,
68  TOutputImage >;
71 
73  using InputImageType = TInputImage;
74  using OutputImageType = TOutputImage;
75 
77  using InternalImageType = typename Superclass::InternalImageType;
78  using InternalImagePointerType = typename Superclass::InternalImagePointerType;
79  using InternalComplexType = typename Superclass::InternalComplexType;
80  using InternalComplexImageType = typename Superclass::InternalComplexImageType;
82 
84  using KernelSourceType = TKernelSource;
85  using KernelSourcePointer = typename KernelSourceType::Pointer;
86 
88  itkNewMacro(Self);
89 
93 
95  void SetKernelSource(KernelSourceType * kernelSource);
96  itkGetModifiableObjectMacro(KernelSource, KernelSourceType);
98 
101  itkSetMacro(Alpha, double);
102  itkGetMacro(Alpha, double);
104 
107  itkSetMacro(Beta, double);
108  itkGetMacro(Beta, double);
110 
111 protected:
114 
115  void Initialize(ProgressAccumulator * progress,
116  float progressWeight,
117  float iterationProgressWeight) override;
118 
119  void Iteration(ProgressAccumulator * progress,
120  float iterationProgressWeight) override;
121 
122  void Finish(ProgressAccumulator *progress, float progressWeight) override;
123 
124  void PrintSelf(std::ostream & os, Indent indent) const override;
125 
126 private:
127  template< typename TPixel >
129  {
130  public:
133 
135  {
136  return false;
137  }
138 
140  {
141  return !( *this != other );
142  }
143 
144  inline TPixel operator()(const TPixel & estimateFT,
145  const TPixel & kernelEstimateFT,
146  const TPixel & inputFT)
147  {
148  return estimateFT * kernelEstimateFT - inputFT;
149  }
150  };
151 
152  template< typename TPixel >
154  {
155  public:
158 
160  {
161  return false;
162  }
163 
165  {
166  return !( *this != other );
167  }
168 
169  inline TPixel operator()(const TPixel & estimateFT,
170  const TPixel & differenceFT,
171  const TPixel & kernelFT)
172  {
173  // Because of the linearity of the Fourier transform, we can
174  // perform the update step in the Fourier domain
175  return estimateFT - m_Alpha * ( differenceFT * std::conj( kernelFT ) );
176  }
177 
178  void SetAlpha(double alpha)
179  {
180  m_Alpha = alpha;
181  }
182  double GetAlpha() const
183  {
184  return m_Alpha;
185  }
186 
187  private:
188  double m_Alpha{0.01};
189  };
190 
192 
196  double m_Alpha;
197  double m_Beta;
198 
202 
212 
220 
221 };
222 
223 } // end namespace itk
224 
225 #ifndef ITK_MANUAL_INSTANTIATION
226 #include "itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx"
227 #endif
228 
229 
230 #endif
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.
Least-squares blind deconvolution filter that also estimates the parameters of a user-supplied parame...
TOutputImage OutputImageType
Facilitates progress reporting for filters that wrap around multiple other filters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base class for filters that implement iterative deconvolution algorithms.