Fmriprep defaulting to standard atlas

Summary of what happened:

Hi, I am running fmriprep on mouse data - I have added the DSURQE mouse template to my templateflow directory, but fmriprep still also uses the default human template.

In the command, I specify output_spaces to use ‘DSURQE:res-3’ which I have verified exists and looks as expected. fmriprep in fact did create relevant folders such as fmriprep_23_1_wf/single_subject_LD23_wf/func_preproc_ses_chronic_task_resting_wf/bold_std_trans_wf/_std_target_DSURQE.res3 and populated them so I do believe fmriprep has seen and attempted using the atlas I want. However, it still tries to perform registration to the default _std_target_MNI152NLin2009cAsym. atlas as seen from my error message below. This folder does indeed exist in the output folder as well. In the DSURQE output folder, the missing file fmriprep is complaining about (vol0000_xform-00000_clipped_merged_sliced_md.1D) is missing too.

Am I doing something wrong such that the gen_avg.a1 process cannot run? Or is it to do with the default template being unsuitable for my mouse data? If so, how force fmriprep to only use the DSURQE atlas?

Thank you.

Command run:

fmriprep /home/tanjazl1/scratch/fmriprep_test \
        /home/tanjazl1/scratch/fmriprep_test_output \
        participant \
        --verbose --skip-bids-validation \
        -w /home/tanjazl1/scratch/fmriprep_test_output \
        --fs-license-file /home/tanjazl1/scratch/fmriprep_test_output/freesurfer_liscence.txt \
        --output-spaces DSURQE:res-3 \
        --anat-derivatives /home/tanjazl1/scratch/fmriprep_test_output/anat_derivatives \
        --fs-no-reconall --skull-strip-template DSURQE:res-3 \
        --ignore fieldmaps

Templateflow directory

scratch/templateflow/tpl-DSURQE/
├── template_description.json
├── tpl-DSURQE_res-1_desc-brain_mask.nii.gz
├── tpl-DSURQE_res-1_dseg.nii.gz
├── tpl-DSURQE_res-1_T1w.nii.gz
├── tpl-DSURQE_res-2_desc-brain_mask.nii.gz
├── tpl-DSURQE_res-2_dseg.nii.gz
├── tpl-DSURQE_res-2_T1w.nii.gz
├── tpl-DSURQE_res-3_desc-brain_mask.nii.gz
├── tpl-DSURQE_res-3_dseg.nii.gz
└── tpl-DSURQE_res-3_T1w.nii.gz

Error message:

250226-01:45:36,960 nipype.workflow ERROR:
	 could not run node: fmriprep_23_1_wf.single_subject_LD23_wf.func_preproc_ses_chronic_task_resting_wf.bold_std_trans_wf.bold_reference_wf.gen_avg.a1
250226-01:45:36,964 nipype.workflow INFO:
	 crashfile: /home/tanjazl1/scratch/fmriprep_test_output/sub-LD23/log/20250225-225529_b3a2b34a-b923-481f-9314-6e78ec980880/crash-20250226-010254-tanjazl1-gen_avg.a1-2f65bc7b-1de5-4d77-ad29-01e8cf94fa7f.txt
250226-01:45:36,964 nipype.workflow INFO:
	 ***********************************
250226-01:45:37,315 nipype.workflow CRITICAL:
	 fMRIPrep failed: Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node gen_avg.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
	    setattr(outputs, key, val)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
	    value = super(File, self).validate(objekt, name, value, return_pathlike=True)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
	    self.error(objekt, name, str(value))
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: The 'md1d_file' trait of a VolregOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/home/tanjazl1/scratch/fmriprep_test_output/fmriprep_23_1_wf/single_subject_LD23_wf/func_preproc_ses_chronic_task_resting_wf/bold_std_trans_wf/bold_reference_wf/_std_target_MNI152NLin2009cAsym./gen_avg/vol0000_xform-00000_clipped_merged_sliced_md.1D' <class 'str'> was specified.

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/niworkflows/interfaces/images.py", line 337, in _run_interface
	    res = volreg.run()
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 400, in run
	    outputs = self.aggregate_outputs(runtime)
	  File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
	    raise FileNotFoundError(msg)
	FileNotFoundError: No such file or directory '/home/tanjazl1/scratch/fmriprep_test_output/fmriprep_23_1_wf/single_subject_LD23_wf/func_preproc_ses_chronic_task_resting_wf/bold_std_trans_wf/bold_reference_wf/_std_target_MNI152NLin2009cAsym./gen_avg/vol0000_xform-00000_clipped_merged_sliced_md.1D' for output 'md1d_file' of a Volreg interface

Version and environment:

I am using Compute Canada’s fmriprep version 23.1.3. My data is in BIDS structure although there is only a single subject and session for now while I am testing fmriprep.


Hi @jazlynnT and welcome to neurostars!

Not a direct answer to your question, but have you tried fmriprep-rodents? GitHub - nipreps/fmriprep-rodents: fMRIPrep for Rodents

Also are you using Singularity or Docker to run the code? And does the error persist on the latest version and with a different subject? What resources were devoted to the job?

Best,
Steven

Hi,

I considered fmriprep-rodents but since it also says its for rats and not mice, I just decided to just try frmiprep. I dont use any containers, just fmriprep directly. I am using the latest version available to me. I have tried it with varying amounts of memory (100-240G) and number of CPUs (8-30) but according to job efficiency reports there hasnt been any problems with that.

Hi @jazlynnT,

I don’t know if fmriprep will work in mice. But in any case you should run fmriprep in a container for best performance.

Best,
Steven