ITK  4.9.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 
26 
27 namespace itk
28 {
58 template< typename TInputImage, typename TKernelSource, typename TOutputImage=TInputImage >
60  public IterativeDeconvolutionImageFilter< TInputImage, typename TKernelSource::OutputImageType, TOutputImage >
61 {
62 public:
65  typedef IterativeDeconvolutionImageFilter< TInputImage,
66  typename TKernelSource::OutputImageType,
67  TOutputImage > Superclass;
70 
72  typedef TInputImage InputImageType;
73  typedef TOutputImage OutputImageType;
74 
81 
83  typedef TKernelSource KernelSourceType;
84  typedef typename KernelSourceType::Pointer KernelSourcePointer;
85 
87  itkNewMacro(Self);
88 
92 
94  void SetKernelSource(KernelSourceType * kernelSource);
95  itkGetModifiableObjectMacro(KernelSource, KernelSourceType);
97 
100  itkSetMacro(Alpha, double);
101  itkGetMacro(Alpha, double);
103 
106  itkSetMacro(Beta, double);
107  itkGetMacro(Beta, double);
109 
110 protected:
113 
114  virtual void Initialize(ProgressAccumulator * progress,
115  float progressWeight,
116  float iterationProgressWeight) ITK_OVERRIDE;
117 
118  virtual void Iteration(ProgressAccumulator * progress,
119  float iterationProgressWeight) ITK_OVERRIDE;
120 
121  virtual void Finish(ProgressAccumulator *progress, float progressWeight) ITK_OVERRIDE;
122 
123  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
124 
125 private:
126  ParametricBlindLeastSquaresDeconvolutionImageFilter(const Self &) ITK_DELETE_FUNCTION;
127  void operator=(const Self &) ITK_DELETE_FUNCTION;
128 
129  template< typename TPixel >
131  {
132  public:
135 
136  bool operator!=(const ParametricBlindLeastSquaresDeconvolutionDifference &) const
137  {
138  return false;
139  }
140 
141  bool operator==(const ParametricBlindLeastSquaresDeconvolutionDifference & other) const
142  {
143  return !( *this != other );
144  }
145 
146  inline TPixel operator()(const TPixel & estimateFT,
147  const TPixel & kernelEstimateFT,
148  const TPixel & inputFT)
149  {
150  return estimateFT * kernelEstimateFT - inputFT;
151  }
152  };
153 
154  template< typename TPixel >
156  {
157  public:
160 
162  {
163  return false;
164  }
165 
167  {
168  return !( *this != other );
169  }
170 
171  inline TPixel operator()(const TPixel & estimateFT,
172  const TPixel & differenceFT,
173  const TPixel & kernelFT)
174  {
175  // Because of the linearity of the Fourier transform, we can
176  // perform the update step in the Fourier domain
177  return estimateFT - m_Alpha * ( differenceFT * std::conj( kernelFT ) );
178  }
179 
180  void SetAlpha(double alpha)
181  {
182  m_Alpha = alpha;
183  }
184  double GetAlpha() const
185  {
186  return m_Alpha;
187  }
188 
189  private:
190  double m_Alpha;
191  };
192 
194 
198  double m_Alpha;
199  double m_Beta;
200 
204 
216 
226 
227 };
228 
229 } // end namespace itk
230 
231 #ifndef ITK_MANUAL_INSTANTIATION
232 #include "itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx"
233 #endif
234 
235 
236 #endif
TernaryFunctorImageFilter< InternalComplexImageType, InternalComplexImageType, InternalComplexImageType, InternalComplexImageType, DifferenceFunctorType > DifferenceFilterType
ParametricBlindLeastSquaresDeconvolutionImageUpdate< InternalComplexType > ImageUpdateFunctorType
IterativeDeconvolutionImageFilter< TInputImage, typename TKernelSource::OutputImageType, TOutputImage > Superclass
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Implements pixel-wise generic operation of three images.
TernaryFunctorImageFilter< InternalComplexImageType, InternalComplexImageType, InternalComplexImageType, InternalComplexImageType, ImageUpdateFunctorType > ImageUpdateFilterType
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...
virtual void Initialize(ProgressAccumulator *progress, float progressWeight, float iterationProgressWeight) override
virtual void Iteration(ProgressAccumulator *progress, float iterationProgressWeight) override
Superclass::InternalComplexImageType InternalComplexImageType
Superclass::InternalImagePointerType InternalImagePointerType
Facilitates progress reporting for filters that wrap around multiple other filters.
Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
ParametricBlindLeastSquaresDeconvolutionDifference< InternalComplexType > DifferenceFunctorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base class for filters that implement iterative deconvolution algorithms.
void SetKernelSource(KernelSourceType *kernelSource)
virtual void Finish(ProgressAccumulator *progress, float progressWeight) override