From a72452caa1b3785721ef54c9b2617e2769c66d05 Mon Sep 17 00:00:00 2001 From: arovai Date: Thu, 28 May 2026 16:40:57 +0200 Subject: [PATCH] GE: use RxCoil string metadata for BIDS compatibility Replace GE user-defined ReceiveCoilName object metadata with standard RxCoil string metadata to avoid nested Value/Description JSON output. Add regression assertions in GE tests. Refs #194. --- spec2nii/GE/ge_pfile.py | 6 +----- tests/test_ge_pfile.py | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spec2nii/GE/ge_pfile.py b/spec2nii/GE/ge_pfile.py index a463a46..f0c240b 100644 --- a/spec2nii/GE/ge_pfile.py +++ b/spec2nii/GE/ge_pfile.py @@ -609,11 +609,7 @@ def _populate_metadata(pfile, water_suppressed=True, data_dimensions=None): # 'TxCoil' # Not Known # 'RxCoil' - meta.set_user_def( - key="ReceiveCoilName", - value=hdr.rhi_cname.decode(pfile.encoding, errors="replace"), - doc="Rx coil name.", - ) + meta.set_standard_def('RxCoil', hdr.rhi_cname.decode(pfile.encoding, errors='replace')) # # 5.3 Sequence information # 'SequenceName' diff --git a/tests/test_ge_pfile.py b/tests/test_ge_pfile.py index b90f987..98646e4 100644 --- a/tests/test_ge_pfile.py +++ b/tests/test_ge_pfile.py @@ -67,6 +67,8 @@ def test_svs(tmp_path): assert hdr_ext['SpectrometerFrequency'][0] == 127.76365 assert hdr_ext['ResonantNucleus'][0] == '1H' assert hdr_ext['OriginalFile'][0] == svs_path.name + assert isinstance(hdr_ext['RxCoil'], str) + assert 'ReceiveCoilName' not in hdr_ext assert np.isclose(hdr_ext['EchoTime'], 0.27) assert np.isclose(hdr_ext['RepetitionTime'], 2.0)