tools.apply_susceptibility

tools.apply_susceptibility#

bartorch.tools.apply_susceptibility()#

Correct an image for susceptibility distortion with a known displacement field.

The model is that of correct_susceptibility(): the blip-up image is sampled at \(x + b(x)\) and its intensity multiplied by \(1 + \partial b / \partial x\), the blip-down image at \(x - b(x)\) with \(1 - \partial b / \partial x\). The field, estimated once from a pair, so corrects every later image acquired with the same phase encoding and field, as FSL’s applytopup --method=jac does. The image is interpolated linearly along the phase-encoding axis, wrapping around the field of view as the phase encoding does. Nothing but torch is needed.

Parameters:
  • image (torch.Tensor) – Real or complex image, 2D or 3D.

  • field_map (torch.Tensor) – Displacement along the phase-encoding axis in the units of voxel_size, on cell edges: one sample longer than image along that axis and of its size along the others, as SusceptibilityCorrection.field_map.

  • voxel_size (tuple of float) – Voxel size per axis of the image, in the units of field_map.

  • phase_encoding_axis (int, default=0) – Phase-encoding axis of image and field_map.

  • blip ({"up", "down"}, default='up') – Phase-encoding polarity of image: "up" for the image passed as blip_up to correct_susceptibility().

Returns:

The corrected image, of the shape of image.

Return type:

torch.Tensor

Raises:

ValueError – If field_map is not one sample longer than image along the phase-encoding axis and of its size along the others, voxel_size does not give one value per axis, or blip is unknown.