ITK  6.0.0
Insight Toolkit
itkFFTWInverseFFTImageFilter.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 itkFFTWInverseFFTImageFilter_h
19#define itkFFTWInverseFFTImageFilter_h
20
22#include "itkFFTWCommon.h"
23
25
26namespace itk
27{
49template <typename TInputImage,
50 typename TOutputImage = Image<typename TInputImage::PixelType::value_type, TInputImage::ImageDimension>>
51class ITK_TEMPLATE_EXPORT FFTWInverseFFTImageFilter : public InverseFFTImageFilter<TInputImage, TOutputImage>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(FFTWInverseFFTImageFilter);
55
57 using InputImageType = TInputImage;
58 using InputPixelType = typename InputImageType::PixelType;
60 using OutputImageType = TOutputImage;
61 using OutputPixelType = typename OutputImageType::PixelType;
63
68
75
77
79 itkNewMacro(Self);
80
82 itkOverrideGetNameOfClassMacro(FFTWInverseFFTImageFilter);
83
85 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
86
96 virtual void
97 SetPlanRigor(const int & value)
98 {
99#ifndef ITK_USE_CUFFTW
100 // Use that method to check the value.
102#endif
103 if (m_PlanRigor != value)
104 {
105 m_PlanRigor = value;
106 this->Modified();
107 }
108 }
109 itkGetConstReferenceMacro(PlanRigor, int);
110 void
111 SetPlanRigor(const std::string & name)
112 {
113#ifndef ITK_USE_CUFFTW
114 this->SetPlanRigor(FFTWGlobalConfiguration::GetPlanRigorValue(name));
115#endif
116 }
121
122protected:
124 ~FFTWInverseFFTImageFilter() override = default;
125
126 void
128
129 void
130 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
131
132 void
133 PrintSelf(std::ostream & os, Indent indent) const override;
134
135private:
136 int m_PlanRigor{};
137};
138
139
140// Describe whether input/output are real- or complex-valued
141// for factory registration
142template <>
144{
145 template <typename TUnderlying>
146 using InputPixelType = std::complex<TUnderlying>;
147 template <typename TUnderlying>
148 using OutputPixelType = TUnderlying;
149 using FilterDimensions = std::integer_sequence<unsigned int, 4, 3, 2, 1>;
150};
151
152} // namespace itk
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "itkFFTWInverseFFTImageFilter.hxx"
156#endif
157
158#endif // itkFFTWInverseFFTImageFilter_h
static int GetPlanRigorValue(const std::string &name)
static std::string GetPlanRigorName(const int value)
FFTW-based inverse Fast Fourier Transform.
~FFTWInverseFFTImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputImageType::RegionType OutputImageRegionType
typename fftw::Proxy< OutputPixelType > FFTWProxyType
SizeValueType GetSizeGreatestPrimeFactor() const override
typename OutputImageType::SizeType OutputSizeType
void BeforeThreadedGenerateData() override
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
typename InputImageType::SizeType InputSizeType
virtual void SetPlanRigor(const int &value)
typename InputImageType::PixelType InputPixelType
void SetPlanRigor(const std::string &name)
typename OutputImageType::PixelType OutputPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for inverse Fast Fourier Transform.
Light weight base class for most itk classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86
std::integer_sequence< unsigned int, 4, 3, 2, 1 > FilterDimensions
Helper defining pixel traits for templated FFT image filters.