nipy / heudiconv

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

heudiconv produces strange filenames with _heudiconv740_Eq_1 at the end #694

Closed askieslinger closed 1 year ago

askieslinger commented 1 year ago

Summary

My heudiconv runs sometimes produce multiple versions of the same file, one with the normal/expected filename, the other with the normal filename and _heudiconv<number>_Eq_1 appended. Example:

add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_UNIT1.json (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_UNIT1.nii.gz (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_UNIT1_heudiconv343_Eq_1.nii.gz (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_inv-1_MP2RAGE.json (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_inv-1_MP2RAGE.nii.gz (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_inv-1_MP2RAGE_heudiconv994_Eq_1.nii.gz (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_inv-2_MP2RAGE.json (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_inv-2_MP2RAGE.nii.gz (file)
add(ok): sub-002/ses-audio/anat/sub-002_ses-audio_run-1_inv-2_MP2RAGE_heudiconv740_Eq_1.nii.gz (file)

Here is the log of the datalad containers-run slurm-6974830-s01_convert_sub-002_ses-audio.txt

Here is my heuristic heuristic.txt Relevant part:


            suffix = f"inv-{inv}_MP2RAGE"

            t1w = create_key(  # Create BIDS file name and extension
                f"{{bids_subject_session_dir}}/anat/{{bids_subject_session_prefix}}_run-{item}_{suffix}")
            info.setdefault(t1w, []).append({'item': s.series_id})

I have also checked the heudiconv info files and the conversion keys look normal. 002_ses-audio.auto.txt

Why does this happen?

Platform details:

Choose one:

askieslinger commented 1 year ago

I found out that this is a dcm2niix problem in case of incomplete datasets, see here. Closing this and hoping it will help others with the same problem.