Hi @Steven ,
I am using your first suggested option. Specifically, I have data from timepoint 1, timepoint 2, …, timepoint 18 for a single subject. I wanted to use an averaged template for all time points, so I used the FreeSurfer longitudinal pipeline to create this averaged template. I then used this template as input for the --fs-subjects-dir
argument in fMRIPrep.
Here’s my Docker command:
docker run -ti --rm \
-v project_path/bids:/data:ro \
-v project_path/derivatives/fmriprep:/out \
-v project_path/derivatives/work/fmriprep:/work \
-v /Applications/freesurfer/7.1.1/license.txt:/opt/freesurfer/license.txt \
-v project_path/derivatives/freesurfer:/opt/subjects \
nipreps/fmriprep:24.1.1 /data /out participant --participant-label 10001 \
--n_cpus 8 --skip_bids_validation --cifti-output 91k --stop-on-first-crash \
--fs-license-file /opt/freesurfer/license.txt --fs-subjects-dir /opt/subjects --work-dir /work
However, the fmriprep threw the following error:
241212-00:20:52,675 nipype.interface INFO:
resume recon-all : recon-all -autorecon1 -T2 /data/sub-10001/ses-scan01/anat/sub-10001_ses-scan01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -openmp 7 -subjid sub-10001 -sd /opt/subjects -notalairach -nonuintensitycor -nonormalization
2024-12-12 00:20:52,675 [ INFO] resume recon-all : recon-all -autorecon1 -T2 /data/sub-10001/ses-scan01/anat/sub-10001_ses-scan01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -openmp 7 -subjid sub-10001 -sd /opt/subjects -notalairach -nonuintensitycor -nonormalization
241212-00:20:52,676 nipype.interface INFO:
resume recon-all : recon-all -autorecon1 -T2 /data/sub-10001/ses-scan01/anat/sub-10001_ses-scan01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -openmp 7 -subjid sub-10001 -sd /opt/subjects -notalairach -nonuintensitycor -nonormalization
2024-12-12 00:20:52,676 [ INFO] resume recon-all : recon-all -autorecon1 -T2 /data/sub-10001/ses-scan01/anat/sub-10001_ses-scan01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -openmp 7 -subjid sub-10001 -sd /opt/subjects -notalairach -nonuintensitycor -nonormalization
2024-12-12 00:20:52,961 [ WARNING] WARNING: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
2024-12-12 00:20:52,961 [ WARNING] WARNING: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
241212-00:20:53,118 nipype.workflow INFO:
[Node] Finished "autorecon1", elapsed time 0.447008s.
2024-12-12 00:20:53,118 [ INFO] [Node] Finished "autorecon1", elapsed time 0.447008s.
241212-00:20:53,122 nipype.workflow WARNING:
[Node] Error on "fmriprep_24_1_wf.sub_10001_wf.anat_fit_wf.surface_recon_wf.autorecon1" (/work/fmriprep_24_1_wf/sub_10001_wf/anat_fit_wf/surface_recon_wf/autorecon1)
2024-12-12 00:20:53,122 [ WARNING] [Node] Error on "fmriprep_24_1_wf.sub_10001_wf.anat_fit_wf.surface_recon_wf.autorecon1" (/work/fmriprep_24_1_wf/sub_10001_wf/anat_fit_wf/surface_recon_wf/autorecon1)
241212-00:20:54,338 nipype.workflow ERROR:
Node autorecon1 failed to run on host aff3d29e813b.
2024-12-12 00:20:54,338 [ ERROR] Node autorecon1 failed to run on host aff3d29e813b.
241212-00:20:54,342 nipype.workflow ERROR:
Saving crash info to /out/sub-10001/log/20241211-230558_798c357b-6629-4379-95e9-69168390283b/crash-20241212-002054-root-autorecon1-77fbb309-5aa0-4ddf-a158-30b4c09789dc.txt
Traceback (most recent call last):
File "/opt/conda/envs/fmriprep/lib/python3.11/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.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/fmriprep/lib/python3.11/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 autorecon1.
Cmdline:
recon-all -autorecon1 -T2 /data/sub-10001/ses-scan01/anat/sub-10001_ses-scan01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -openmp 7 -subjid sub-10001 -sd /opt/subjects -notalairach -nonuintensitycor -nonormalization
Stdout:
ERROR: It appears that this subject ID is an existing
base/template from longitudinal processing (-base):
sub-10001
If you are trying to re-run a -base template you
need to pass the -base and all -tp flags:
\' -base <templateid> -tp <tpNid> ... -all \'
(Instead of -all you can pass other flags, such
as -autorecon2 -autorecon3 to run only parts.)
Stderr:
Traceback:
RuntimeError: subprocess exited with code 1.
It appears that fMRIPrep is still trying to re-run recon-all and isn’t accepting the base/template generated from longitudinal processing.
Am I using the correct workflow here? Is there something I’m missing or doing wrong in integrating the FreeSurfer longitudinal template with fMRIPrep?
Thanks for your help!