ITK  5.4.0
Insight Toolkit
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 
25 
26 namespace itk
27 {
54 template <typename TInputImage,
55  typename TOutputImage = Image<std::complex<typename TInputImage::PixelType>, TInputImage::ImageDimension>>
57  : public RealToHalfHermitianForwardFFTImageFilter<TInputImage, TOutputImage>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_MOVE(FFTWRealToHalfHermitianForwardFFTImageFilter);
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(FFTWRealToHalfHermitianForwardFFTImageFilter);
87 
89  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
90 
100  virtual void
101  SetPlanRigor(const int & value)
102  {
103 #ifndef ITK_USE_CUFFTW
104  // Use that method to check the value
106 #endif
107  if (m_PlanRigor != value)
108  {
109  m_PlanRigor = value;
110  this->Modified();
111  }
112  }
113  itkGetConstReferenceMacro(PlanRigor, int);
117  GetSizeGreatestPrimeFactor() const override;
118 
119 protected:
121  ~FFTWRealToHalfHermitianForwardFFTImageFilter() override = default;
122 
123  void
124  GenerateData() override;
125 
126  void
127  UpdateOutputData(DataObject * output) override;
128 
129  void
130  PrintSelf(std::ostream & os, Indent indent) const override;
131 
132 private:
133  bool m_CanUseDestructiveAlgorithm{};
134 
135  int m_PlanRigor{};
136 };
137 
138 
139 // Describe whether input/output are real- or complex-valued
140 // for factory registration
141 template <>
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 "itkFFTWRealToHalfHermitianForwardFFTImageFilter.hxx"
155 #endif
156 
157 #endif // itkFFTWRealToHalfHermitianForwardFFTImageFilter_h
itk::FFTWRealToHalfHermitianForwardFFTImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:64
itk::FFTImageFilterTraits< FFTWRealToHalfHermitianForwardFFTImageFilter >::OutputPixelType
std::complex< TUnderlying > OutputPixelType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:147
itk::FFTWRealToHalfHermitianForwardFFTImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:65
itk::FFTWGlobalConfiguration::GetPlanRigorName
static std::string GetPlanRigorName(const int value)
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itkRealToHalfHermitianForwardFFTImageFilter.h
itk::RealToHalfHermitianForwardFFTImageFilter
Base class for specialized real-to-complex forward Fast Fourier Transform.
Definition: itkRealToHalfHermitianForwardFFTImageFilter.h:57
itk::FFTImageFilterTraits
Helper defining pixel traits for templated FFT image filters.
Definition: itkFFTImageFilterFactory.h:42
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::FFTWRealToHalfHermitianForwardFFTImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:67
itk::FFTImageFilterTraits< FFTWRealToHalfHermitianForwardFFTImageFilter >::FilterDimensions
std::integer_sequence< unsigned int, 4, 3, 2, 1 > FilterDimensions
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:148
itk::FFTWRealToHalfHermitianForwardFFTImageFilter::FFTWProxyType
typename fftw::Proxy< InputPixelType > FFTWProxyType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:80
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkFFTWCommon.h
itk::FFTWRealToHalfHermitianForwardFFTImageFilter::OutputSizeType
typename OutputImageType::SizeType OutputSizeType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:68
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::FFTImageFilterTraits< FFTWRealToHalfHermitianForwardFFTImageFilter >::InputPixelType
TUnderlying InputPixelType
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:145
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itkFFTImageFilterFactory.h
itk::FFTWRealToHalfHermitianForwardFFTImageFilter::SetPlanRigor
virtual void SetPlanRigor(const int &value)
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:101
itk::FFTWRealToHalfHermitianForwardFFTImageFilter
FFTW-based forward Fast Fourier Transform.
Definition: itkFFTWRealToHalfHermitianForwardFFTImageFilter.h:56
itk::fftw::Proxy
Definition: itkFFTWCommon.h:54
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293