--template-resampling-grid {my_locally_stored_template.nii.gz}

fmriprep

#1

Using fmriprep-docker v1.2.5 I am trying to use the --template-resampling-grid option and give a specific file as an argument (specifically, the MNI152_T1_2mm.nii.gz template included in the HCP pipelines). The file lives on my system on the same partition as the BIDS data, and is rwxrwxr-x, so should be accessible.

It however seems that the file cannot be found by the docker. What am I missing?

Here is the output to the screen:

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/local/miniconda/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/cli/run.py", line 738, in build_workflow
    ignore_aroma_err=opts.ignore_aroma_denoising_errors,
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/workflows/base.py", line 216, in init_fmriprep_wf
    ignore_aroma_err=ignore_aroma_err,
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/workflows/base.py", line 505, in init_single_subject_wf
    num_bold=len(subject_data['bold']))
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/workflows/bold/base.py", line 673, in init_func_preproc_wf
    name='bold_mni_trans_wf'
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/workflows/bold/resampling.py", line 335, in init_bold_mni_trans_wf
    mask_mni_tfm.inputs.reference_image = template_out_grid
  File "/usr/local/miniconda/lib/python3.6/site-packages/nipype/interfaces/base/traits_extension.py", line 112, in validate
    self.info_text, value))
traits.trait_errors.TraitError: The trait 'reference_image' of an ApplyTransformsInputSpec instance is an existing file name, but the path  '/data/templates/HCP/MNI152_T1_2mm.nii.gz' does not exist.

#2

It seems that the fmriprep-docker does not mount the folder for this particular argument. You have two options until we fix this:

  1. Put template in one of the: output, input, work_dir folders (those are automatically mounted). Use that path.
  2. Get the docker command line printed by fmriprep-docker and add something like -v /data/templates/HCP/:/data/templates/HCP/:ro next to other -v arguments. More about mounting docker volumes: https://docs.docker.com/storage/volumes/

#3

Thanks Chris! I chose solution 2.
of note, since the input dataset is mounted as /data when using fmriprep-docker, I ended up with the following two arguments to docker run:

-v /data/templates/HCP:/imports/templates/HCP:ro
–template-resampling-grid /import/templates/HCP/MNI152_T1_2mm.nii.gz


#4

BTW you can help us fix this bug: https://github.com/poldracklab/fmriprep/issues/1462 It would be a great way to get involved in the project.