ITK  4.13.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 
76  typedef typename Superclass::InternalImageType InternalImageType;
77  typedef typename Superclass::InternalImagePointerType InternalImagePointerType;
78  typedef typename Superclass::InternalComplexType InternalComplexType;
79  typedef typename Superclass::InternalComplexImageType InternalComplexImageType;
80  typedef typename Superclass::InternalComplexImagePointerType InternalComplexImagePointerType;
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  ITK_DISALLOW_COPY_AND_ASSIGN(ParametricBlindLeastSquaresDeconvolutionImageFilter);
127 
128  template< typename TPixel >
130  {
131  public:
134 
135  bool operator!=(const ParametricBlindLeastSquaresDeconvolutionDifference &) const
136  {
137  return false;
138  }
139 
140  bool operator==(const ParametricBlindLeastSquaresDeconvolutionDifference & other) const
141  {
142  return !( *this != other );
143  }
144 
145  inline TPixel operator()(const TPixel & estimateFT,
146  const TPixel & kernelEstimateFT,
147  const TPixel & inputFT)
148  {
149  return estimateFT * kernelEstimateFT - inputFT;
150  }
151  };
152 
153  template< typename TPixel >
155  {
156  public:
159 
161  {
162  return false;
163  }
164 
166  {
167  return !( *this != other );
168  }
169 
170  inline TPixel operator()(const TPixel & estimateFT,
171  const TPixel & differenceFT,
172  const TPixel & kernelFT)
173  {
174  // Because of the linearity of the Fourier transform, we can
175  // perform the update step in the Fourier domain
176  return estimateFT - m_Alpha * ( differenceFT * std::conj( kernelFT ) );
177  }
178 
179  void SetAlpha(double alpha)
180  {
181  m_Alpha = alpha;
182  }
183  double GetAlpha() const
184  {
185  return m_Alpha;
186  }
187 
188  private:
189  double m_Alpha;
190  };
191 
193 
197  double m_Alpha;
198  double m_Beta;
199 
203 
215 
225 
226 };
227 
228 } // end namespace itk
229 
230 #ifndef ITK_MANUAL_INSTANTIATION
231 #include "itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx"
232 #endif
233 
234 
235 #endif
TernaryFunctorImageFilter< InternalComplexImageType, InternalComplexImageType, InternalComplexImageType, InternalComplexImageType, DifferenceFunctorType > DifferenceFilterType
ParametricBlindLeastSquaresDeconvolutionImageUpdate< InternalComplexType > ImageUpdateFunctorType
IterativeDeconvolutionImageFilter< TInputImage, typename TKernelSource::OutputImageType, TOutputImage > Superclass
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...
Facilitates progress reporting for filters that wrap around multiple other filters.
ParametricBlindLeastSquaresDeconvolutionDifference< InternalComplexType > DifferenceFunctorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base class for filters that implement iterative deconvolution algorithms.