ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFFTWRealToHalfHermitianForwardFFTImageFilter.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 itkFFTWRealToHalfHermitianForwardFFTImageFilter_h
19#define itkFFTWRealToHalfHermitianForwardFFTImageFilter_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{
58template <typename TInputImage,
59 typename TOutputImage = Image<std::complex<typename TInputImage::PixelType>, TInputImage::ImageDimension>>
61 : public RealToHalfHermitianForwardFFTImageFilter<TInputImage, TOutputImage>
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(FFTWRealToHalfHermitianForwardFFTImageFilter);
65
67 using InputImageType = TInputImage;
68 using InputPixelType = typename InputImageType::PixelType;
69 using InputSizeType = typename InputImageType::SizeType;
70 using OutputImageType = TOutputImage;
71 using OutputPixelType = typename OutputImageType::PixelType;
72 using OutputSizeType = typename OutputImageType::SizeType;
73
78
85
87 itkNewMacro(Self);
88
90 itkOverrideGetNameOfClassMacro(FFTWRealToHalfHermitianForwardFFTImageFilter);
91
93 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
94
105 virtual void
106 SetPlanRigor(const int & value)
107 {
108#ifndef ITK_USE_CUFFTW
109 // Use that method to check the value
111#endif
112 if (m_PlanRigor != value)
113 {
114 m_PlanRigor = value;
115 this->Modified();
116 }
117 }
118 itkGetConstReferenceMacro(PlanRigor, int);
122
123protected:
126
127 void
128 GenerateData() override;
129
130 void
131 UpdateOutputData(DataObject * output) override;
132
133 void
134 PrintSelf(std::ostream & os, Indent indent) const override;
135
136private:
138
140};
141
142
143// Describe whether input/output are real- or complex-valued
144// for factory registration
145template <>
147{
148 template <typename TUnderlying>
149 using InputPixelType = TUnderlying;
150 template <typename TUnderlying>
151 using OutputPixelType = std::complex<TUnderlying>;
152 using FilterDimensions = std::integer_sequence<unsigned int, 4, 3, 2, 1>;
153};
154
155// Disable the precision whose FFTW backend is absent (avoids instantiating an undefined fftw proxy).
156#if !defined(ITK_USE_FFTWF)
157template <>
159{};
160#endif
161#if !defined(ITK_USE_FFTWD)
162template <>
163struct FFTImageFilterEnableDouble<FFTWRealToHalfHermitianForwardFFTImageFilter> : std::false_type
164{};
165#endif
166
167} // namespace itk
168
169#ifndef ITK_MANUAL_INSTANTIATION
170# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.hxx"
171#endif
172
173#endif // itkFFTWRealToHalfHermitianForwardFFTImageFilter_h
Base class for all data objects in ITK.
static std::string GetPlanRigorName(const int value)
RealToHalfHermitianForwardFFTImageFilter< TInputImage, TOutputImage > Superclass
~FFTWRealToHalfHermitianForwardFFTImageFilter() override=default
void UpdateOutputData(DataObject *output) override
void PrintSelf(std::ostream &os, Indent indent) const override
SizeValueType GetSizeGreatestPrimeFactor() const override
Templated n-dimensional image class.
Definition itkImage.h:89
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....
unsigned long SizeValueType
Definition itkIntTypes.h:86
Helper defining pixel traits for templated FFT image filters.