ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkTikhonovDeconvolutionImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
23namespace itk
24{
50template <typename TInputImage,
51 typename TKernelImage = TInputImage,
52 typename TOutputImage = TInputImage,
53 typename TInternalPrecision = double>
54class ITK_TEMPLATE_EXPORT TikhonovDeconvolutionImageFilter
55 : public InverseDeconvolutionImageFilter<TInputImage, TKernelImage, TOutputImage, TInternalPrecision>
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(TikhonovDeconvolutionImageFilter);
60
65
67 itkNewMacro(Self);
68
70 itkOverrideGetNameOfClassMacro(TikhonovDeconvolutionImageFilter);
71
73 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
74
75 using InputImageType = TInputImage;
76 using OutputImageType = TOutputImage;
77 using KernelImageType = TKernelImage;
78 using typename Superclass::InputPixelType;
79 using typename Superclass::OutputPixelType;
80 using typename Superclass::KernelPixelType;
81 using typename Superclass::InputIndexType;
82 using typename Superclass::OutputIndexType;
83 using typename Superclass::KernelIndexType;
84 using typename Superclass::InputSizeType;
85 using typename Superclass::OutputSizeType;
86 using typename Superclass::KernelSizeType;
87 using typename Superclass::SizeValueType;
88 using typename Superclass::InputRegionType;
89 using typename Superclass::OutputRegionType;
90 using typename Superclass::KernelRegionType;
91
93 using typename Superclass::InternalImageType;
98
103 itkSetMacro(RegularizationConstant, double);
104 itkGetConstMacro(RegularizationConstant, double);
106
107protected:
110
112 void
113 GenerateData() override;
114
115 void
116 PrintSelf(std::ostream & os, Indent indent) const override;
117
118private:
120};
121
122namespace Functor
123{
124template <typename TInput1, typename TInput2, typename TOutput>
125class ITK_TEMPLATE_EXPORT TikhonovDeconvolutionFunctor
126{
127public:
134
135 bool
137 {
138 return true;
139 }
140
142
143 inline TOutput
144 operator()(const TInput1 & I, const TInput2 & H) const
145 {
146 const typename TOutput::value_type normH = std::norm(H);
147 const typename TOutput::value_type denominator = normH + m_RegularizationConstant;
148 TOutput value{};
149 if (denominator >= m_KernelZeroMagnitudeThreshold)
150 {
151 value = static_cast<TOutput>(I * (std::conj(H) / denominator));
152 }
153
154 return value;
155 }
156
159 void
161 {
162 m_RegularizationConstant = constant;
163 }
164 double
169
170
173 void
178 double
183
184
185private:
188};
189} // namespace Functor
190
191} // namespace itk
192
193#ifndef ITK_MANUAL_INSTANTIATION
194# include "itkTikhonovDeconvolutionImageFilter.hxx"
195#endif
196
197#endif
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(TikhonovDeconvolutionFunctor)
bool operator==(const TikhonovDeconvolutionFunctor &) const
TOutput operator()(const TInput1 &I, const TInput2 &H) const
TikhonovDeconvolutionFunctor(const TikhonovDeconvolutionFunctor &f)
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
InverseDeconvolutionImageFilter< TInputImage, TKernelImage, TOutputImage, TInternalPrecision > Superclass
~TikhonovDeconvolutionImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....