ITK  6.0.0
Insight Toolkit
itkFFTWForwardFFTImageFilter.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 itkFFTWForwardFFTImageFilter_h
19#define itkFFTWForwardFFTImageFilter_h
20
22
23#include "itkFFTWCommon.h"
24
26
27namespace itk
28{
55template <typename TInputImage,
56 typename TOutputImage = Image<std::complex<typename TInputImage::PixelType>, TInputImage::ImageDimension>>
57class ITK_TEMPLATE_EXPORT FFTWForwardFFTImageFilter : public ForwardFFTImageFilter<TInputImage, TOutputImage>
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(FFTWForwardFFTImageFilter);
61
63 using InputImageType = TInputImage;
64 using InputPixelType = typename InputImageType::PixelType;
66 using OutputImageType = TOutputImage;
67 using OutputPixelType = typename OutputImageType::PixelType;
69
74
81
83 itkNewMacro(Self);
84
86 itkOverrideGetNameOfClassMacro(FFTWForwardFFTImageFilter);
87
89 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
90
101 virtual void
102 SetPlanRigor(const int & value)
103 {
104#ifndef ITK_USE_CUFFTW
105 // Use that method to check the value
107#endif
108 if (m_PlanRigor != value)
109 {
110 m_PlanRigor = value;
111 this->Modified();
112 }
113 }
114 itkGetConstReferenceMacro(PlanRigor, int);
119
120protected:
122 ~FFTWForwardFFTImageFilter() override = default;
123
124 void
125 GenerateData() override;
126
127 void
128 UpdateOutputData(DataObject * output) override;
129
130 void
131 PrintSelf(std::ostream & os, Indent indent) const override;
132
133private:
134 bool m_CanUseDestructiveAlgorithm{};
135
136 int m_PlanRigor{};
137};
138
139// Describe whether input/output are real- or complex-valued
140// for factory registration
141template <>
143{
144 template <typename TUnderlying>
145 using InputPixelType = TUnderlying;
146 template <typename TUnderlying>
147 using OutputPixelType = std::complex<TUnderlying>;
148 using FilterDimensions = std::integer_sequence<unsigned int, 4, 3, 2, 1>;
149};
150
151} // namespace itk
152
153#ifndef ITK_MANUAL_INSTANTIATION
154# include "itkFFTWForwardFFTImageFilter.hxx"
155#endif
156
157#endif // itkFFTWForwardFFTImageFilter_h
Base class for all data objects in ITK.
FFTW-based forward Fast Fourier Transform.
typename fftw::Proxy< InputPixelType > FFTWProxyType
typename InputImageType::PixelType InputPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
~FFTWForwardFFTImageFilter() override=default
void UpdateOutputData(DataObject *output) override
typename OutputImageType::PixelType OutputPixelType
typename InputImageType::SizeType InputSizeType
SizeValueType GetSizeGreatestPrimeFactor() const override
typename OutputImageType::SizeType OutputSizeType
virtual void SetPlanRigor(const int &value)
static std::string GetPlanRigorName(const int value)
Base class for forward Fast Fourier Transform.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
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.