Problem Running Heudiconv
Summary
I am having difficulty converting my data to BIDS for a particular data set. In addition I am getting a strange error that I am not familiar with.
Here it is:
Traceback (most recent call last):
File "/usr/local/bin/heudiconv", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/heudiconv/cli/run.py", line 125, in main
process_args(args)
File "/usr/local/lib/python2.7/dist-packages/heudiconv/cli/run.py", line 338, in process_args
overwrite=args.overwrite,)
File "/usr/local/lib/python2.7/dist-packages/heudiconv/convert.py", line 210, in prep_conversion
getattr(heuristic, 'DEFAULT_FIELDS', {}))
File "/usr/local/lib/python2.7/dist-packages/heudiconv/bids.py", line 72, in populate_bids_templates
populate_aggregated_jsons(path)
File "/usr/local/lib/python2.7/dist-packages/heudiconv/bids.py", line 150, in populate_aggregated_jsons
save_json(task_file, fields, indent=2, sort_keys=True, pretty=True)
File "/usr/local/lib/python2.7/dist-packages/heudiconv/utils.py", line 202, in save_json
data, sort_keys=sort_keys, indent=indent)
File "/usr/local/lib/python2.7/dist-packages/heudiconv/utils.py", line 231, in json_dumps_pretty
"Values differed when they should have not. "
AssertionError: Values differed when they should have not. Report to the heudiconv developers
In addition I have gotten errors previously from the bids validator regarding the json field "TaskName" not existing.
Platform details:
Choose one:
Custom singularity container. "singularity pull shub://tjhendrickson/BIDS_scripts"
0.5.2
0.5.2
From the CHANGELOG for 0.5.3:
Fixed
- Do not shorten spaces in the dates while pretty printing .json
Could you please try 0.5.3 release and report back. If it is not fixed - you can rerun with --dbg flag, end up in pdb and discover which file is at fault -- or where strings differ (we should improve error message there though indeed). We should release 0.5.4 also very soon, but I do not think it carries any relevant to you changes.
Thanks for the suggestion. I tried upgrading heudiconv to 0.5.3 and got another error:
**Traceback (most recent call last):
File "/usr/bin/heudiconv", line 11, in
load_entry_point('heudiconv==0.5.3', 'console_scripts', 'heudiconv')()
File "/usr/lib/python2.7/dist-packages/heudiconv/cli/run.py", line 125, in main
process_args(args)
File "/usr/lib/python2.7/dist-packages/heudiconv/cli/run.py", line 338, in process_args
overwrite=args.overwrite,)
File "/usr/lib/python2.7/dist-packages/heudiconv/convert.py", line 210, in prep_conversion
getattr(heuristic, 'DEFAULT_FIELDS', {}))
File "/usr/lib/python2.7/dist-packages/heudiconv/bids.py", line 72, in populate_bids_templates
populate_aggregated_jsons(path)
File "/usr/lib/python2.7/dist-packages/heudiconv/bids.py", line 140, in populate_aggregated_jsons
j = load_json(task_file)
File "/usr/lib/python2.7/dist-packages/heudiconv/utils.py", line 174, in load_json
data = json.load(fp)
File "/usr/lib/python2.7/json/init.py", line 291, in load
kw)
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
hi @tjhendrickson - it looks like something was messed up when creating a task-<task>.json file - could you try deleting that file and reconverting?
What command are you calling to run heudiconv?
Apr 04
'19 18:04
mgxd