Gdft¶
template <typename T1> class Gdft
Non-uniform field-corrected discrete Fourier transform (DFT) operator.
Computes the MRI signal model \(d = G x\) where \(x\) is the image and \(d\) is the k-space data. Supports optional off-resonance correction via a field map FM and a per-sample time vector t.
The forward model is:
where \(\omega_k\) = FM[k] is the field map in rad/s, \(\mathbf{k}_j\) are
k-space coordinates (cycles/FOV), \(\mathbf{r}_k\) are image-space coordinates,
and \(t_j\) are readout times (s).
Use G * x for the forward transform and G / d for the adjoint.
See : GdftR2 for extension with R2* gradient maps.
See : Gnufft for the fast gridding-based NUFFT alternative.
See : Fessler & Sutton, "Nonuniform Fast Fourier Transforms Using Min-Max Interpolation," IEEE TSP, 2003. https://doi.org/10.1109/TSP.2002.807005
Col<float> kx(4096), ky(4096), kz(4096, fill::zeros);
Col<float> ix(4096), iy(4096), iz(4096, fill::zeros);
Col<float> FM(4096, fill::zeros); // field map (rad/s)
Col<float> t(4096, fill::zeros); // readout times (s)
Gdft<float> G(4096, 4096, kx, ky, kz, ix, iy, iz, FM, t);
Col<cx_float> kdata = G * image; // forward
Col<cx_float> recon = G / kdata; // adjoint
T1
: Floating-point precision type (float or double).
Variables¶
| Name | Description |
|---|---|
| kx | Number of k-space samples (output length of forward transform). |
| ky | k-space y-coordinates (length n1). |
| kz | k-space z-coordinates (length n1). |
| ix | Image-space x-coordinates (length n2). |
| iy | Image-space y-coordinates (length n2). |
| iz | Image-space z-coordinates (length n2). |
| FM | Off-resonance field map in rad/s (length n2). |
| t | Per-sample readout time vector in seconds (length n1). |
| metalCtx | Opaque Metal DFT context handle (MetalDFTContext*); nullptr when T1 != float. |
Operators¶
| Name | Description |
|---|---|
| operator* | Forward DFT: image -> k-space. Computes \(d_j = \sum_k x_k \, e^{-i(2\pi \mathbf{k}_j \cdot \mathbf{r}_k + \omega_k t_j)}\). d : Input image vector of length n2. Return : Output k-space vector of length n1. |
| operator/ | Adjoint DFT: k-space -> image. Computes the conjugate transpose of the forward operator (\(G^H\)). d : Input k-space vector of length n1. Return : Output image vector of length n2. |
| operator* | Forward DFT (forgeCol overload for Metal path). |
| operator/ | Adjoint DFT (forgeCol overload for Metal path). |
Functions¶
| Name | Description |
|---|---|
| Gdft | Default constructor. |
| Gdft | Construct a Gdft operator with the given trajectory and field map. |
| ~Gdft | Destructor — releases the Metal DFT context if allocated. |
Variable Details¶
FM¶
forgeCol<T1> FM
Off-resonance field map in rad/s (length n2).
ix¶
forgeCol<T1> ix
Image-space x-coordinates (length n2).
iy¶
forgeCol<T1> iy
Image-space y-coordinates (length n2).
iz¶
forgeCol<T1> iz
Image-space z-coordinates (length n2).
kx¶
forgeCol<T1> kx
Number of k-space samples (output length of forward transform).
Number of image pixels (input length of forward transform).
k-space x-coordinates (length n1).
ky¶
forgeCol<T1> ky
k-space y-coordinates (length n1).
kz¶
forgeCol<T1> kz
k-space z-coordinates (length n1).
metalCtx¶
void* metalCtx
Opaque Metal DFT context handle (MetalDFTContext*); nullptr when T1 != float.
t¶
forgeCol<T1> t
Per-sample readout time vector in seconds (length n1).
Operator Details¶
operator*¶
Col<CxT1> operator*(const Col<CxT1>& d) const
Forward DFT: image -> k-space.
Computes \(d_j = \sum_k x_k \, e^{-i(2\pi \mathbf{k}_j \cdot \mathbf{r}_k + \omega_k t_j)}\).
d
: Input image vector of length n2.
Return
: Output k-space vector of length n1.
forgeCol<forgeComplex<T1>> operator*(const forgeCol<forgeComplex<T1>>& d) const
Forward DFT (forgeCol overload for Metal path).
d
: Input image vector of length n2.
Return
: Output k-space vector of length n1.
operator/¶
Col<CxT1> operator/(const Col<CxT1>& d) const
Adjoint DFT: k-space -> image.
Computes the conjugate transpose of the forward operator (\(G^H\)).
d
: Input k-space vector of length n1.
Return
: Output image vector of length n2.
forgeCol<forgeComplex<T1>> operator/(const forgeCol<forgeComplex<T1>>& d) const
Adjoint DFT (forgeCol overload for Metal path).
d
: Input k-space vector of length n1.
Return
: Output image vector of length n2.
Function Details¶
Gdft¶
Gdft()
Default constructor. Produces an uninitialized operator.
Gdft(uword a, uword b, const Col<T1>& k1, const Col<T1>& k2, const Col<T1>& k3, const Col<T1>& i1, const Col<T1>& i2, const Col<T1>& i3, const Col<T1>& f1, const Col<T1>& t1)
Construct a Gdft operator with the given trajectory and field map.
a
: Number of k-space samples (n1, output size of forward transform).
b
: Number of image pixels (n2, input size of forward transform).
k1
: k-space x-coordinates, length a (units: cycles/FOV, range [-N/2, N/2)).
k2
: k-space y-coordinates, length a.
k3
: k-space z-coordinates, length a (set to zeros for 2-D).
i1
: Image-space x-coordinates, length b (units: fraction of FOV, range [0, 1)).
i2
: Image-space y-coordinates, length b.
i3
: Image-space z-coordinates, length b (set to zeros for 2-D).
f1
: Off-resonance field map, length b (units: rad/s).
t1
: Per-sample readout time vector, length a (units: s).
~Gdft¶
~Gdft()
Destructor — releases the Metal DFT context if allocated.