18#ifndef itkFFTWCommonExtended_h
19#define itkFFTWCommonExtended_h
21#if defined(ITK_USE_FFTWF) || defined(ITK_USE_FFTWD)
22# if defined(ITK_USE_CUFFTW)
44template <
typename TPixel>
54#if defined(ITK_USE_FFTWF)
60 using PixelType = float;
61 using ComplexType = fftwf_complex;
62 using PlanType = fftwf_plan;
66 Plan_dft_c2r_1d(
int n, ComplexType * in, PixelType * out,
unsigned int flags, [[maybe_unused]]
int threads = 1)
68# ifndef ITK_USE_CUFFTW
70 fftwf_plan_with_nthreads(threads);
72 PlanType plan = fftwf_plan_dft_c2r_1d(n, in, out, flags);
76 Plan_dft_c2r_2d(
int nx,
81 [[maybe_unused]]
int threads = 1)
83# ifndef ITK_USE_CUFFTW
85 fftwf_plan_with_nthreads(threads);
87 PlanType plan = fftwf_plan_dft_c2r_2d(nx, ny, in, out, flags);
91 Plan_dft_c2r_3d(
int nx,
97 [[maybe_unused]]
int threads = 1)
99# ifndef ITK_USE_CUFFTW
101 fftwf_plan_with_nthreads(threads);
103 PlanType plan = fftwf_plan_dft_c2r_3d(nx, ny, nz, in, out, flags);
107 Plan_dft_c2r(
int rank,
112 [[maybe_unused]]
int threads = 1)
114# ifndef ITK_USE_CUFFTW
116 fftwf_plan_with_nthreads(threads);
118 PlanType plan = fftwf_plan_dft_c2r(rank, n, in, out, flags);
123 Plan_dft_r2c_1d(
int n, PixelType * in, ComplexType * out,
unsigned int flags, [[maybe_unused]]
int threads = 1)
125# ifndef ITK_USE_CUFFTW
127 fftwf_plan_with_nthreads(threads);
129 PlanType plan = fftwf_plan_dft_r2c_1d(n, in, out, flags);
133 Plan_dft_r2c_2d(
int nx,
138 [[maybe_unused]]
int threads = 1)
140# ifndef ITK_USE_CUFFTW
142 fftwf_plan_with_nthreads(threads);
144 PlanType plan = fftwf_plan_dft_r2c_2d(nx, ny, in, out, flags);
148 Plan_dft_r2c_3d(
int nx,
154 [[maybe_unused]]
int threads = 1)
156# ifndef ITK_USE_CUFFTW
158 fftwf_plan_with_nthreads(threads);
160 PlanType plan = fftwf_plan_dft_r2c_3d(nx, ny, nz, in, out, flags);
164 Plan_dft_r2c(
int rank,
169 [[maybe_unused]]
int threads = 1)
171# ifndef ITK_USE_CUFFTW
173 fftwf_plan_with_nthreads(threads);
175 PlanType plan = fftwf_plan_dft_r2c(rank, n, in, out, flags);
179 Plan_dft_1d(
const int n,
184 [[maybe_unused]]
int threads = 1)
186# ifndef ITK_USE_CUFFTW
188 fftwf_plan_with_nthreads(threads);
190 PlanType plan = fftwf_plan_dft_1d(n, in, out, sign, flags);
201 DestroyPlan(PlanType p)
203 fftwf_destroy_plan(p);
210#if defined(ITK_USE_FFTWD)
215 using PixelType = double;
216 using ComplexType = fftw_complex;
217 using PlanType = fftw_plan;
221 Plan_dft_c2r_1d(
int n, ComplexType * in, PixelType * out,
unsigned int flags, [[maybe_unused]]
int threads = 1)
223# ifndef ITK_USE_CUFFTW
225 fftw_plan_with_nthreads(threads);
227 PlanType plan = fftw_plan_dft_c2r_1d(n, in, out, flags);
231 Plan_dft_c2r_2d(
int nx,
236 [[maybe_unused]]
int threads = 1)
238# ifndef ITK_USE_CUFFTW
240 fftw_plan_with_nthreads(threads);
242 PlanType plan = fftw_plan_dft_c2r_2d(nx, ny, in, out, flags);
246 Plan_dft_c2r_3d(
int nx,
252 [[maybe_unused]]
int threads = 1)
254# ifndef ITK_USE_CUFFTW
256 fftw_plan_with_nthreads(threads);
258 PlanType plan = fftw_plan_dft_c2r_3d(nx, ny, nz, in, out, flags);
262 Plan_dft_c2r(
int rank,
267 [[maybe_unused]]
int threads = 1)
269# ifndef ITK_USE_CUFFTW
271 fftw_plan_with_nthreads(threads);
273 PlanType plan = fftw_plan_dft_c2r(rank, n, in, out, flags);
278 Plan_dft_r2c_1d(
int n, PixelType * in, ComplexType * out,
unsigned int flags, [[maybe_unused]]
int threads = 1)
280# ifndef ITK_USE_CUFFTW
282 fftw_plan_with_nthreads(threads);
284 PlanType plan = fftw_plan_dft_r2c_1d(n, in, out, flags);
289 Plan_dft_r2c_2d(
int nx,
294 [[maybe_unused]]
int threads = 1)
296# ifndef ITK_USE_CUFFTW
298 fftw_plan_with_nthreads(threads);
300 PlanType plan = fftw_plan_dft_r2c_2d(nx, ny, in, out, flags);
305 Plan_dft_r2c_3d(
int nx,
311 [[maybe_unused]]
int threads = 1)
313# ifndef ITK_USE_CUFFTW
315 fftw_plan_with_nthreads(threads);
317 PlanType plan = fftw_plan_dft_r2c_3d(nx, ny, nz, in, out, flags);
322 Plan_dft_r2c(
int rank,
327 [[maybe_unused]]
int threads = 1)
329# ifndef ITK_USE_CUFFTW
331 fftw_plan_with_nthreads(threads);
333 PlanType plan = fftw_plan_dft_r2c(rank, n, in, out, flags);
337 Plan_dft_1d(
const int n,
342 [[maybe_unused]]
int threads = 1)
344# ifndef ITK_USE_CUFFTW
346 fftw_plan_with_nthreads(threads);
348 PlanType plan = fftw_plan_dft_1d(n, in, out, sign, flags);
358 DestroyPlan(PlanType p)
360 fftw_destroy_plan(p);
static std::mutex & GetLockMutex()
~ComplexToComplexProxy()=default
ComplexToComplexProxy()=default
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....