pybids: Incorrect metadata may be returned in non-compliant datasets that have two valid sidecars for a single target in the same directory
pybids version: 0.9.4
I have corresponding jsons and niftis in a BIDS folder from heudiconv, but nifti.get_metadata often returns a value that is the opposite of what the json contains.
In [54]: json.get_dict()['PhaseEncodingDirection']
Out[54]: 'j'
In [55]: nii.get_metadata()['PhaseEncodingDirection']
Out[55]: 'j-'
I know this was a problem discussed in https://github.com/bids-standard/pybids/issues/40 but there are not much information about what was the problem and how it was fixed. The fact that the whole BIDS folder get scanned at the beginning and is mashed up in SQLAlchemy, which is very obscure for me, makes it very difficult to debug.
Is there a simple explanation of how things are loaded in pybids from jsons/filenames… ? What takes precedence? And how this kind of gross mismatch can occur?
Many BIDS-Apps rely on pybids to load parameters for preprocessing, and this could cause huge problems.
Thanks a lot.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 15
task-
is non-optional for sbref: https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#task-including-resting-state-imaging-data