bartorch.tools.phantom

Contents

bartorch.tools.phantom#

bartorch.tools.phantom(shape=None, *, kspace=False, coils=None, traj=None, geometry=None, rotation_angle=None, rotation_steps=None, **extra)#

An analytical phantom, as an image or as its k-space.

Parameters:
  • shape (int or tuple of int, optional) – The image’s spatial size (-x), square unless a tuple is given. Without one, BART’s own default size.

  • kspace (bool) – Return the analytical k-space rather than the image (-k).

  • coils (int, optional) – Simulate this many coil sensitivities (-s).

  • traj (tensor, optional) – Sample the k-space along this trajectory (-t) rather than on a grid, which implies kspace.

  • geometry ({'circle', 'brain', 'nist', 'sonar', 'tubes', 'bart'}, optional) – Which phantom to make; BART spells each as its own flag.

  • rotation_angle (float, int, optional) – Rotate the phantom (--rotation-angle, --rotation-steps).

  • rotation_steps (float, int, optional) – Rotate the phantom (--rotation-angle, --rotation-steps).

  • **extra – Further BART phantom flags, by name.

Returns:

The phantom.

Return type:

torch.Tensor

Examples

>>> image = phantom(128)
>>> kspace = phantom(128, coils=8, kspace=True)