Dcm2bids singularity workflow stops working when upgrading from a 2019 version to the latest 2022 version

Summary of what happened:

I’ve had some errors processing some DICOMs with a 2019 version of dcm2bids (run from a singularity .simg image) and I am trying to replace this image with the latest version from Docker.

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

singularity run -B /path/to/dicoms/ -B /path/to/bids_data -B /path/to/script/folder/conversion /path/to/container/folder/dcm2bids_2.1.9.sif -d /path/to/dicoms/SUB111_20220901_174220 -s wave2 -p SUB111 -c /path/to/script/folder/conversion/study_config.json -o /path/to/bids_data --forceDcm2niix --clobber

Version:

2.1.9

Environment (Docker, Singularity, custom installation):

Singularity

Data formatted according to a validatable standard? Please provide the output of the validator:

Relevant log outputs (up to 20 lines):

Although this will work for the old image, for the new image, it throws an error

set: invalid option: "-d" FATAL: "-d": executable file not found in $PATH

Screenshots / relevant information:

It is true that singularity doesn’t contain an option -d (singularity run — Singularity container 3.3 documentation) but this option is for dcm2bids. For dcm2bids it is standard to pass that option: Use main commands - Dcm2Bids . I might be mistaken, but I think the construction above is the correct way to pass arguments to dcm2bids (i.e., list it in the singularity run command, after specifying the singularity image). So either dcm2bids isn’t recognizing -d or it is not being passed to the singularity image. Most likely, the command within the new singularity image needs its command run some other way. It worked fine for our 2019 simg file, and I can’t find documentation on what command the latest sif file needs.

Anyone know what might be wrong here?

Hi @bensmith,

You may want to try using singularity exec [OPTIONS] IMG CMD [ARGS] instead, as the container may not have a default run command.

singularity exec -B /path/to/dicoms/ -B /path/to/bids_data -B /path/to/script/folder/conversion /path/to/container/folder/dcm2bids_2.1.9.sif dcm2bids -d /path/to/dicoms/SUB111_20220901_174220 -s wave2 -p SUB111 -c /path/to/script/folder/conversion/study_config.json -o /path/to/bids_data --forceDcm2niix --clobber

Also, for future reference, software support issues should go under the Software Support category, which has its own post template. I have relabeled and organized your post accordingly.

Best,
Steven

1 Like

Thanks for adding the tag!

I just tried adding /usr/local/bin/dcm2bids after the path to the image file, like

singularity run -B /path/to/dicoms/ -B /path/to/bids_data -B /path/to/script/folder/conversion /path/to/container/folder/dcm2bids_2.1.9.sif /usr/local/bin/dcm2bids -d /path/to/dicoms/SUB111_20220901_174220 -s wave2 -p SUB111 -c /path/to/script/folder/conversion/study_config.json -o /path/to/bids_data --forceDcm2niix --clobber

while keeping the original run command. It seems to be working. But I’ll try your suggestion next if that doesn’t solve the problem. I have to guess I probably didn’t need to specify /usr/local/bin/.

1 Like