MRITensorflowNUFFT#
- class mrinufft.operators.interfaces.tfnufft.MRITensorflowNUFFT(samples, shape, n_coils=1, density=False, smaps=None, eps=1e-06)[source]#
Bases:
FourierOperatorBaseMRI Transform Operator using Tensorflow NUFFT.
- Parameters:
samples (Tensor) – The samples location of shape
Nsamples x N_dimensions. It should be C-contiguous.shape (tuple) – Shape of the image space.
n_coils (int) – Number of coils.
density (bool or Tensor) –
- Density compensation support.
If a Tensor, it will be used for the density.
If True, the density compensation will be automatically estimated, using the fixed point method.
If False, density compensation will not be used.
smaps (Tensor)
Methods
__init__Backward Operation.
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 data consistency.
get_lipschitz_cstReturn the Lipschitz constant of the operator.
make_autogradMake a new Operator with autodiff support.
make_deepinv_phyMake a new DeepInv Physics with NUFFT operator.
make_linopsCreate a Scipy Linear Operator from the NUFFT operator.
Forward operation.
pinv_solverSolves the linear system Ax = y.
Estimate the density compensation using the pipe method.
with_autogradReturn a Fourier operator with autograd capabilities.
with_off_resonance_correctionReturn a new operator with Off Resonnance Correction.
Attributes
autograd_availableavailablebackendcpx_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 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.
- op(data)[source]#
Forward operation.
- Parameters:
data (Tensor)
- Return type:
Tensor
Note
This function uses
tensorflowinternally, and will convert all its array argument to tensorflow tensors. but will respect the device they are allocated on. The outputs will be converted back to the original array module and device.
- adj_op(coeffs)[source]#
Backward Operation.
- Parameters:
coeffs (Tensor)
- Return type:
Tensor
Note
This function uses
tensorflowinternally, and will convert all its array argument to tensorflow tensors. but will respect the device they are allocated on. The outputs will be converted back to the original array module and device.
- data_consistency(image_data, obs_data)[source]#
Compute the data consistency.
- Parameters:
data (Tensor) – Image data
obs_data (Tensor) – Observed data
- Returns:
The data consistency error in image space.
- Return type:
Tensor
Note
This function uses
tensorflowinternally, and will convert all its array argument to tensorflow tensors. but will respect the device they are allocated on. The outputs will be converted back to the original array module and device.
- classmethod pipe(samples, shape, max_iter=10, osf=2, normalize=True)[source]#
Estimate the density compensation using the pipe method.
- Parameters:
samples (Tensor) – The samples location of shape
Nsamples x N_dimensions. It should be C-contiguous.shape (tuple) – Shape of the image space.
max_iter (int) – Number of iterations.
osf (int, default 2) – Currently, we support only OSF=2 and this value cannot be changed. Changing will raise an error.
- Returns:
The estimated density compensation.
- Return type:
Tensor