ITK  4.3.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< class TInput1, class TInput2, class TInput3, class 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< class TInputImage, class TKernelImage=TInputImage, class TOutputImage=TInputImage, class 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 
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:
141 
142  virtual void Initialize(ProgressAccumulator * progress,
143  float progressWeight,
144  float iterationProgressWeight);
145 
146  virtual void Iteration(ProgressAccumulator * progress,
147  float iterationProgressWeight);
148 
149  virtual void Finish(ProgressAccumulator *progress, float progressWeight);
150 
151  typedef typename Superclass::FFTFilterType FFTFilterType;
153 
154  virtual void PrintSelf(std::ostream & os, Indent indent) const;
155 
156 private:
157  LandweberDeconvolutionImageFilter(const Self &); // purposely not implemented
158  void operator=(const Self &); //purposely not implemented
159 
160  double m_Alpha;
161 
163 
173 
176 };
177 
178 } // end namespace itk
179 
180 #ifndef ITK_MANUAL_INSTANTIATION
181 #include "itkLandweberDeconvolutionImageFilter.hxx"
182 #endif
183 
184 #endif
185