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