tools.estimate_epi_echo_phase#
- bartorch.tools.estimate_epi_echo_phase()#
Odd/even phase of every echo of an EPI train, fitted to a blip-free reference train.
The reference is the imaging train played with every phase-encode gradient at zero, so echo \(k\) sees the read gradient, eddy currents and timing of echo \(k\) of every imaging train. For each reversed echo, the forward echoes either side of it stand in for the line it would have been read forward, their mean cancelling the off-resonance phase that grows linearly along the train, and the phase of the reversed echo against them is fitted as
estimate_epi_phase()fits a navigator’s. A reversed echo with a forward echo on one side only (the first or last of the train) takes the fit of the nearest reversed echo that has both, or, in a train too short to have one, the one-sided fit. Forward echoes define the grid and take no correction.- Parameters:
reference_lines (list of torch.Tensor) – The reference train’s
(coils, samples)lines in echo order, reversed lines already flipped into forward readout order.reversed_lines (list of bool) – Whether each echo was read with the negative read gradient.
polynomial_order (int, default=1) – Polynomial order; one is a constant and a linear term.
- Returns:
Float64
(echoes, polynomial_order + 1)coefficients, lowest order first, on the reference’s device, in the coordinate ofestimate_epi_phase(): row \(k\) is whatcorrect_lines()applies to a reversed line of echo \(k\), zeros for a forward echo.- Return type:
torch.Tensor
- Raises:
ValueError – If the two lists differ in length, the train has no forward echo next to a reversed one, or the order is negative.