datalad / datalad-neuroimaging

DataLad extension for neuroimaging research
http://datalad.org
Other
17 stars 14 forks source link

BF: nifti1 - decode "bytes" in the metadata record #92

Closed yarikoptic closed 2 years ago

yarikoptic commented 2 years ago

While trying out metalad using nifti1 extractor as the one which needs "sparse" access to actual file content, it was crashing due to

TypeError: Object of type bytes is not JSON serializable

which were due to the fact that some fields, e.g.

*(Pdb) p str(header['descrip'])
"b'FreeSurfer Aug 11 2009'"

are byte numpy arrays... I decided to just to the final tune up for all values regardless where they came from - I do not envision a use case where they should be a byte string.

If it would be the case -- metalad would need to be the one to handle that somehow I guess.

yarikoptic commented 2 years ago

fix is trivial and easy to revert/improve, so let's just proceed