ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFFTWComplexToComplexFFTImageFilter.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 itkFFTWComplexToComplexFFTImageFilter_h
19#define itkFFTWComplexToComplexFFTImageFilter_h
20
22#include "itkFFTWCommon.h"
23// Include fftw3.h directly: the proxy header skips it when first included before ITK_USE_FFTW* is defined.
24#if defined(ITK_USE_FFTWF) || defined(ITK_USE_FFTWD)
25# include "fftw3.h"
26#endif
27
29
30namespace itk
31{
62template <typename TInputImage, typename TOutputImage = TInputImage>
63class ITK_TEMPLATE_EXPORT FFTWComplexToComplexFFTImageFilter
64 : public ComplexToComplexFFTImageFilter<TInputImage, TOutputImage>
65{
66public:
67 ITK_DISALLOW_COPY_AND_MOVE(FFTWComplexToComplexFFTImageFilter);
68
74
75 using typename Superclass::ImageType;
76 using PixelType = typename ImageType::PixelType;
77 using typename Superclass::InputImageType;
78 using typename Superclass::OutputImageType;
79 using OutputImageRegionType = typename OutputImageType::RegionType;
80
81 // the proxy type is a wrapper for the fftw API
82 // since the proxy is only defined over double and float,
83 // trying to use any other pixel type is inoperative, as
84 // is trying to use double if only the float FFTW version is
85 // configured in, or float if only double is configured.
86 //
88
90 itkNewMacro(Self);
91
93 itkOverrideGetNameOfClassMacro(FFTWComplexToComplexFFTImageFilter);
94
95 static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
96
98 using ImageSizeType = typename ImageType::SizeType;
99
112 virtual void
113 SetPlanRigor(const int & value)
114 {
115#ifndef ITK_USE_CUFFTW
116 // use that method to check the value
118#endif
119 if (m_PlanRigor != value)
120 {
121 m_PlanRigor = value;
122 this->Modified();
123 }
124 }
125 itkGetConstReferenceMacro(PlanRigor, int);
126 void
127 SetPlanRigor(const std::string & name)
128 {
129#ifndef ITK_USE_CUFFTW
131#endif
132 }
133
134protected:
137
138 void
139 UpdateOutputData(DataObject * output) override;
140
141 void
143
144 void
145 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
146
147 void
148 PrintSelf(std::ostream & os, Indent indent) const override;
149
150private:
152
154};
155
156
157// Describe whether input/output are real- or complex-valued
158// for factory registration
159template <>
161{
162 template <typename TUnderlying>
163 using InputPixelType = std::complex<TUnderlying>;
164 template <typename TUnderlying>
165 using OutputPixelType = std::complex<TUnderlying>;
166 using FilterDimensions = std::integer_sequence<unsigned int, 4, 3, 2, 1>;
167};
168
169// Disable the precision whose FFTW backend is absent (avoids instantiating an undefined fftw proxy).
170#if !defined(ITK_USE_FFTWF)
171template <>
173{};
174#endif
175#if !defined(ITK_USE_FFTWD)
176template <>
177struct FFTImageFilterEnableDouble<FFTWComplexToComplexFFTImageFilter> : std::false_type
178{};
179#endif
180
181
182} // namespace itk
183
184#ifndef ITK_MANUAL_INSTANTIATION
185# include "itkFFTWComplexToComplexFFTImageFilter.hxx"
186#endif
187
188#endif // itkFFTWComplexToComplexFFTImageFilter_h
Base class for all data objects in ITK.
Implements an API to enable the Fourier transform or the inverse Fourier transform of images with com...
~FFTWComplexToComplexFFTImageFilter() override=default
typename fftw::Proxy< typename PixelType::value_type > FFTWProxyType
void UpdateOutputData(DataObject *output) override
void PrintSelf(std::ostream &os, Indent indent) const override
ComplexToComplexFFTImageFilter< TInputImage, TOutputImage > Superclass
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
static int GetPlanRigorValue(const std::string &name)
static std::string GetPlanRigorName(const int value)
Control indentation during Print() invocation.
Definition itkIndent.h:51
virtual void Modified() const
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Helper defining pixel traits for templated FFT image filters.