ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkTikhonovDeconvolutionImageFilter.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 itkTikhonovDeconvolutionImageFilter_h
19 #define itkTikhonovDeconvolutionImageFilter_h
20 
22 
23 namespace itk
24 {
49 template< typename TInputImage, typename TKernelImage = TInputImage, typename TOutputImage = TInputImage, typename TInternalPrecision=double >
51  public InverseDeconvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision >
52 {
53 public:
55  typedef InverseDeconvolutionImageFilter< TInputImage,
56  TKernelImage,
57  TOutputImage,
58  TInternalPrecision > Superclass;
61 
63  itkNewMacro(Self);
64 
67 
69  itkStaticConstMacro(ImageDimension, unsigned int,
70  TInputImage::ImageDimension);
71 
72  typedef TInputImage InputImageType;
73  typedef TOutputImage OutputImageType;
74  typedef TKernelImage KernelImageType;
88 
95 
100  itkSetMacro(RegularizationConstant, double);
101  itkGetConstMacro(RegularizationConstant, double);
103 
104 protected:
107 
109  void GenerateData() ITK_OVERRIDE;
110 
111  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
112 
113 private:
114  TikhonovDeconvolutionImageFilter(const Self &); //purposely not implemented
115  void operator=(const Self &); //purposely not implemented
116 
118 };
119 
120 namespace Functor
121 {
122 template< typename TInput1, typename TInput2, typename TOutput >
124 {
125 public:
126  TikhonovDeconvolutionFunctor() {m_RegularizationConstant = 0.0;}
128 
130  {
131  return false;
132  }
133  bool operator==( const TikhonovDeconvolutionFunctor & other) const
134  {
135  return !(*this != other);
136  }
137  inline TOutput operator()(const TInput1 & I, const TInput2 & H) const
138  {
139  typename TOutput::value_type normH = std::norm( H );
140  typename TOutput::value_type denominator = normH + m_RegularizationConstant;
141  TOutput value = NumericTraits< TOutput >::ZeroValue();
142  if ( denominator >= m_KernelZeroMagnitudeThreshold )
143  {
144  value = static_cast< TOutput >( I * ( std::conj( H ) / denominator ) );
145  }
146 
147  return value;
148  }
149 
152  void SetRegularizationConstant(double constant)
153  {
154  m_RegularizationConstant = constant;
155  }
157  {
159  }
161 
165  {
167  }
169  {
171  }
173 
174 private:
177 };
178 } //namespace Functor
179 
180 }
181 
182 #ifndef ITK_MANUAL_INSTANTIATION
183 #include "itkTikhonovDeconvolutionImageFilter.hxx"
184 #endif
185 
186 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::InternalImagePointerType InternalImagePointerType
An inverse deconvolution filter regularized in the Tikhonov sense.
Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
Superclass::InternalComplexImageType InternalComplexImageType
Base class for all process objects that output image data.
bool operator!=(const TikhonovDeconvolutionFunctor &) const
InverseDeconvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision > Superclass
bool operator==(const TikhonovDeconvolutionFunctor &other) const
Superclass::InternalComplexImagePointerType InternalComplexImagePointerType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::InternalImagePointerType InternalImagePointerType
TOutput operator()(const TInput1 &I, const TInput2 &H) const
The direct linear inverse deconvolution filter.
Superclass::InternalComplexImageType InternalComplexImageType