coil_maps

Contents

coil_maps#

pulserver.recon.coil_maps()[source]#

Return the coil sensitivities of a unit from the first source that has them.

The sources, in order:

  1. The unit’s calibration k-space, data.ref: the maps are estimated from it and stored in context.coil_maps under the unit’s slice counter, or under (slice, set) where its set counter is not 0, replacing the maps stored there.

  2. context.coil_maps for the unit’s slice and set, then for its slice. A FLEET calibration reads its lines in each phase-encode polarity, set 0 forward and set 1 reversed, as the EPI it calibrates reads its images, so each polarity is unfolded by maps distorted as it is.

  3. The exam’s COIL_SENSITIVITIES, as a calibration series stored them.

Maps of the stream serve only where CoilSensitivities.incompatibility() finds nothing. Maps of the exam serve a unit with the same coils, prewhitening, frame of reference and table position; on another grid, position or orientation they are resliced onto the unit’s grid from the two geometries, bartorch.tools.reslice(), and refused where the unit’s grid reaches outside theirs. Maps estimated from uncompressed channels are projected onto the unit’s compression basis, as its k-space was. The location is the slice counter, not the encoding space, so maps estimated from a calibration unit in an encoding space of its own serve the imaging units of its slice.

Maps estimated from a unit’s calibration readouts are logged at INFO, with the lines and the time they took; maps stored in the stream or the exam that serve a unit are logged at DEBUG.

Parameters:
  • context (ReconContext) – Scan context.

  • data (ReconData) – The unit that needs maps; data.counters["slice"] is its slice, 0 when the unit has no such counter.

  • estimate (callable) – estimate(kspace) -> maps, such as bartorch.apps.nlinv_maps(). kspace is the calibration k-space of the unit as a torch tensor (coils, [z,] y, x) on the host, zero outside the lines it holds, on the grid of its encoding space; maps are the sensitivities on the same grid.

  • required (bool, default=True) – Return None, rather than raise, when no source has usable maps.

Returns:

A copy of the maps (coils, [z,] y, x), complex64, on the host.

Return type:

torch.Tensor or None

Raises:
  • MissingCalibration – If no source has usable maps and required is true. The message names each source and why it was rejected.

  • ValueError – If the unit’s calibration k-space is of a non-Cartesian space, varies along an axis other than the partition and phase-encode axes, or the estimate returns maps on another grid than it was given.