NonCartesianMRI#
- class deepinv.physics.NonCartesianMRI(img_size, num_shots=100, num_samples_per_shot=500, trajectory='radial', tilt='uniform', in_out=False, coil_maps=None, backend='finufft', normalize=False, device='cpu', **kwargs)[source]#
Bases:
MultiCoilMRI,MRIMixinNon-Cartesian (multi-coil) MRI via
mri-nufft.This physics wraps non-uniform FFT forward and adjoint operators provided by the
mri-nufftlibrary, and models non-Cartesian MRI sequences such as radial or spiral sampling.The physics also supports other
mri-nufftfunctionality such as density compensation, which is provided inA_dagger(density_compensate=True).Tip
This operator is differentiable via the autograd function.
We assume that
xis of shape(B,2,H,W)and kspaceyare(B,2,N,S)whereN= coils andS= num shots * num samples per shot.Note
Only supports 2D acquisition for now. For 3D/stacked physics, please open a feature request issue on GitHub.
Note
This physics supports batching, along as the backend accepts it. See mri-nufft backend docs.
Tip
This is a thin wrapper of
mri-nufft. Learn more about their extensive MRI support, such as more advanced trajectories, trajectory estimation, various coil map estimation algorithms or off-resonance correction.- Parameters:
img_size (tuple) β reconstructed image size
(H, W)(no channel dim).num_shots (int) β number of sampling shots
Nc(e.g. spokes), default to 100num_samples_per_shot (int) β number of samples per shot
Ns, default to 500trajectory (str) β
radialorspiral, passed tomri-nufft, default to βradialβtilt (str, float) β tilt of the shots, options include those listed in
mrinufft.trajectories.utils.initialize_tiltdocs, orgolden/graspfor golden-angle tilt. Default to βuniformβin_out (bool) β whether to start sampling from the center or not, default
False.coil_maps (torch.Tensor, int, None) β complex coil sensitivity maps of shape
(H,W),(N,H,W)or(B,N,H,W).intNsimulatesNbirdcage maps (requiressigpy).None= single-coil (flat map) (default).backend (str) β mri-nufft backend. Use
finufftfor CPU (default),cufinufftfor CUDA. Set tompsto use finufft on Apple MPS, which avoids a torch threading clash withlibomp.normalize (bool) β whether normalise by empirical norm, default
False.device (torch.device) β physics device, default
'cpu'.
- A(x, **kwargs)[source]#
MRI-NUFFT forward operator.
- Parameters:
x (torch.Tensor) β image of shape B,2,H,W
- Returns:
torch.Tensor, multicoil kspace of shape B,2,N,S, where N is coil dim, and S is shots * samples dim- Return type:
- A_adjoint(y, rss=False, **kwargs)[source]#
MRI-NUFFT adjoint operator.
- Parameters:
y (torch.Tensor) β multi-coil kspace measurements with shape B,2,N,S where N is coil dimension.
rss (bool) β perform root-sum-square reconstruction over coils and take magnitude.
- Returns:
(
torch.Tensor) image of shape(B,2,H,W)if not rss else(B,1,H,W)- Return type:
- A_dagger(y, density_compensate=False, rss=False, **kwargs)[source]#
Computes the solution in \(x\) to \(y = Ax\) using a least squares solver. A faster approximation can be obtained by setting
density_compensate=True, which computes the filtered (i.e. density-compensated) backprojection (i.e. adjoint).Warning
The density-compensated adjoint is not the exact linear pseudo-inverse of the NUFFT problem, but it is a good approximation.
- Parameters:
y (torch.Tensor) β multi-coil kspace measurements with shape B,2,N,S where N is coil dimension.
density_compensation (bool) β fast approximation to the pseudo-inverse: Voronoi density compensation by multiplying density in the adjoint.
rss (bool) β perform root-sum-square reconstruction over coils and take magnitude.
- Returns:
(
torch.Tensor) image of shape(B,2,H,W)if not rss else(B,1,H,W)
- estimate_coil_maps(y, method='low_frequency', **kwargs)[source]#
Estimate coil sensitivity maps from non-Cartesian kspace via
mri-nufft.Unlike
deepinv.physics.MultiCoilMRI.estimate_coil_maps()which uses ACS region, non-Cartesian estimation reconstructs low-frequency per-coil images Seemrinufft.extras.get_smapsfor details.Note
The estimation uses
mri-nufftand is performed on CPU.- Parameters:
y (torch.Tensor) β multi-coil kspace
(B,2,N,S).method (str) β
mri-nufftsmaps method, eitherlow_frequencyorespirit.
- Returns:
complex coil maps
(B,N,H,W).- Return type:
Examples using NonCartesianMRI:#
Reconstruct accelerated non-Cartesian breast MRI acquisition data