Skip to content

nibabel can't read my data and heudiconv doesn't explain why #455

Open
@Terf

Description

@Terf

Summary

When I run

docker run -v $PWD:/base nipy/heudiconv \
-d "/base/Data/{subject}-{session}/Hopkins/dicom/*/*.dcm" \
-o /base/Nifti/ -f convertall -s 01 -ss 001 -c none --overwrite

I get an error that nibabel.nicom.dicomwrappers.WrapperError: File contains more than one StackID. Cannot handle multi-stack files. Would anyone know what a StackID even is? I can't find much about it either in the heudiconv docs or elsewhere online, but the stack trace indicates the problem occurs on line 105 in the heudiconv source where you can see a try-catch block, but only KeyErrors are caught. So, I tried catching all errors by using sed to remove KeyError:

docker run -v $PWD:/base --entrypoint="" nipy/heudiconv bash -c \
"sed -i 's/ KeyError//g' /src/heudiconv/heudiconv/dicoms.py && heudiconv -d '/base/Data/{subject}-{session}/Hopkins/dicom/*/*.dcm' -o /base/Nifti/ -f convertall -s 01 -ss 001 -c none --overwrite"

which does bypass the error in that particular spot but moves the problem downstream so it simply fails a bit later in the run. I’ve never seen this issue with other datasets I’ve converted, so I assume the issue is actually with the data, not the code, but I have no idea what it could be. Does anyone else? Ultimately I hope to submit a PR that catches the nibabel exception and raises our own exception with more of an explanation.

Platform details:

Choose one:

  • Local environment
  • Container: nipy/heudiconv (latest tag as of 5/22/20)
  • Heudiconv version: 0.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions