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, MRIMixin

Non-Cartesian (multi-coil) MRI via mri-nufft.

This physics wraps non-uniform FFT forward and adjoint operators provided by the mri-nufft library, and models non-Cartesian MRI sequences such as radial or spiral sampling.

The physics also supports other mri-nufft functionality such as density compensation, which is provided in A_dagger(density_compensate=True).

Tip

This operator is differentiable via the autograd function.

We assume that x is of shape (B,2,H,W) and kspace y are (B,2,N,S) where N = coils and S = 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 100

  • num_samples_per_shot (int) – number of samples per shot Ns, default to 500

  • trajectory (str) – radial or spiral, passed to mri-nufft, default to β€˜radial’

  • tilt (str, float) – tilt of the shots, options include those listed in mrinufft.trajectories.utils.initialize_tilt docs, or golden/grasp for 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). int N simulates N birdcage maps (requires sigpy). None = single-coil (flat map) (default).

  • backend (str) – mri-nufft backend. Use finufft for CPU (default), cufinufft for CUDA. Set to mps to use finufft on Apple MPS, which avoids a torch threading clash with libomp.

  • 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:

Tensor

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:

Tensor

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 See mrinufft.extras.get_smaps for details.

Note

The estimation uses mri-nufft and is performed on CPU.

Parameters:
  • y (torch.Tensor) – multi-coil kspace (B,2,N,S).

  • method (str) – mri-nufft smaps method, either low_frequency or espirit.

Returns:

complex coil maps (B,N,H,W).

Return type:

Tensor

noise(x, **kwargs)[source]#

Bypass MultiCoilMRI Cartesian masked noise

Examples using NonCartesianMRI:#

Reconstruct accelerated non-Cartesian breast MRI acquisition data

Reconstruct accelerated non-Cartesian breast MRI acquisition data