Heudiconv Attribute Error

Summary of what happened:

Hi all,

Upon running heudiconv to convert DICOM files, the script failed to run the conversion and returned AttributeError: 'Dataset' object has no attribute 'DimensionIndexValues'.

We would like to determine whether this is an issue with the conversion software (dcm2niix) and if there may be an additional step to identifying this data in our DICOM files.

Thank you!

Command used (and if a helper script was used, a link to the helper script or the command generated):

cmd="singularity run --cleanenv -B /work/swglab /work/swglab/software/heudiconv/heudiconv_${version}.simg 
  -d ${dicom_dir}/sub-{subject}_ses-{session}/dicom/*.dcm
  -o ${main_proj}/rawdata
  -f ${scripts_dir}/heuristic.py 
  -c dcm2niix
  --bids
  -s ${subject} 
  -ss ${session} 
  --overwrite"


echo "+ CONVERTING dcm2nii for SUBJECT ${subject} SESSION ${session}"
printf "+ CONVERSION COMMAND IS:\n\n"
printf "${cmd}\n\n"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"


# Run the conversion.
$cmd

Version: 0.9.0

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity

Relevant log outputs (up to 20 lines):

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO: Running heudiconv version 0.9.0 latest 1.1.6
INFO: Need to process 1 study sessions
INFO: PROCESSING STARTS: {'subject': 'sharp2998', 'outdir': '/work/swglab/data/SHARP2/rawdata/', 'session': 'baseline'}
INFO: Processing 3882 dicoms
INFO: Analyzing 3882 dicoms
Traceback (most recent call last):
  File "/opt/miniconda-latest/bin/heudiconv", line 33, in <module>
    sys.exit(load_entry_point('heudiconv', 'console_scripts', 'heudiconv')())
  File "/src/heudiconv/heudiconv/cli/run.py", line 24, in main
    workflow(**kwargs)
  File "/src/heudiconv/heudiconv/main.py", line 351, in workflow
    grouping=grouping,)
  File "/src/heudiconv/heudiconv/convert.py", line 176, in prep_conversion
    custom_grouping=getattr(heuristic, 'grouping', None))
  File "/src/heudiconv/heudiconv/dicoms.py", line 201, in group_dicoms_into_seqinfos
    mwinfo = validate_dicom(filename, dcmfilter)
  File "/src/heudiconv/heudiconv/dicoms.py", line 105, in validate_dicom
    del mw.series_signature[sig]
  File "/opt/miniconda-latest/lib/python3.6/site-packages/nibabel/onetime.py", line 142, in __get__
    val = self.getter(obj)
  File "/opt/miniconda-latest/lib/python3.6/site-packages/nibabel/nicom/dicomwrappers.py", line 642, in series_signature
    signature['image_shape'] = (self.image_shape, eq)
  File "/opt/miniconda-latest/lib/python3.6/site-packages/nibabel/onetime.py", line 142, in __get__
    val = self.getter(obj)
  File "/opt/miniconda-latest/lib/python3.6/site-packages/nibabel/nicom/dicomwrappers.py", line 543, in image_shape
    for frame in self.frames])
  File "/opt/miniconda-latest/lib/python3.6/site-packages/nibabel/nicom/dicomwrappers.py", line 543, in <listcomp>
    for frame in self.frames])
  File "/opt/miniconda-latest/lib/python3.6/site-packages/pydicom/dataset.py", line 835, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Dataset' object has no attribute 'DimensionIndexValues'

  • what is nibabel and pydicom versions? e.g. output like
❯ python -c 'import nibabel as nib, pydicom as di; print(nib.__version__, di.__version__)'
5.2.1 2.4.4