psychoinformatics-de / datalad-hirni

DataLad extension for (semi-)automated, reproducible processing of (medical/neuro)imaging data
http://datalad.org
Other
5 stars 8 forks source link

dicom2spec doesn't handle --properties correctly #141

Open pvavra opened 4 years ago

pvavra commented 4 years ago

Trying to address #140 via the --properties results in an error:

datalad hirni-dicom2spec -s test3.json --properties '{"bids-session": {"value": "1","test": "test-value"}}'
[ERROR  ] unhashable type: 'dict' [dicom2spec.py:add_to_spec:228] (TypeError) 

Looking at the relevant code in https://github.com/psychoinformatics-de/datalad-hirni/blob/master/datalad_hirni/commands/dicom2spec.py (lines 396) shows that the logic is much simpler than the respective code in spec4anything (lines 244)

As per TODO comment in the latter file and issue #58, this should be refactored into a generalized function to make it usable.