nipy / heudiconv

Flexible DICOM conversion into structured directory layouts
https://heudiconv.readthedocs.io
Other
234 stars 125 forks source link

assert HEUDICONV_VERSION_JSON_KEY not in json_ AssertionError. XA30 subjects failing conversion. #687

Open Noah-Baden opened 1 year ago

Noah-Baden commented 1 year ago

Summary

Platform details:

Choose one:

I've been trying to convert subjects using a Siemens fmri scanner with XA30 software. Something is going wrong when the jsons are being created, but I have not been able to figure out what.

Here is the last part of the output I am getting.

Traceback (most recent call last): File "/home/usr/badenn/.local/bin/heudiconv", line 8, in <module> sys.exit(main()) File "/home/usr/badenn/.local/lib/python3.9/site-packages/heudiconv/cli/run.py", line 30, in main workflow(**kwargs) File "/home/usr/badenn/.local/lib/python3.9/site-packages/heudiconv/main.py", line 463, in workflow prep_conversion( File "/home/usr/badenn/.local/lib/python3.9/site-packages/heudiconv/convert.py", line 255, in prep_conversion convert( File "/home/usr/badenn/.local/lib/python3.9/site-packages/heudiconv/convert.py", line 635, in convert tuneup_bids_json_files(bids_outfiles) File "/home/usr/badenn/.local/lib/python3.9/site-packages/heudiconv/bids.py", line 334, in tuneup_bids_json_files assert HEUDICONV_VERSION_JSON_KEY not in json_ AssertionError

Any help that can be given would be greatly appreciated.

yarikoptic commented 1 year ago

Do you remember by any chance the exact command line for the heudiconv invocation you have used? e.g. have you used --overwrite may be? may be you have a log output handy somehow?

Noah-Baden commented 1 year ago

heudiconv --files /path/to/dicoms -c dcm2niix -o /path/to/output -b notop -s 20071 -ss 53043 -f /path/to/heuristic/heuristics.py --overwrite Here's the full output. I have been using --overwrite

yarikoptic commented 1 year ago

great, so it is the --overwrite I suspected... I think that assert assumption was just wrong for such a case and we could just remove it... but need a quality minute for that or someone could submit a PR checking on that etc

Noah-Baden commented 1 year ago

Okay, I tried it without the --overwrite, but it still didn't work. It changed to a different error Heuristic_error_without_overwrite.txt is the new output.

yarikoptic commented 1 year ago

well -- that one rightfully says correct thing:

❯ tail -n1 /tmp/Heuristic_error_without_overwrite.txt
RuntimeError: was asked to move /net/10.20.145.45/DOSENBACH03/GMT3/Noah/ASD_ADHD/sub-20071/ses-53043/func/sub-20071_ses-53043_task-rest_run-01_part-mag_bold_heudiconv547_e1a.nii.gz but destination already exists: /net/10.20.145.45/DOSENBACH03/GMT3/Noah/ASD_ADHD/sub-20071/ses-53043/func/sub-20071_ses-53043_task-rest_run-01_echo-1_part-mag_bold.nii.gz

are you trying to reconvert an existing subject/session or this is "from scratch" (whenever there is no ./sub-20071/ses-53043) for that subject session and somehow heuristic or heudiconv creates two conflicting destinations?

Noah-Baden commented 1 year ago

I'm creating it from scratch. I've been deleting the ses-53043/ folder before I run heudiconv without --overwrite

yarikoptic commented 1 year ago

if you have stored output from logging while running heudiconv -- does it mention that sub-20071_ses-53043_task-rest_run-01_echo-1_part-mag_bold.nii.gz twice? What is your auto.edit.txt for this series? (didn't analyze heuristic thoroughly). I wonder what to places decide that there is multiple identically named files. may be your heuristic also manages to bring multiple sequences under the same name sub-20071_ses-53043_task-rest_run-01_bold.nii.gz?