ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkLandweberDeconvolutionImageFilter.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 itkLandweberDeconvolutionImageFilter_h
19 #define itkLandweberDeconvolutionImageFilter_h
20 
22 
25 
26 namespace itk
27 {
28 namespace Functor
29 {
34 template< typename TInput1, typename TInput2, typename TInput3, typename TOutput >
36 {
37 public:
40 
41  bool operator!=(const LandweberMethod &) const
42  {
43  return false;
44  }
45 
46  bool operator==(const LandweberMethod & other) const
47  {
48  return !( *this != other );
49  }
50 
51  inline TOutput operator()(const TInput1 & estimateFT,
52  const TInput2 & kernelFT,
53  const TInput2 & inputFT) const
54  {
55  return m_Alpha * std::conj( kernelFT ) * inputFT +
56  ( NumericTraits< typename TInput1::value_type >::OneValue() - m_Alpha * std::norm( kernelFT ) ) * estimateFT;
57  }
58 
59  typename TInput1::value_type m_Alpha;
60 
61 };
62 } // end namespace Functor
63 
100 template< typename TInputImage, typename TKernelImage=TInputImage, typename TOutputImage=TInputImage, typename TInternalPrecision=double >
102  public IterativeDeconvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision >
103 {
104 public:
107  typedef IterativeDeconvolutionImageFilter< TInputImage,
108  TKernelImage,
109  TOutputImage,
110  TInternalPrecision > Superclass;
113 
115  typedef TInputImage InputImageType;
116  typedef TKernelImage KernelImageType;
117  typedef TOutputImage OutputImageType;
118 
125 
127  itkNewMacro(Self);
128 
132 
134  itkSetMacro(Alpha, double);
135  itkGetMacro(Alpha, double);
137 
138 protected:
141 
142  virtual void Initialize(ProgressAccumulator * progress,
143  float progressWeight,
144  float iterationProgressWeight) ITK_OVERRIDE;
145 
146  virtual void Iteration(ProgressAccumulator * progress,
147  float iterationProgressWeight) ITK_OVERRIDE;
148 
149  virtual void Finish(ProgressAccumulator *progress, float progressWeight) ITK_OVERRIDE;
150 
153 
154  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
155 
156 private:
157  LandweberDeconvolutionImageFilter(const Self &) ITK_DELETE_FUNCTION;
158  void operator=(const Self &) ITK_DELETE_FUNCTION;
159 
160  double m_Alpha;
161 
163 
164  typedef Functor::LandweberMethod< InternalComplexType,
165  InternalComplexType,
166  InternalComplexType,
167  InternalComplexType > LandweberFunctor;
169  InternalComplexImageType,
170  InternalComplexImageType,
171  InternalComplexImageType,
172  LandweberFunctor > LandweberFilterType;
173 
174  typename LandweberFilterType::Pointer m_LandweberFilter;
176 };
177 
178 } // end namespace itk
179 
180 #ifndef ITK_MANUAL_INSTANTIATION
181 #include "itkLandweberDeconvolutionImageFilter.hxx"
182 #endif
183 
184 #endif
Superclass::InternalImagePointerType InternalImagePointerType
Implements pixel-wise generic operation of three images.
Base class for all process objects that output image data.
virtual void Initialize(ProgressAccumulator *progress, float progressWeight, float iterationProgressWeight) override
Base class for specialized complex-to-real inverse Fast Fourier Transform.
bool operator==(const LandweberMethod &other) const
IterativeDeconvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision > Superclass
Superclass::InternalComplexImageType InternalComplexImageType
Superclass::InternalComplexImageType InternalComplexImageType
Superclass::InternalImagePointerType InternalImagePointerType
Facilitates progress reporting for filters that wrap around multiple other filters.
Deconvolve an image using the Landweber deconvolution algorithm.
virtual void Iteration(ProgressAccumulator *progress, float iterationProgressWeight) override
bool operator!=(const LandweberMethod &) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base class for filters that implement iterative deconvolution algorithms.
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
TOutput operator()(const TInput1 &estimateFT, const TInput2 &kernelFT, const TInput2 &inputFT) const
Functor class for computing a Landweber iteration.
Templated n-dimensional image class.
Definition: itkImage.h:75
std::complex< TInternalPrecision > InternalComplexType
virtual void Finish(ProgressAccumulator *progress, float progressWeight) override