ITK  4.13.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 >
35 class ITK_TEMPLATE_EXPORT LandweberMethod
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 >
101 class ITK_TEMPLATE_EXPORT LandweberDeconvolutionImageFilter :
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 
120  typedef typename Superclass::InternalImageType InternalImageType;
121  typedef typename Superclass::InternalImagePointerType InternalImagePointerType;
122  typedef typename Superclass::InternalComplexType InternalComplexType;
123  typedef typename Superclass::InternalComplexImageType InternalComplexImageType;
125 
127  itkNewMacro(Self);
128 
132 
134  itkSetMacro(Alpha, double);
135  itkGetMacro(Alpha, double);
137 
138 protected:
140  virtual ~LandweberDeconvolutionImageFilter() ITK_OVERRIDE;
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  ITK_DISALLOW_COPY_AND_ASSIGN(LandweberDeconvolutionImageFilter);
158 
159  double m_Alpha;
160 
162 
163  typedef Functor::LandweberMethod< InternalComplexType,
164  InternalComplexType,
165  InternalComplexType,
166  InternalComplexType > LandweberFunctor;
168  InternalComplexImageType,
169  InternalComplexImageType,
170  InternalComplexImageType,
171  LandweberFunctor > LandweberFilterType;
172 
173  typename LandweberFilterType::Pointer m_LandweberFilter;
174  typename IFFTFilterType::Pointer m_IFFTFilter;
175 };
176 
177 } // end namespace itk
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkLandweberDeconvolutionImageFilter.hxx"
181 #endif
182 
183 #endif
Superclass::InternalImagePointerType InternalImagePointerType
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.
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
Facilitates progress reporting for filters that wrap around multiple other filters.
Deconvolve an image using the Landweber deconvolution algorithm.
bool operator!=(const LandweberMethod &) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base class for filters that implement iterative deconvolution algorithms.
Base class for specialized real-to-complex forward Fast Fourier Transform.
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