VTK  9.4.20250421
vtkImageFourierFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
13#ifndef vtkImageFourierFilter_h
14#define vtkImageFourierFilter_h
15
17#include "vtkImagingFourierModule.h" // For export macro
18
19/*******************************************************************
20 COMPLEX number stuff
21*******************************************************************/
22
23VTK_ABI_NAMESPACE_BEGIN
25{
26 double Real;
27 double Imag;
28};
30
31#define vtkImageComplexEuclidSet(C, R, I) \
32 do \
33 { \
34 (C).Real = (R); \
35 (C).Imag = (I); \
36 } while (false)
37
38#define vtkImageComplexPolarSet(C, M, P) \
39 do \
40 { \
41 (C).Real = (M)*cos(P); \
42 (C).Imag = (M)*sin(P); \
43 } while (false)
44
45#define vtkImageComplexPrint(C) \
46 do \
47 { \
48 printf("(%.3f, %.3f)", (C).Real, (C).Imag); \
49 } while (false)
50
51#define vtkImageComplexScale(cOut, S, cIn) \
52 do \
53 { \
54 (cOut).Real = (cIn).Real * (S); \
55 (cOut).Imag = (cIn).Imag * (S); \
56 } while (false)
57
58#define vtkImageComplexConjugate(cIn, cOut) \
59 do \
60 { \
61 (cOut).Imag = (cIn).Imag * -1.0; \
62 (cOut).Real = (cIn).Real; \
63 } while (false)
64
65#define vtkImageComplexAdd(C1, C2, cOut) \
66 do \
67 { \
68 (cOut).Real = (C1).Real + (C2).Real; \
69 (cOut).Imag = (C1).Imag + (C2).Imag; \
70 } while (false)
71
72#define vtkImageComplexSubtract(C1, C2, cOut) \
73 do \
74 { \
75 (cOut).Real = (C1).Real - (C2).Real; \
76 (cOut).Imag = (C1).Imag - (C2).Imag; \
77 } while (false)
78
79#define vtkImageComplexMultiply(C1, C2, cOut) \
80 do \
81 { \
82 vtkImageComplex vtkImageComplex_tMultiplyTemp; \
83 vtkImageComplex_tMultiplyTemp.Real = (C1).Real * (C2).Real - (C1).Imag * (C2).Imag; \
84 vtkImageComplex_tMultiplyTemp.Imag = (C1).Real * (C2).Imag + (C1).Imag * (C2).Real; \
85 cOut = vtkImageComplex_tMultiplyTemp; \
86 } while (false)
87
88// This macro calculates exp(cIn) and puts the result in cOut
89#define vtkImageComplexExponential(cIn, cOut) \
90 do \
91 { \
92 double tmp = exp(cIn.Real); \
93 cOut.Real = tmp * cos(cIn.Imag); \
94 cOut.Imag = tmp * sin(cIn.Imag); \
95 } while (false)
96
97/******************* End of COMPLEX number stuff ********************/
98
99class VTKIMAGINGFOURIER_EXPORT vtkImageFourierFilter : public vtkImageDecomposeFilter
100{
101public:
103 void PrintSelf(ostream& os, vtkIndent indent) override;
104
105 // public for templated functions of this object
106
113
120
121protected:
123 ~vtkImageFourierFilter() override = default;
124
125 void ExecuteFftStep2(vtkImageComplex* p_in, vtkImageComplex* p_out, int N, int bsize, int fb);
127 vtkImageComplex* p_in, vtkImageComplex* p_out, int N, int bsize, int n, int fb);
129
134 vtkInformationVector* outputVector) override;
135
136private:
138 void operator=(const vtkImageFourierFilter&) = delete;
139};
140
141VTK_ABI_NAMESPACE_END
142#endif
Filters that execute axes in series.
Superclass that implements complex numbers.
void ExecuteRfft(vtkImageComplex *in, vtkImageComplex *out, int N)
This function calculates the whole fft of an array.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Override to change extent splitting rules.
~vtkImageFourierFilter() override=default
void ExecuteFft(vtkImageComplex *in, vtkImageComplex *out, int N)
This function calculates the whole fft of an array.
void ExecuteFftStepN(vtkImageComplex *p_in, vtkImageComplex *p_out, int N, int bsize, int n, int fb)
void ExecuteFftStep2(vtkImageComplex *p_in, vtkImageComplex *p_out, int N, int bsize, int fb)
vtkImageFourierFilter()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Construct an instance of vtkImageDecomposeFilter filter with default dimensionality 3.
void ExecuteFftForwardBackward(vtkImageComplex *in, vtkImageComplex *out, int N, int fb)
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.