Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several errors when invoking `res-2` options that are template dependent when using --output-spaces #1687

mnarayan opened this issue Jul 4, 2019 · 6 comments


3 participants
Copy link

commented Jul 4, 2019

I am using fmriprep version 1.4.0.

Basically it looks like for many MNI152 templates, I am not able to successfully run with the res-2 option. Are there some templates for which this will work or must I only stick to native BOLD dimensions?

I am invoking fmriprep with the following options --use-aroma and --output-spaces MNI152NLin2009cAsym MNI152NLin6Asym:res-2 fsaverage5 T1w.

I hit the following error:

Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/", line 297, in _bootstrap
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/", line 608, in build_workflow
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/", line 258, in init_fmriprep_wf
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/", line 549, in init_single_subject_wf
  File "/usr/local/miniconda/lib/python3.7/site-packages/smriprep/workflows/", line 305, in init_anat_preproc_wf
  File "/usr/local/miniconda/lib/python3.7/site-packages/smriprep/workflows/", line 103, in init_anat_norm_wf
    'This is embarrassing - custom templates are not (yet) supported.'
NotImplementedError: This is embarrassing - custom templates are not (yet) supported.Please make sure none of the options already available via TemplateFlow fit your needs.

On the other hand, when I invoke --output-spaces MNI152NLin2009cAsym MNI152NLin6sym:res-2 fsaverage5 T1w, I get a different read only nipype error, probably because the default directory where templates are being modified has no write access.

The crash report is related to this node
Node: fmriprep_wf.single_subject_xxxxx_wf.anat_preproc_wf.anat_norm_wf.registration

with the following error

num_threads = 4
orientation = RAS
out_report = report.svg
reference = T1w
reference_image = <undefined>
reference_mask = <undefined>
settings = <undefined>
template = MNI152NLin6Sym
template_resolution = 1

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/", line 69, in run_node
    result['result'] =
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/", line 472, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/", line 563, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/", line 643, in _run_command
    result =
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/", line 375, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/", line 125, in _run_interface
    ants_args = self._get_ants_args()
  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/", line 344, in _get_ants_args
    desc=None, suffix=self.inputs.reference)
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/", line 39, in get
  File "/usr/local/miniconda/lib/python3.7/site-packages/templateflow/", line 139, in _s3_get
    with'wb') as f:
  File "/usr/local/miniconda/lib/python3.7/", line 1176, in open
  File "/usr/local/miniconda/lib/python3.7/", line 1030, in _opener
    return, flags, mode)
OSError: [Errno 30] Read-only file system: '/opt/templateflow/tpl-MNI152NLin6Sym/tpl-MNI152NLin6Sym_res-01_T1w.nii.gz'

This comment has been minimized.

Copy link

commented Jul 4, 2019

Relatedly, I was using the template/ resampling grid options to output the fmri in exactly the same size and shape as the MNI152 2mm brain distributed with FSL (91x109x91) so that I could save the data as vectorized npy files... is this no longer possible? (Also getting these errors now)


This comment has been minimized.

Copy link

commented Jul 5, 2019

Hi @mnarayan,

Regarding the first error, you are right. That exact problem led us to brew several release candidates, up until rc4 - could you please check that is not happening anymore with version 1.4.1rc4?

Regarding the second error, you are right again. Can you describe a bit further your settings so that I can give you a recommendation on how to run it?

@alexlicohen yes, you would do that with the <template-id>:res-2 semantic (see

@oesteban oesteban added the bug label Jul 5, 2019

@oesteban oesteban added this to To do in pipelines via automation Jul 5, 2019

@oesteban oesteban added this to the 1.4.1 milestone Jul 5, 2019


This comment has been minimized.

Copy link

commented Jul 6, 2019

Thanks Oscar.
So on using 1.4.1rc4 I did not run into any issues when I simply added :res-2 to the default template MNINLin2009Asymc but without --use-aroma, it seems to work fine. That is, I seem to be able to specify :res-2 without an issue in this case.

I am also able to turn on --use-aroma with 1.4.1rc4

    singularity run ${FPREP_IMG} ${BIDSDIR} ${OUTPUTDIR} participant --skip-bids-validation \
	--participant_label ${sub} \
        --dummy-scans 6 \
        --use-syn-sdc \
        --use-aroma \
        --task-id rest \
        --bold2t1w-dof 12 \
        --ignore-aroma-denoising-errors \
        --output-spaces "MNI152NLin2009cAsym:res-2 anat fsLR" \
        --ignore "${IGNORE_OPTS}" \
        --cifti-output \
        --fs-license-file /share/software/user/open/freesurfer/6.0.0/license.txt \
        --longitudinal \
        -w ${WORKDIR} --n_cpus ${N_CPUS} --omp-nthreads 4 --mem_mb ${MEM_MB}

I no longer get the first error when I do this. I will report back on the second one.


This comment has been minimized.

Copy link

commented Jul 7, 2019

I also realized that --output-spaces MNI152NLin6Asym:res-2 gives me the output I want, but an example in the documentation of how to appropriately set a custom template would be useful for those that need it, i.e.,

is it:
--output-spaces /standard/MNI152_T1_2mm_brain_mask.nii.gz
--output-spaces /standard/MNI152_T1_2mm_brain_mask.nii.gz:res-2

or something else...

@franklin-feingold franklin-feingold moved this from To do to Next week's targets in pipelines Jul 8, 2019


This comment has been minimized.

Copy link

commented Jul 8, 2019

Hi @alexlicohen I totally agree that an example of custom templates should be added to the docs - I have added a new issue. If you feel like writing it, please let me know and I'll provide further details.


This comment has been minimized.

Copy link

commented Jul 9, 2019

Hi @mnarayan,

If I understood correctly, you are managing to work with and without --use-aroma after switching to 1.4.1rc4?

Regarding the second error, can we follow up via neurostars? I believe more people will be interested in fixing that particular issue. Posted here -

Please reopen this issue if you feel this didn't address all the issues.

@oesteban oesteban closed this Jul 9, 2019

pipelines automation moved this from Next week's targets to Done Jul 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.