lib.operators

Helper functions to apply the non-uniform Fourier transform (NUFFT).

lib.operators.op_norm(A, At, im_size, tol, max_iter, verbose)

Computes the maximum eigenvalue of the compound operator \(A^T A\).

Parameters
  • A (function handle) – Function handle for the direct operator.

  • At (function handle) – Function handle for the adjoint operator.

  • im_size (int[2]) – Size of the input image.

  • tol (double) – Tolerance for the stopping criterion (relative variation).

  • max_iter (int) – Maximum number of iterations.

  • verbose (bool) – Activate verbose mode.

Returns

  • val (double) – Operator norm of \(A^TA\) at convergence.

  • rel_var (double) – Value of the relative variation criterion at convergence.

lib.operators.op_nu_so_fft2(N, No, scale)

Oversampled ftt2 and scaled operator computed by a modified NUFFT function.

Parameters
  • N (int[2]) – Size of the reconstruction image.

  • No (int[2]) – Oversampled fft from which to recover the non uniform fft via kernel convolution.

  • Ns (int[2]) – Fft shift.

Returns

  • A (function handle) – Function handle for direct operator.

  • At (function handle) – Function handle for adjoint operator.

lib.operators.op_nufft(p, N, Nn, No, Ns, ktype)

Create the nonuniform gridding matrix and fft operators (based on createG).

Parameters
  • p (double[:, 2]) – Non-uniformly distributed frequency location points.

  • N (int[2]) – Size of the reconstruction image.

  • Nn (int[2]) – Size of the kernels (number of neighbors considered on each direction).

  • No (int[2]) – Oversampled fft from which to recover the non uniform fft via kernel convolution.

  • Ns (int[2]) – FFFT shift.

  • ktype (string) – Selected interpolator (among 'minmax:kb', 'minmax:tuned' and 'kaiser', see nufft.compute_interp_coeffs_extended() for associated kernel documentation). Recommended default is 'minmax:kb'.

Returns

  • A (Function handle) – Function handle for direct operator.

  • At (function handle) – Function handle for adjoint operator.

  • Gw (double[:, :]) – Global convolution kernel matrix.

  • scale (double[:, :]) – Scale paremters for the oversampled FFT.

lib.operators.op_nufft_irt(p, N, Nn, No, Ns, kernel)

Create the nonuniform gridding matrix and fft operators (based on nufft_init).

Parameters
  • p (double[:, 2]) – Non-uniformly distributed frequency location points.

  • N (int[2]) – Size of the reconstruction image.

  • Nn (int[2]) – Size of the kernels (number of neighbors considered on each direction).

  • No (int[2]) – Oversampled fft from which to recover the non uniform fft via kernel convolution.

  • Ns (int[2]) – Fft shift.

Returns

  • A (Function handle) – Function handle for direct operator.

  • At (function handle) – Function handle for adjoint operator.

  • Gw (double[:, :]) – Global convolution kernel matrix.

  • scale (double[:, :]) – Scale paremters for the oversampled FFT.

  • kernel (string) – Selected interpolator (among 'minmax:kb', 'minmax:tuned' and 'kaiser', see nufft.compute_interp_coeffs_extended() for associated kernel documentation). Recommended default is 'minmax:kb'.

lib.operators.op_p_nufft(p, N, Nn, No, Ns, ww, param, ktype)

Create the nonuniform gridding matrix and fft operators to be used for parallel processing (relying on op_nufft_irt).

Parameters
  • p (cell{2, 1} of double[:]) – Non-uniformly distributed frequency location points for each cell member which will be treated in parallel.

  • N (int[2]) – Size of the reconstruction image.

  • Nn (int[2]) – Size of the kernels (number of neighbors considered in each direction).

  • No (int[2]) – Oversampled fft from which to recover the non uniform fft via kernel convolution.

  • Ns (int[2]) – FFT shift.

  • ww (cell{:} of bool[:]) – Masks identifying data blocks.

  • param (struct) – Parameters to generate the NUFFT interpolation matrix.

  • ktype (string) – Selected interpolator (among 'minmax:kb', 'minmax:tuned' and 'kaiser', see nufft.compute_interp_coeffs_extended() for associated kernel documentation). Recommended default is 'minmax:kb'.

Returns

  • A (function handle) – Function handle for direct operator.

  • At (function handle) – Function handle for adjoint operator.

  • G (cell{:} of complex[:, :]) – Convolution kernel matrix (small) associated with patch in the Fourier plane.

  • W (cell{:} of int[:]) – Mask of the values that contribute to the convolution.

lib.operators.op_p_nufft_irt(p, N, Nn, No, Ns, ww, kernel, param)

Create the nonuniform gridding matrix and fft operators to be used for parallel processing (relying on op_nufft_irt).

Parameters
  • p (cell{2, 1} of double[:]) – Non-uniformly distributed frequency location points for each cell member which will be treated in parallel.

  • N (int[2]) – Size of the reconstruction image.

  • Nn (int[2]) – Size of the kernels (number of neighbors considered in each direction).

  • No (int[2]) – Oversampled fft from which to recover the non uniform fft via kernel convolution.

  • Ns (int[2]) – FFT shift.

  • ww (cell{:} of bool[:]) – Masks identifying data blocks.

  • kernel (string) – Selected interpolator (among 'minmax:kb', 'minmax:tuned' and 'kaiser', see nufft.compute_interp_coeffs_extended() for associated kernel documentation). Recommended default is 'minmax:kb'.

  • param (struct) – Parameters to generate the NUFFT interpolation matrix.

Returns

  • A (function handle) – Function handle for direct operator.

  • At (function handle) – Function handle for adjoint operator.

  • G (cell{:} of complex[:, :]) – Convolution kernel matrix (small) associated with patch in the Fourier plane.

  • W (cell{:} of int[:]) – Mask of the values that contribute to the convolution.

lib.operators.so_fft2(x, No, scale)

Computes and oversampled and scaled FFT2 with the scale factors precomputed from the nufft_init function.

Parameters
  • x (double[:, :]) – Input image.

  • No (int[2]) – Overscale size.

  • scale (double[:, :]) – Scale parameters precomputed by nufft_init.

Returns

X – 2D FFT coefficients.

Return type

complex[:]

lib.operators.so_fft2_adj(X, N, No, scale)

Computes the inverse scaled FTT2 involved in the adjoint NUFFT operator.

Parameters
  • X (complex[:]) – 2D fourier transform of the image.

  • N (int[2]) – Size of image.

  • No (int[2]) – Size of zero-padded image.

  • scale (double[:, :]) – Scale factor precomputed by nufft_init, used to cancel the scaling performed asscoiated with the convolution kernel to the non- uniform frequency domain.

Returns

x – Inverse scaled 2D FFT coefficients involved in the adjoint NUFFT operator.

Return type

complex[:]