ITK  6.0.0
Insight Toolkit
itkFFTWHalfHermitianToRealInverseFFTImageFilter.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 itkFFTWHalfHermitianToRealInverseFFTImageFilter_h
19 #define itkFFTWHalfHermitianToRealInverseFFTImageFilter_h
20 
22 #include "itkFFTWCommon.h"
23 
25 
26 namespace itk
27 {
50 template <typename TInputImage,
51  typename TOutputImage = Image<typename TInputImage::PixelType::value_type, TInputImage::ImageDimension>>
53  : public HalfHermitianToRealInverseFFTImageFilter<TInputImage, TOutputImage>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_MOVE(FFTWHalfHermitianToRealInverseFFTImageFilter);
57 
59  using InputImageType = TInputImage;
60  using InputPixelType = typename InputImageType::PixelType;
62  using OutputImageType = TOutputImage;
63  using OutputPixelType = typename OutputImageType::PixelType;
66 
71 
78 
80  itkNewMacro(Self);
81 
83  itkOverrideGetNameOfClassMacro(FFTWHalfHermitianToRealInverseFFTImageFilter);
84 
86  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
87 
97  virtual void
98  SetPlanRigor(const int & value)
99  {
100 #ifndef ITK_USE_CUFFTW
101  // Use that method to check the value.
103 #endif
104  if (m_PlanRigor != value)
105  {
106  m_PlanRigor = value;
107  this->Modified();
108  }
109  }
110  itkGetConstReferenceMacro(PlanRigor, int);
111  void
112  SetPlanRigor(const std::string & name)
113  {
114 #ifndef ITK_USE_CUFFTW
115  this->SetPlanRigor(FFTWGlobalConfiguration::GetPlanRigorValue(name));
116 #endif
117  }
121  GetSizeGreatestPrimeFactor() const override;
122 
123 protected:
125  ~FFTWHalfHermitianToRealInverseFFTImageFilter() override = default;
126 
127  void
128  UpdateOutputData(DataObject * output) override;
129 
130  void
131  BeforeThreadedGenerateData() override;
132 
133  void
134  DynamicThreadedGenerateData(const OutputRegionType & outputRegionForThread) override;
135 
136  void
137  PrintSelf(std::ostream & os, Indent indent) const override;
138 
139 private:
140  bool m_CanUseDestructiveAlgorithm{};
141 
142  int m_PlanRigor{};
143 };
144 
145 
146 // Describe whether input/output are real- or complex-valued
147 // for factory registration
148 template <>
150 {
151  template <typename TUnderlying>
152  using InputPixelType = std::complex<TUnderlying>;
153  template <typename TUnderlying>
154  using OutputPixelType = TUnderlying;
155  using FilterDimensions = std::integer_sequence<unsigned int, 4, 3, 2, 1>;
156 };
157 
158 } // namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 # include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.hxx"
162 #endif
163 
164 #endif // itkFFTWHalfHermitianToRealInverseFFTImageFilter_h
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::OutputRegionType
typename OutputImageType::RegionType OutputRegionType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:64
itk::FFTWHalfHermitianToRealInverseFFTImageFilter
FFTW-based reverse Fast Fourier Transform.
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:52
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:61
itk::FFTWGlobalConfiguration::GetPlanRigorName
static std::string GetPlanRigorName(const int value)
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
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::FFTWHalfHermitianToRealInverseFFTImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:63
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::FFTWProxyType
typename fftw::Proxy< OutputPixelType > FFTWProxyType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:77
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::OutputSizeType
typename OutputImageType::SizeType OutputSizeType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:65
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::SetPlanRigor
void SetPlanRigor(const std::string &name)
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:112
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::SetPlanRigor
virtual void SetPlanRigor(const int &value)
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:98
itk::FFTWGlobalConfiguration::GetPlanRigorValue
static int GetPlanRigorValue(const std::string &name)
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkHalfHermitianToRealInverseFFTImageFilter.h
itk::FFTImageFilterTraits< FFTWHalfHermitianToRealInverseFFTImageFilter >::FilterDimensions
std::integer_sequence< unsigned int, 4, 3, 2, 1 > FilterDimensions
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:155
itkFFTWCommon.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::FFTWHalfHermitianToRealInverseFFTImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:60
itkFFTImageFilterFactory.h
itk::HalfHermitianToRealInverseFFTImageFilter
Base class for specialized complex-to-real inverse Fast Fourier Transform.
Definition: itkHalfHermitianToRealInverseFFTImageFilter.h:57
itk::FFTImageFilterTraits< FFTWHalfHermitianToRealInverseFFTImageFilter >::OutputPixelType
TUnderlying OutputPixelType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:154
itk::fftw::Proxy
Definition: itkFFTWCommon.h:54
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::FFTImageFilterTraits< FFTWHalfHermitianToRealInverseFFTImageFilter >::InputPixelType
std::complex< TUnderlying > InputPixelType
Definition: itkFFTWHalfHermitianToRealInverseFFTImageFilter.h:152