ITK  5.3.0
Insight Toolkit
itkFFTWCommon.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  * http://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 itkFFTWCommon_h
19 #define itkFFTWCommon_h
20 
21 #if defined(ITK_USE_FFTWF) || defined(ITK_USE_FFTWD)
22 # if defined(ITK_USE_CUFFTW)
23 # include "cufftw.h"
24 # else
26 # include "fftw3.h"
27 # endif
28 # if !defined(FFTW_WISDOM_ONLY)
29 // FFTW_WISDOM_ONLY is a "beyond guru" option that is only available in fftw 3.2.2
30 // to be compatible with all the fftw 3.x API, we need to define this away here:
31 # error "FFTW 3.3.2 or later is required so that FFTW_WISDOM_ONLY is defined."
32 # endif
33 
34 #endif
35 
36 #include <mutex>
37 
38 namespace itk
39 {
40 namespace fftw
41 {
53 template <typename TPixel>
54 class Proxy
55 {
56  // empty -- only double and float specializations work
57 
58 protected:
59  Proxy() = default;
60  ~Proxy() = default;
61 };
62 
63 #if defined(ITK_USE_FFTWF)
64 
65 template <>
66 class Proxy<float>
67 {
68 public:
69  using PixelType = float;
70  using ComplexType = fftwf_complex;
71  using PlanType = fftwf_plan;
72  using Self = Proxy<float>;
73 
74  // FFTW works with any data size, but is optimized for size decomposition with prime factors up to 13.
75 # ifdef ITK_USE_CUFFTW
76  static constexpr SizeValueType GREATEST_PRIME_FACTOR = 7;
77 # else
78  static constexpr SizeValueType GREATEST_PRIME_FACTOR = 13;
79 # endif
80 
81  static PlanType
83  ComplexType * in,
84  PixelType * out,
85  unsigned flags,
86  int threads = 1,
87  bool canDestroyInput = false)
88  {
89  return Plan_dft_c2r(1, &n, in, out, flags, threads, canDestroyInput);
90  }
91 
92  static PlanType
94  int ny,
95  ComplexType * in,
96  PixelType * out,
97  unsigned flags,
98  int threads = 1,
99  bool canDestroyInput = false)
100  {
101  auto * sizes = new int[2];
102  sizes[0] = nx;
103  sizes[1] = ny;
104  PlanType plan = Plan_dft_c2r(2, sizes, in, out, flags, threads, canDestroyInput);
105  delete[] sizes;
106  return plan;
107  }
108 
109  static PlanType
111  int ny,
112  int nz,
113  ComplexType * in,
114  PixelType * out,
115  unsigned flags,
116  int threads = 1,
117  bool canDestroyInput = false)
118  {
119  auto * sizes = new int[3];
120  sizes[0] = nx;
121  sizes[1] = ny;
122  sizes[2] = nz;
123  PlanType plan = Plan_dft_c2r(3, sizes, in, out, flags, threads, canDestroyInput);
124  delete[] sizes;
125  return plan;
126  }
127 
128  static PlanType
129  Plan_dft_c2r(int rank,
130  const int * n,
131  ComplexType * in,
132  PixelType * out,
133  unsigned flags,
134  int threads = 1,
135  bool canDestroyInput = false)
136  {
137 # ifndef ITK_USE_CUFFTW
138  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
139  fftwf_plan_with_nthreads(threads);
140 # else
141  (void)threads;
142 # endif
143  // don't add FFTW_WISDOM_ONLY if the plan rigor is FFTW_ESTIMATE
144  // because FFTW_ESTIMATE guarantee to not destroy the input
145  unsigned roflags = flags;
146  if (!(flags & FFTW_ESTIMATE))
147  {
148  roflags = flags | FFTW_WISDOM_ONLY;
149  }
150  PlanType plan = fftwf_plan_dft_c2r(rank, n, in, out, roflags);
151  if (plan == nullptr)
152  {
153  // no wisdom available for that plan
154  if (canDestroyInput)
155  {
156  // just create the plan
157  plan = fftwf_plan_dft_c2r(rank, n, in, out, flags);
158  }
159  else
160  {
161  // lets create a plan with a fake input to generate the wisdom
162  int total = 1;
163  for (int i = 0; i < rank; i++)
164  {
165  total *= n[i];
166  }
167  auto * din = new ComplexType[total];
168  fftwf_plan_dft_c2r(rank, n, din, out, flags);
169  delete[] din;
170  // and then create the final plan - this time it shouldn't fail
171  plan = fftwf_plan_dft_c2r(rank, n, in, out, roflags);
172  }
173 # ifndef ITK_USE_CUFFTW
175 # endif
176  }
177  itkAssertOrThrowMacro(plan != nullptr, "PLAN_CREATION_FAILED ");
178  return plan;
179  }
180 
181 
182  static PlanType
184  PixelType * in,
185  ComplexType * out,
186  unsigned flags,
187  int threads = 1,
188  bool canDestroyInput = false)
189  {
190  return Plan_dft_r2c(1, &n, in, out, flags, threads, canDestroyInput);
191  }
192 
193  static PlanType
195  int ny,
196  PixelType * in,
197  ComplexType * out,
198  unsigned flags,
199  int threads = 1,
200  bool canDestroyInput = false)
201  {
202  auto * sizes = new int[2];
203  sizes[0] = nx;
204  sizes[1] = ny;
205  PlanType plan = Plan_dft_r2c(2, sizes, in, out, flags, threads, canDestroyInput);
206  delete[] sizes;
207  return plan;
208  }
209 
210  static PlanType
212  int ny,
213  int nz,
214  PixelType * in,
215  ComplexType * out,
216  unsigned flags,
217  int threads = 1,
218  bool canDestroyInput = false)
219  {
220  auto * sizes = new int[3];
221  sizes[0] = nx;
222  sizes[1] = ny;
223  sizes[2] = nz;
224  PlanType plan = Plan_dft_r2c(3, sizes, in, out, flags, threads, canDestroyInput);
225  delete[] sizes;
226  return plan;
227  }
228 
229  static PlanType
230  Plan_dft_r2c(int rank,
231  const int * n,
232  PixelType * in,
233  ComplexType * out,
234  unsigned flags,
235  int threads = 1,
236  bool canDestroyInput = false)
237  {
238  //
239 # ifndef ITK_USE_CUFFTW
240  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
241  fftwf_plan_with_nthreads(threads);
242 # else
243  (void)threads;
244 # endif
245  // don't add FFTW_WISDOM_ONLY if the plan rigor is FFTW_ESTIMATE
246  // because FFTW_ESTIMATE guarantee to not destroy the input
247  unsigned roflags = flags;
248  if (!(flags & FFTW_ESTIMATE))
249  {
250  roflags = flags | FFTW_WISDOM_ONLY;
251  }
252  PlanType plan = fftwf_plan_dft_r2c(rank, n, in, out, roflags);
253  if (plan == nullptr)
254  {
255  // no wisdom available for that plan
256  if (canDestroyInput)
257  {
258  // just create the plan
259  plan = fftwf_plan_dft_r2c(rank, n, in, out, flags);
260  }
261  else
262  {
263  // lets create a plan with a fake input to generate the wisdom
264  int total = 1;
265  for (int i = 0; i < rank; i++)
266  {
267  total *= n[i];
268  }
269  auto * din = new PixelType[total];
270  fftwf_plan_dft_r2c(rank, n, din, out, flags);
271  delete[] din;
272  // and then create the final plan - this time it shouldn't fail
273  plan = fftwf_plan_dft_r2c(rank, n, in, out, roflags);
274  }
275 # ifndef ITK_USE_CUFFTW
277 # endif
278  }
279  itkAssertOrThrowMacro(plan != nullptr, "PLAN_CREATION_FAILED ");
280  return plan;
281  }
282 
283  static PlanType
284  Plan_dft_1d(int n,
285  ComplexType * in,
286  ComplexType * out,
287  int sign,
288  unsigned flags,
289  int threads = 1,
290  bool canDestroyInput = false)
291  {
292  return Plan_dft(1, &n, in, out, sign, flags, threads, canDestroyInput);
293  }
294 
295  static PlanType
296  Plan_dft_2d(int nx,
297  int ny,
298  ComplexType * in,
299  ComplexType * out,
300  int sign,
301  unsigned flags,
302  int threads = 1,
303  bool canDestroyInput = false)
304  {
305  auto * sizes = new int[2];
306  sizes[0] = nx;
307  sizes[1] = ny;
308  PlanType plan = Plan_dft(2, sizes, in, out, sign, flags, threads, canDestroyInput);
309  delete[] sizes;
310  return plan;
311  }
312 
313  static PlanType
314  Plan_dft_3d(int nx,
315  int ny,
316  int nz,
317  ComplexType * in,
318  ComplexType * out,
319  int sign,
320  unsigned flags,
321  int threads = 1,
322  bool canDestroyInput = false)
323  {
324  auto * sizes = new int[3];
325  sizes[0] = nx;
326  sizes[1] = ny;
327  sizes[2] = nz;
328  PlanType plan = Plan_dft(3, sizes, in, out, sign, flags, threads, canDestroyInput);
329  delete[] sizes;
330  return plan;
331  }
332 
333  static PlanType
334  Plan_dft(int rank,
335  const int * n,
336  ComplexType * in,
337  ComplexType * out,
338  int sign,
339  unsigned flags,
340  int threads = 1,
341  bool canDestroyInput = false)
342  {
343 # ifndef ITK_USE_CUFFTW
344  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
345  fftwf_plan_with_nthreads(threads);
346 # else
347  (void)threads;
348 # endif
349  // don't add FFTW_WISDOM_ONLY if the plan rigor is FFTW_ESTIMATE
350  // because FFTW_ESTIMATE guarantee to not destroy the input
351  unsigned roflags = flags;
352  if (!(flags & FFTW_ESTIMATE))
353  {
354  roflags = flags | FFTW_WISDOM_ONLY;
355  }
356  PlanType plan = fftwf_plan_dft(rank, n, in, out, sign, roflags);
357  if (plan == nullptr)
358  {
359  // no wisdom available for that plan
360  if (canDestroyInput)
361  {
362  // just create the plan
363  plan = fftwf_plan_dft(rank, n, in, out, sign, flags);
364  }
365  else
366  {
367  // lets create a plan with a fake input to generate the wisdom
368  int total = 1;
369  for (int i = 0; i < rank; i++)
370  {
371  total *= n[i];
372  }
373  auto * din = new ComplexType[total];
374  fftwf_plan_dft(rank, n, din, out, sign, flags);
375  delete[] din;
376  // and then create the final plan - this time it shouldn't fail
377  plan = fftwf_plan_dft(rank, n, in, out, sign, roflags);
378  }
379 # ifndef ITK_USE_CUFFTW
381 # endif
382  }
383  itkAssertOrThrowMacro(plan != nullptr, "PLAN_CREATION_FAILED ");
384  return plan;
385  }
386 
387 
388  static void
390  {
391  fftwf_execute(p);
392  }
393  static void
395  {
396 # ifndef ITK_USE_CUFFTW
397  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
398 # endif
399  fftwf_destroy_plan(p);
400  }
401 };
402 
403 #endif // ITK_USE_FFTWF
404 
405 
406 #if defined(ITK_USE_FFTWD)
407 template <>
408 class Proxy<double>
409 {
410 public:
411  using PixelType = double;
412  using ComplexType = fftw_complex;
413  using PlanType = fftw_plan;
415 
416  // FFTW works with any data size, but is optimized for size decomposition with prime factors up to 13.
417 # ifdef ITK_USE_CUFFTW
418  static constexpr SizeValueType GREATEST_PRIME_FACTOR = 7;
419 # else
420  static constexpr SizeValueType GREATEST_PRIME_FACTOR = 13;
421 # endif
422 
423  static PlanType
425  ComplexType * in,
426  PixelType * out,
427  unsigned flags,
428  int threads = 1,
429  bool canDestroyInput = false)
430  {
431  return Plan_dft_c2r(1, &n, in, out, flags, threads, canDestroyInput);
432  }
433 
434  static PlanType
436  int ny,
437  ComplexType * in,
438  PixelType * out,
439  unsigned flags,
440  int threads = 1,
441  bool canDestroyInput = false)
442  {
443  auto * sizes = new int[2];
444  sizes[0] = nx;
445  sizes[1] = ny;
446  PlanType plan = Plan_dft_c2r(2, sizes, in, out, flags, threads, canDestroyInput);
447  delete[] sizes;
448  return plan;
449  }
450 
451  static PlanType
453  int ny,
454  int nz,
455  ComplexType * in,
456  PixelType * out,
457  unsigned flags,
458  int threads = 1,
459  bool canDestroyInput = false)
460  {
461  auto * sizes = new int[3];
462  sizes[0] = nx;
463  sizes[1] = ny;
464  sizes[2] = nz;
465  PlanType plan = Plan_dft_c2r(3, sizes, in, out, flags, threads, canDestroyInput);
466  delete[] sizes;
467  return plan;
468  }
469 
470  static PlanType
471  Plan_dft_c2r(int rank,
472  const int * n,
473  ComplexType * in,
474  PixelType * out,
475  unsigned flags,
476  int threads = 1,
477  bool canDestroyInput = false)
478  {
479 # ifndef ITK_USE_CUFFTW
480  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
481  fftw_plan_with_nthreads(threads);
482 # else
483  (void)threads;
484 # endif
485  // don't add FFTW_WISDOM_ONLY if the plan rigor is FFTW_ESTIMATE
486  // because FFTW_ESTIMATE guarantee to not destroy the input
487  unsigned roflags = flags;
488  if (!(flags & FFTW_ESTIMATE))
489  {
490  roflags = flags | FFTW_WISDOM_ONLY;
491  }
492  PlanType plan = fftw_plan_dft_c2r(rank, n, in, out, roflags);
493  if (plan == nullptr)
494  {
495  // no wisdom available for that plan
496  if (canDestroyInput)
497  {
498  // just create the plan
499  plan = fftw_plan_dft_c2r(rank, n, in, out, flags);
500  }
501  else
502  {
503  // lets create a plan with a fake input to generate the wisdom
504  int total = 1;
505  for (int i = 0; i < rank; i++)
506  {
507  total *= n[i];
508  }
509  auto * din = new ComplexType[total];
510  fftw_plan_dft_c2r(rank, n, din, out, flags);
511  delete[] din;
512  // and then create the final plan - this time it shouldn't fail
513  plan = fftw_plan_dft_c2r(rank, n, in, out, roflags);
514  }
515 # ifndef ITK_USE_CUFFTW
517 # endif
518  }
519  itkAssertOrThrowMacro(plan != nullptr, "PLAN_CREATION_FAILED ");
520  return plan;
521  }
522 
523 
524  static PlanType
526  PixelType * in,
527  ComplexType * out,
528  unsigned flags,
529  int threads = 1,
530  bool canDestroyInput = false)
531  {
532  return Plan_dft_r2c(1, &n, in, out, flags, threads, canDestroyInput);
533  }
534 
535  static PlanType
537  int ny,
538  PixelType * in,
539  ComplexType * out,
540  unsigned flags,
541  int threads = 1,
542  bool canDestroyInput = false)
543  {
544  auto * sizes = new int[2];
545  sizes[0] = nx;
546  sizes[1] = ny;
547  PlanType plan = Plan_dft_r2c(2, sizes, in, out, flags, threads, canDestroyInput);
548  delete[] sizes;
549  return plan;
550  }
551 
552  static PlanType
554  int ny,
555  int nz,
556  PixelType * in,
557  ComplexType * out,
558  unsigned flags,
559  int threads = 1,
560  bool canDestroyInput = false)
561  {
562  auto * sizes = new int[3];
563  sizes[0] = nx;
564  sizes[1] = ny;
565  sizes[2] = nz;
566  PlanType plan = Plan_dft_r2c(3, sizes, in, out, flags, threads, canDestroyInput);
567  delete[] sizes;
568  return plan;
569  }
570 
571  static PlanType
572  Plan_dft_r2c(int rank,
573  const int * n,
574  PixelType * in,
575  ComplexType * out,
576  unsigned flags,
577  int threads = 1,
578  bool canDestroyInput = false)
579  {
580 # ifndef ITK_USE_CUFFTW
581  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
582  fftw_plan_with_nthreads(threads);
583 # else
584  (void)threads;
585 # endif
586  // don't add FFTW_WISDOM_ONLY if the plan rigor is FFTW_ESTIMATE
587  // because FFTW_ESTIMATE guarantee to not destroy the input
588  unsigned roflags = flags;
589  if (!(flags & FFTW_ESTIMATE))
590  {
591  roflags = flags | FFTW_WISDOM_ONLY;
592  }
593  PlanType plan = fftw_plan_dft_r2c(rank, n, in, out, roflags);
594  if (plan == nullptr)
595  {
596  // no wisdom available for that plan
597  if (canDestroyInput)
598  {
599  // just create the plan
600  plan = fftw_plan_dft_r2c(rank, n, in, out, flags);
601  }
602  else
603  {
604  // lets create a plan with a fake input to generate the wisdom
605  int total = 1;
606  for (int i = 0; i < rank; i++)
607  {
608  total *= n[i];
609  }
610  auto * din = new PixelType[total];
611  fftw_plan_dft_r2c(rank, n, din, out, flags);
612  delete[] din;
613  // and then create the final plan - this time it shouldn't fail
614  plan = fftw_plan_dft_r2c(rank, n, in, out, roflags);
615  }
616 # ifndef ITK_USE_CUFFTW
618 # endif
619  }
620  itkAssertOrThrowMacro(plan != nullptr, "PLAN_CREATION_FAILED ");
621  return plan;
622  }
623 
624  static PlanType
625  Plan_dft_1d(int n,
626  ComplexType * in,
627  ComplexType * out,
628  int sign,
629  unsigned flags,
630  int threads = 1,
631  bool canDestroyInput = false)
632  {
633  return Plan_dft(1, &n, in, out, sign, flags, threads, canDestroyInput);
634  }
635 
636  static PlanType
637  Plan_dft_2d(int nx,
638  int ny,
639  ComplexType * in,
640  ComplexType * out,
641  int sign,
642  unsigned flags,
643  int threads = 1,
644  bool canDestroyInput = false)
645  {
646  auto * sizes = new int[2];
647  sizes[0] = nx;
648  sizes[1] = ny;
649  PlanType plan = Plan_dft(2, sizes, in, out, sign, flags, threads, canDestroyInput);
650  delete[] sizes;
651  return plan;
652  }
653 
654  static PlanType
655  Plan_dft_3d(int nx,
656  int ny,
657  int nz,
658  ComplexType * in,
659  ComplexType * out,
660  int sign,
661  unsigned flags,
662  int threads = 1,
663  bool canDestroyInput = false)
664  {
665  auto * sizes = new int[3];
666  sizes[0] = nx;
667  sizes[1] = ny;
668  sizes[2] = nz;
669  PlanType plan = Plan_dft(3, sizes, in, out, sign, flags, threads, canDestroyInput);
670  delete[] sizes;
671  return plan;
672  }
673 
674  static PlanType
675  Plan_dft(int rank,
676  const int * n,
677  ComplexType * in,
678  ComplexType * out,
679  int sign,
680  unsigned flags,
681  int threads = 1,
682  bool canDestroyInput = false)
683  {
684 # ifndef ITK_USE_CUFFTW
685  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
686  fftw_plan_with_nthreads(threads);
687 # else
688  (void)threads;
689 # endif
690  // don't add FFTW_WISDOM_ONLY if the plan rigor is FFTW_ESTIMATE
691  // because FFTW_ESTIMATE guarantee to not destroy the input
692  unsigned roflags = flags;
693  if (!(flags & FFTW_ESTIMATE))
694  {
695  roflags = flags | FFTW_WISDOM_ONLY;
696  }
697  PlanType plan = fftw_plan_dft(rank, n, in, out, sign, roflags);
698  if (plan == nullptr)
699  {
700  // no wisdom available for that plan
701  if (canDestroyInput)
702  {
703  // just create the plan
704  plan = fftw_plan_dft(rank, n, in, out, sign, flags);
705  }
706  else
707  {
708  // lets create a plan with a fake input to generate the wisdom
709  int total = 1;
710  for (int i = 0; i < rank; i++)
711  {
712  total *= n[i];
713  }
714  auto * din = new ComplexType[total];
715  fftw_plan_dft(rank, n, din, out, sign, flags);
716  delete[] din;
717  // and then create the final plan - this time it shouldn't fail
718  plan = fftw_plan_dft(rank, n, in, out, sign, roflags);
719  }
720 # ifndef ITK_USE_CUFFTW
722 # endif
723  }
724  itkAssertOrThrowMacro(plan != nullptr, "PLAN_CREATION_FAILED ");
725  return plan;
726  }
727 
728 
729  static void
731  {
732  fftw_execute(p);
733  }
734  static void
736  {
737 # ifndef ITK_USE_CUFFTW
738  std::lock_guard<FFTWGlobalConfiguration::MutexType> lock(FFTWGlobalConfiguration::GetLockMutex());
739 # endif
740  fftw_destroy_plan(p);
741  }
742 };
743 
744 #endif
745 } // end namespace fftw
746 } // end namespace itk
747 #endif
itk::fftw::Proxy< float >::Plan_dft_r2c_2d
static PlanType Plan_dft_r2c_2d(int nx, int ny, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:194
itk::fftw::Proxy< float >::Plan_dft_3d
static PlanType Plan_dft_3d(int nx, int ny, int nz, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:314
itk::fftw::Proxy< double >::Plan_dft_c2r_3d
static PlanType Plan_dft_c2r_3d(int nx, int ny, int nz, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:452
itk::fftw::Proxy< double >::PixelType
double PixelType
Definition: itkFFTWCommon.h:411
itk::fftw::Proxy::~Proxy
~Proxy()=default
itk::fftw::Proxy< float >::Plan_dft_c2r
static PlanType Plan_dft_c2r(int rank, const int *n, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:129
itk::fftw::Proxy< double >::Plan_dft_c2r_1d
static PlanType Plan_dft_c2r_1d(int n, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:424
itk::fftw::Proxy< double >::Plan_dft
static PlanType Plan_dft(int rank, const int *n, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:675
itk::fftw::Proxy< float >::Plan_dft_2d
static PlanType Plan_dft_2d(int nx, int ny, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:296
itk::fftw::Proxy< float >::Plan_dft_c2r_2d
static PlanType Plan_dft_c2r_2d(int nx, int ny, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:93
itk::FFTWGlobalConfiguration::SetNewWisdomAvailable
static void SetNewWisdomAvailable(const bool &v)
itk::fftw::Proxy< float >::DestroyPlan
static void DestroyPlan(PlanType p)
Definition: itkFFTWCommon.h:394
itk::fftw::Proxy< float >
Definition: itkFFTWCommon.h:66
itk::fftw::Proxy< double >::Plan_dft_c2r
static PlanType Plan_dft_c2r(int rank, const int *n, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:471
itk::fftw::Proxy< float >::Plan_dft
static PlanType Plan_dft(int rank, const int *n, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:334
itk::fftw::Proxy< double >::DestroyPlan
static void DestroyPlan(PlanType p)
Definition: itkFFTWCommon.h:735
itk::fftw::Proxy< double >::ComplexType
fftw_complex ComplexType
Definition: itkFFTWCommon.h:412
itk::fftw::Proxy< float >::Plan_dft_r2c
static PlanType Plan_dft_r2c(int rank, const int *n, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:230
itk::fftw::Proxy< float >::Plan_dft_1d
static PlanType Plan_dft_1d(int n, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:284
itk::fftw::Proxy< double >::Plan_dft_2d
static PlanType Plan_dft_2d(int nx, int ny, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:637
itk::fftw::Proxy< double >::Plan_dft_1d
static PlanType Plan_dft_1d(int n, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:625
itk::fftw::Proxy< float >::Execute
static void Execute(PlanType p)
Definition: itkFFTWCommon.h:389
itk::fftw::Proxy< float >::PlanType
fftwf_plan PlanType
Definition: itkFFTWCommon.h:71
itk::fftw::Proxy< float >::Plan_dft_c2r_3d
static PlanType Plan_dft_c2r_3d(int nx, int ny, int nz, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:110
itk::fftw::Proxy< float >::ComplexType
fftwf_complex ComplexType
Definition: itkFFTWCommon.h:70
itk::fftw::Proxy::Proxy
Proxy()=default
itk::fftw::Proxy< double >::Plan_dft_r2c_2d
static PlanType Plan_dft_r2c_2d(int nx, int ny, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:536
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::fftw::Proxy< float >::Plan_dft_c2r_1d
static PlanType Plan_dft_c2r_1d(int n, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:82
itk::FFTWGlobalConfiguration::GetLockMutex
static std::mutex & GetLockMutex()
itk::fftw::Proxy< double >::Plan_dft_3d
static PlanType Plan_dft_3d(int nx, int ny, int nz, ComplexType *in, ComplexType *out, int sign, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:655
itk::fftw::Proxy< float >::Plan_dft_r2c_3d
static PlanType Plan_dft_r2c_3d(int nx, int ny, int nz, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:211
itk::fftw::Proxy< double >::PlanType
fftw_plan PlanType
Definition: itkFFTWCommon.h:413
itk::fftw::Proxy< double >::Plan_dft_r2c_1d
static PlanType Plan_dft_r2c_1d(int n, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:525
itk::fftw::Proxy< double >::Plan_dft_r2c_3d
static PlanType Plan_dft_r2c_3d(int nx, int ny, int nz, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:553
itk::fftw::Proxy< float >::Plan_dft_r2c_1d
static PlanType Plan_dft_r2c_1d(int n, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:183
itkFFTWGlobalConfiguration.h
itk::fftw::Proxy< double >
Definition: itkFFTWCommon.h:408
itk::fftw::Proxy< double >::Plan_dft_c2r_2d
static PlanType Plan_dft_c2r_2d(int nx, int ny, ComplexType *in, PixelType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:435
itk::fftw::Proxy
Definition: itkFFTWCommon.h:54
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::fftw::Proxy< double >::Execute
static void Execute(PlanType p)
Definition: itkFFTWCommon.h:730
itk::fftw::Proxy< double >::Plan_dft_r2c
static PlanType Plan_dft_r2c(int rank, const int *n, PixelType *in, ComplexType *out, unsigned flags, int threads=1, bool canDestroyInput=false)
Definition: itkFFTWCommon.h:572
itk::fftw::Proxy< float >::PixelType
float PixelType
Definition: itkFFTWCommon.h:69