ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFFTConvolutionImageFilter.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 itkFFTConvolutionImageFilter_h
19#define itkFFTConvolutionImageFilter_h
20
22
27
28namespace itk
29{
53template <typename TInputImage,
54 typename TKernelImage = TInputImage,
55 typename TOutputImage = TInputImage,
56 typename TInternalPrecision = double>
57class ITK_TEMPLATE_EXPORT FFTConvolutionImageFilter
58 : public ConvolutionImageFilterBase<TInputImage, TKernelImage, TOutputImage>
59{
60public:
61 ITK_DISALLOW_COPY_AND_MOVE(FFTConvolutionImageFilter);
62
67
69 itkNewMacro(Self);
70
72 itkOverrideGetNameOfClassMacro(FFTConvolutionImageFilter);
73
75 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
76
77 using InputImageType = TInputImage;
78 using OutputImageType = TOutputImage;
79 using KernelImageType = TKernelImage;
80 using InputPixelType = typename InputImageType::PixelType;
81 using OutputPixelType = typename OutputImageType::PixelType;
82 using KernelPixelType = typename KernelImageType::PixelType;
83 using InputIndexType = typename InputImageType::IndexType;
84 using OutputIndexType = typename OutputImageType::IndexType;
85 using KernelIndexType = typename KernelImageType::IndexType;
86 using InputSizeType = typename InputImageType::SizeType;
87 using OutputSizeType = typename OutputImageType::SizeType;
88 using KernelSizeType = typename KernelImageType::SizeType;
89 using SizeValueType = typename InputSizeType::SizeValueType;
90 using InputRegionType = typename InputImageType::RegionType;
91 using OutputRegionType = typename OutputImageType::RegionType;
92 using KernelRegionType = typename KernelImageType::RegionType;
93
100 using InternalComplexType = std::complex<TInternalPrecision>;
103
106
107 itkSetMacro(SizeGreatestPrimeFactor, SizeValueType);
108 itkGetMacro(SizeGreatestPrimeFactor, SizeValueType);
109
110protected:
112 ~FFTConvolutionImageFilter() override = default;
113
118
125 void
127
129 void
130 GenerateData() override;
131
136 void
138 const KernelImageType * kernel,
139 InternalComplexImagePointerType & preparedInput,
140 InternalComplexImagePointerType & preparedKernel,
141 ProgressAccumulator * progress,
142 float progressWeight);
143
146 void
148 InternalComplexImagePointerType & preparedInput,
149 ProgressAccumulator * progress,
150 float progressWeight);
151
153 void
155 InternalImagePointerType & paddedInput,
156 ProgressAccumulator * progress,
157 float progressWeight);
158
160 void
162 InternalComplexImagePointerType & transformedInput,
163 ProgressAccumulator * progress,
164 float progressWeight);
165
169 void
171 InternalComplexImagePointerType & preparedKernel,
172 ProgressAccumulator * progress,
173 float progressWeight);
174
176 void
177 ProduceOutput(InternalComplexImageType * paddedOutput, ProgressAccumulator * progress, float progressWeight);
178
180 void
181 CropOutput(InternalImageType * paddedOutput, ProgressAccumulator * progress, float progressWeight);
182
187
196
198 [[nodiscard]] bool
200
201 void
202 PrintSelf(std::ostream & os, Indent indent) const override;
203
204private:
208};
209} // namespace itk
210
211#ifndef ITK_MANUAL_INSTANTIATION
212# include "itkFFTConvolutionImageFilter.hxx"
213#endif
214
215#endif
void CropOutput(InternalImageType *paddedOutput, ProgressAccumulator *progress, float progressWeight)
typename OutputImageType::IndexType OutputIndexType
KernelSizeType GetKernelRadius() const
typename InternalImageType::SizeType InternalSizeType
void TransformPaddedInput(const InternalImageType *paddedInput, InternalComplexImagePointerType &transformedInput, ProgressAccumulator *progress, float progressWeight)
void PrintSelf(std::ostream &os, Indent indent) const override
void PrepareInput(const InputImageType *input, InternalComplexImagePointerType &preparedInput, ProgressAccumulator *progress, float progressWeight)
typename KernelImageType::SizeType KernelSizeType
typename InternalImageType::IndexType InternalIndexType
typename OutputImageType::PixelType OutputPixelType
typename OutputImageType::RegionType OutputRegionType
void PrepareInputs(const InputImageType *input, const KernelImageType *kernel, InternalComplexImagePointerType &preparedInput, InternalComplexImagePointerType &preparedKernel, ProgressAccumulator *progress, float progressWeight)
void PadInput(const InputImageType *input, InternalImagePointerType &paddedInput, ProgressAccumulator *progress, float progressWeight)
typename InputImageType::IndexType InputIndexType
HalfHermitianToRealInverseFFTImageFilter< InternalComplexImageType, InternalImageType > IFFTFilterType
void ProduceOutput(InternalComplexImageType *paddedOutput, ProgressAccumulator *progress, float progressWeight)
typename InputImageType::PixelType InputPixelType
Image< TInternalPrecision, TInputImage::ImageDimension > InternalImageType
void GenerateInputRequestedRegion() override
RealToHalfHermitianForwardFFTImageFilter< InternalImageType, InternalComplexImageType > FFTFilterType
std::complex< TInternalPrecision > InternalComplexType
Image< InternalComplexType, TInputImage::ImageDimension > InternalComplexImageType
~FFTConvolutionImageFilter() override=default
InternalSizeType GetFFTPadSize() const
typename KernelImageType::IndexType KernelIndexType
typename OutputImageType::SizeType OutputSizeType
typename InputImageType::RegionType InputRegionType
typename InternalComplexImageType::Pointer InternalComplexImagePointerType
typename KernelImageType::RegionType KernelRegionType
void PrepareKernel(const KernelImageType *kernel, InternalComplexImagePointerType &preparedKernel, ProgressAccumulator *progress, float progressWeight)
typename KernelImageType::PixelType KernelPixelType
typename InputSizeType::SizeValueType SizeValueType
typename InternalImageType::RegionType InternalRegionType
ConvolutionImageFilterBase< TInputImage, TKernelImage, TOutputImage > Superclass
typename InternalImageType::Pointer InternalImagePointerType
typename InputImageType::SizeType InputSizeType
Base class for specialized complex-to-real inverse Fast Fourier Transform.
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:51
Facilitates progress reporting for filters that wrap around multiple other filters.
Base class for specialized real-to-complex forward Fast Fourier Transform.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....