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:
FourierOperatorBaseBase 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.
check_shapeValidate the shapes of the image or k-space data against operator shapes.
compute_densityCompute the density compensation weights and set it.
compute_smapsCompute the sensitivity maps and set it.
Compute the gradient data consistency.
get_lipschitz_cstReturn the Lipschitz constant of the operator.
make_autogradMake a new Operator with autodiff support.
make_linopsCreate a Scipy Linear Operator from the NUFFT operator.
Non Cartesian MRI forward operator.
pinv_solverSolves the linear system Ax = y.
with_autogradReturn a Fourier operator with autograd capabilities.
with_off_resonance_correctionReturn a new operator with Off Resonnance Correction.
Attributes
autograd_availablecpx_dtypeReturn complex floating precision of the operator.
densityDensity compensation of the operator.
dtypeReturn floating precision of the operator.
img_full_shapeFull image shape with batch and coil dimensions.
interfacesksp_full_shapeFull kspace shape with batch and coil dimensions.
n_batchsNumber of coils for the operator.
n_coilsNumber of coils for the operator.
n_samplesReturn the number of samples used by the operator.
ndimNumber of dimensions in image space of the operator.
norm_factorNormalization factor of the operator.
samplesReturn the samples used by the operator.
shapeShape of the image space of the operator.
smapsSensitivity maps of the operator.
uses_densityReturn True if the operator uses density compensation.
uses_senseReturn True if the operator uses sensitivity maps.
backendavailableExamples 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
numpyinternally, 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
numpyinternally, 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
numpyfor all CPU arrays, andcupyfor 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.