Singularity container weirdness: neurodocker vs (?) FreeSurfer

Hi folks,

This is one for neuroimaging and/or Singularity container people.

I’ve built a Singularity container to run BIDS-App/FreeSurfer via neurodocker. But when I run the container it doesn’t recognise the inputs:

singularity run freesurfer7p1p1container.sif xxx_bids xxx_bids_output participant --participant_label 001 --session_label 01 --license_file "/home/vagrant/license.txt" --skip_bids_validator

Output:

usage: run.py ... bids_dir output_dir {participant,group1,group2}

run.py: error: the following arguments are required: bids_dir, output_dir, analysis_level

FreeSurfer runs if I do it from within the container.

So, I’m wondering if it’s something to do with the neurodocker default entry point, which uses a single line like startup.sh run.py to simultaneously set some environment variables (startup.sh) and then run the FreeSurfer command (run.py). I suspect that the input arguments to run.py (processed using argparse) are somehow getting lost, either at this point, or in transit to the container. I’ve tried escaping spaces and using quotes…no dice!

FYI, I’m building the singularity container using a virtual ubuntu machine via vagrant on a Mac. Other (non-neurodocker) containers work for me, so I’m quite confused.

Grateful for any help. Cheers!

Managed to fix this by explicitly “@”-ing the inputs. See:
line 314 of my Singularity_fs7
vs
line 314 of Shotgunosine’s Singularity_fs7