ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkInverseDeconvolutionImageFilter.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 __itkInverseDeconvolutionImageFilter_h
19 #define __itkInverseDeconvolutionImageFilter_h
20 
22 
23 namespace itk
24 {
53 template< typename TInputImage, typename TKernelImage = TInputImage, typename TOutputImage = TInputImage, typename TInternalPrecision=double >
55  public FFTConvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision >
56 {
57 public:
59  typedef FFTConvolutionImageFilter< TInputImage,
60  TKernelImage,
61  TOutputImage,
62  TInternalPrecision > Superclass;
65 
67  itkNewMacro(Self);
68 
71 
73  itkStaticConstMacro(ImageDimension, unsigned int,
74  TInputImage::ImageDimension);
75 
76  typedef TInputImage InputImageType;
77  typedef TOutputImage OutputImageType;
78  typedef TKernelImage KernelImageType;
92 
99 
103  itkSetMacro(KernelZeroMagnitudeThreshold, double);
104  itkGetConstMacro(KernelZeroMagnitudeThreshold, double);
106 
107 protected:
110 
112  void GenerateData();
113 
114  virtual void PrintSelf(std::ostream & os, Indent indent) const;
115 
116 private:
117  InverseDeconvolutionImageFilter(const Self &); //purposely not implemented
118  void operator=(const Self &); //purposely not implemented
119 
121 };
122 
123 namespace Functor
124 {
125 template< typename TInput1, typename TInput2, typename TOutput >
127 {
128 public:
131 
133  {
134  return false;
135  }
136  bool operator==( const InverseDeconvolutionFunctor & other) const
137  {
138  return !(*this != other);
139  }
140  inline TOutput operator()(const TInput1 & I, const TInput2 & H) const
141  {
142  double absH = std::abs( H );
143  TOutput value = NumericTraits< TOutput >::ZeroValue();
144  if ( absH >= m_KernelZeroMagnitudeThreshold )
145  {
146  value = static_cast< TOutput >( I / H );
147  }
148  return value;
149  }
150 
154  {
156  }
158  {
160  }
162 
163 private:
165 };
166 } //namespace Functor
167 
168 }
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkInverseDeconvolutionImageFilter.hxx"
172 #endif
173 
174 #endif
OutputImageType::RegionType OutputRegionType
InputImageType::RegionType InputRegionType
virtual void PrintSelf(std::ostream &os, Indent indent) const
TOutput operator()(const TInput1 &I, const TInput2 &H) const
InternalComplexImageType::Pointer InternalComplexImagePointerType
InputSizeType::SizeValueType SizeValueType
Base class for all process objects that output image data.
InternalImageType::Pointer InternalImagePointerType
Convolve a given image with an arbitrary image kernel using multiplication in the Fourier domain...
bool operator!=(const InverseDeconvolutionFunctor &) const
Image< InternalComplexType, TInputImage::ImageDimension > InternalComplexImageType
KernelImageType::RegionType KernelRegionType
FFTConvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision > Superclass
OutputImageType::PixelType OutputPixelType
Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
bool operator==(const InverseDeconvolutionFunctor &other) const
OutputImageType::IndexType OutputIndexType
KernelImageType::IndexType KernelIndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::InternalImagePointerType InternalImagePointerType
KernelImageType::PixelType KernelPixelType
Image< TInternalPrecision, TInputImage::ImageDimension > InternalImageType
The direct linear inverse deconvolution filter.
std::complex< TInternalPrecision > InternalComplexType
Superclass::InternalComplexImageType InternalComplexImageType