BIDS App Singularity container: "Exec format error"


I apologize for posting here since I am unable to post a new thread for some reason (perhaps my account is new).

I just started exploring the BIDS app for MRtrix3_connectome, downloaded a singularity image for it, and tried to use the following commands to get it running:


module load singularity

cd $dataDIR

singularity run -B /PROJECTS:/PROJECTS $sing_img $dataDIR $dataDIR/output participant --participant_label sub-pilot20190225 --parcellation desikan

This is a BIDS validated dataset, however, I am getting the following
error:/.singularity.d/runscript: 3: exec: / Exec format error

Does anyone know how this can be fixed? I am sorry but I am very new to MRtrix3. Thanks for your help.

MRtrix3_connectome update 0.3.0

Hi @fmriguy,

From memory we had to forbid brand new accounts from creating new topics in order to prevent spambots. I’ve moved it to a new topic for you, and you should be free to do such from now on :+1:

I don’t actually (yet) provide the requisite file for building a Singularity image for this tool. Either you’ve used the docker2singularity conversion tool (which I’ve not used myself for a long time), or the location where you’ve accessed the container is in fact a fork of my own work and so I can’t really help a great deal. It seems to relate to what’s referred to in Docker speak as the “entrypoint”, seemingly trying to interpret that file as a binary executable when it is in fact a Python script. Normally this is identified based on the shebang at the head of the file, but perhaps Singularity requires this to be more explicit during container production?

@lvinokur: Ever encountered this one?



Hi @fmriguy ,
I complete second what @rsmith said and will just add some details :
First of all - note you are downloading a docker container, which needs to be explicitly converted to singularity. It’s a simple command that requires you use docker2singularity.
If you’ve done that already and docker2singularity didn’t raise any errors then I have two suggestions:

  • Use singularity run rather than singularity exec
  • Check the python shebang. At one time is has given me similar woes. Even a blank line before the shebang can cause this error.
    In either case - let us know if either of these sort the problem :slight_smile:



Thank you for your replies and help @rsmith and @lvinokur

I was wondering if the mrtrix3_connectome BIDS app can handle custom parcellations beyond the few that are already built in. For instance, the Schaefer et al (2018) parcellations from Thomas Yeo’s group are gaining popularity, and it would be nice to be able to feed in the GM roi’s from the Schaefer parcellation and obtain mrtrix3 connectomes.


There’s no way to handle parcellations outside of the set currently supported by the script that does not require explicit manipulation of the code. You can however make requests for such by listing it as a GitHub issue; or fork the repository and make the changes yourself.

For the parcellations you describe, I’ve got a funny feeling that I’ve already implemented those somewhere; I’m just having a lot of trouble finding time to put into this tool. I’ll see if I can find it…