Before submitting
Bug description
mirror_odd_lines reverses every other phase-encode line's readout when RECO_inp_order='REV_ALT_ROWS' is set. This is correct for symmetric EPI (where adjacent phase lines within one echo train have alternating readout polarity), but wrong for bipolar multi-echo sequences like MGE.
For the MGE example sequence in the PV7 Bruker API test data set (https://zenodo.org/records/4522220, exp number 26), the current code warns about a disagreement between the declared and inferred value, but uses the declared value anyway leading to wrong kspace data.
For PV360 MGE data, everything is working fine as it is, because the SchemaRawdata has no mirror_odd_lines logic
Steps to reproduce
When using this simple code snippet:
import numpy as np
from brukerapi.dataset import Dataset
data = Dataset(<path_to_MGE_data>)
img = np.fft.ifftshift(np.fft.ifftn(np.fft.fftshift(data.kspace, axes=(0, 1)), axes=(0, 1)), axes=(0, 1))
plt.imshow(np.abs(img[:, :, 16, 0, 0]))
plt.show()
the current output looks like this:
When adjusting the mirror_odd_lines() function to ignore the declared value for non-EPI sequences like this:
@property
def mirror_odd_lines(self):
"""Whether §6.2 odd-line reversal applies to phase-encode lines."""
value = self._dataset._parameter_value("RECO_inp_order")
declared = None if value is None else str(value).upper() == "REV_ALT_ROWS"
inferred = "EPI" in self._dataset.scheme_id
if not inferred and declared:
return False
return self._declared_or_inferred(
"RECO_inp_order", declared, inferred, "_warned_reco_input_order_disagreement"
)
the image looks correct:
I am not sure if you prefer to fix this in the mirror_odd_lines function or somewhere else, but ofc I can create a PR if you agree.
Project version
0.4.6
Paravision version
PV7
Before submitting
Bug description
mirror_odd_linesreverses every other phase-encode line's readout when RECO_inp_order='REV_ALT_ROWS' is set. This is correct for symmetric EPI (where adjacent phase lines within one echo train have alternating readout polarity), but wrong for bipolar multi-echo sequences like MGE.For the MGE example sequence in the PV7 Bruker API test data set (https://zenodo.org/records/4522220, exp number 26), the current code warns about a disagreement between the declared and inferred value, but uses the declared value anyway leading to wrong kspace data.
For PV360 MGE data, everything is working fine as it is, because the
SchemaRawdatahas nomirror_odd_lineslogicSteps to reproduce
When using this simple code snippet:
the current output looks like this:
When adjusting the
mirror_odd_lines()function to ignore the declared value for non-EPI sequences like this:the image looks correct:
I am not sure if you prefer to fix this in the mirror_odd_lines function or somewhere else, but ofc I can create a PR if you agree.
Project version
0.4.6
Paravision version
PV7