FourierOperatorCPU#
- class mrinufft.operators.base.FourierOperatorCPU(samples, shape, density=False, n_coils=1, n_batchs=1, n_trans=1, smaps=None, raw_op=None, squeeze_dims=True)[source]#
Bases:
FourierOperatorBase
Base class for CPU-based NUFFT operator.
The NUFFT operation will be done sequentially and looped over coils and batches.
- Parameters:
samples (NDArray) – The samples used by the operator.
shape (tuple) – The shape of the image space (in 2D or 3D)
density (bool or NDArray) – If True, the density compensation is estimated from the samples. If False, no density compensation is applied. If NDArray, the density compensation is applied from the array.
n_coils (int) – The number of coils.
smaps (NDArray) – The sensitivity maps.
raw_op (object) – An object implementing the NUFFT API. Ut should be responsible to compute a single type 1 /type 2 NUFFT.
Methods
__init__
Non Cartesian MRI adjoint operator.
cg
Conjugate Gradient method to solve the inverse problem.
check_shape
Validate the shapes of the image or k-space data against operator shapes.
compute_density
Compute the density compensation weights and set it.
compute_smaps
Compute the sensitivity maps and set it.
Compute the gradient data consistency.
get_lipschitz_cst
Return the Lipschitz constant of the operator.
make_autograd
Make a new Operator with autodiff support.
Non Cartesian MRI forward operator.
with_autograd
Return a Fourier operator with autograd capabilities.
with_off_resonance_correction
Return a new operator with Off Resonnance Correction.
Attributes
autograd_available
cpx_dtype
Return complex floating precision of the operator.
density
Density compensation of the operator.
dtype
Return floating precision of the operator.
interfaces
n_batchs
Number of coils for the operator.
n_coils
Number of coils for the operator.
n_samples
Return the number of samples used by the operator.
ndim
Number of dimensions in image space of the operator.
norm_factor
Normalization factor of the operator.
samples
Return the samples used by the operator.
shape
Shape of the image space of the operator.
smaps
Sensitivity maps of the operator.
uses_density
Return True if the operator uses density compensation.
uses_sense
Return True if the operator uses sensitivity maps.
backend
available
Examples using
mrinufft.operators.base.FourierOperatorCPU
#- op(data, ksp=None)[source]#
Non Cartesian MRI forward operator.
- Parameters:
data (NDArray)
space. (The uniform (2D or 3D) data in image)
- Return type:
Results array on the same device as data.
Notes
this performs for every coil ell: ..math:: mathcal{F}mathcal{S}_ell x
Note
This function uses
numpy
internally, and will convert all its array argument to numpy arrays. The outputs will be converted back to the original array module and device.
- adj_op(coeffs, img=None)[source]#
Non Cartesian MRI adjoint operator.
- Parameters:
coeffs (np.array or GPUArray)
- Return type:
Array in the same memory space of coeffs. (ie on cpu or gpu Memory).
Note
This function uses
numpy
internally, and will convert all its array argument to numpy arrays. The outputs will be converted back to the original array module and device.
- data_consistency(image_data, obs_data)[source]#
Compute the gradient data consistency.
This mixes the op and adj_op method to perform F_adj(F(x-y)) on a per coil basis. By doing the computation coil wise, it uses less memory than the naive call to adj_op(op(x)-y)
- Parameters:
image (array) – Image on which the gradient operation will be evaluated. N_coil x Image shape is not using sense.
obs_data (array) – Observed data.
Note
This function uses
numpy
for all CPU arrays, andcupy
for all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.