fMRIPrep Ignoring Pre-Processed FreeSurfer from HCP-Aging 2.0

Summary of what happened:

I’m running fMRIPrep on HCP-Aging 2.0 data using FreeSurfer derivatives from the original HCP pipeline (a modification of FreeSurfer v.6.0) and fMRIPrep is attempting to recreate surfaces (anat_preproc_wf.surface_recon_wf.autorecon_resume_wf.autorecon3) while recognizing the FreeSurfer directory. fMRIPrep subsequently fails because ${fs_sub}/surf/autodet.gw.stats.lh.dat is not available.

What is triggering fMRIPrep to try and recreate surfaces?

Command used (and if a helper script was used, a link to the helper script or the command generated):

singularity run \
        --cleanenv -B /projects \
        /projects/p30952/environment/singularity_images/${FMRIPREP_VER}.simg \
        ${BIDS_DIR} \
        ${FMRIPREP_DIR} \
        participant --participant-label ${subject} \
        -w ${WORK_DIR} \
        --omp-nthreads 8 \
        --nthreads 12 \
        --mem_mb 24000 \
        --fs-license-file ${FS_LICENSE} \
	    --fs-subjects-dir ${BIDS_DIR}/derivatives/freesurfer \
        --output-spaces anat fsnative MNI152NLin2009cAsym fsLR fsaverage \
        --cifti-output 91k \
        --fd-spike-threshold 0.4 \
        --dvars-spike-threshold 1.5 \
	    --dummy-scans 4

Version:

22.1.1

Environment (Docker, Singularity, custom installation):

Singularity

Data formatted according to a validatable standard? Please provide the output of the validator:

Yes

Relevant log outputs (up to 20 lines):


Node Name: fmriprep_22_1_wf.single_subject_HCA6018857_wf.anat_preproc_wf.surface_recon_wf.autorecon_resume_wf.autorecon3

File: /projects/b1145/bram/hcp-aging/derivatives/fmriprep-22.1.1/sub-HCA6018857/log/20230301-094808_98f30593-f88c-4e22-83f6-3c20cbf83641/crash-20230301-102937-brd2241-autorecon3-bfe8f795-56d8-4ad2-a63e-4a34d27191cc.txt
Working Directory: /projects/b1145/bram/work/fmriprep_22_1_wf/single_subject_HCA6018857_wf/anat_preproc_wf/surface_recon_wf/autorecon_resume_wf/autorecon3
Inputs:

    FLAIR_file:
    T1_files:
    T2_file:
    args:
    big_ventricles:
    brainstem:
    directive: autorecon3
    environ: {}
    expert:
    flags:
    hemi:
    hippocampal_subfields_T1:
    hippocampal_subfields_T2:
    hires:
    mprage:
    mri_aparc2aseg:
    mri_ca_label:
    mri_ca_normalize:
    mri_ca_register:
    mri_edit_wm_with_aseg:
    mri_em_register:
    mri_fill:
    mri_mask:
    mri_normalize:
    mri_pretess:
    mri_remove_neck:
    mri_segment:
    mri_segstats:
    mri_tessellate:
    mri_watershed:
    mris_anatomical_stats:
    mris_ca_label:
    mris_fix_topology:
    mris_inflate:
    mris_make_surfaces:
    mris_register:
    mris_smooth:
    mris_sphere:
    mris_surf2vol:
    mrisp_paint:
    openmp: 8
    parallel:
    steps:
    subject_id: recon_all
    subjects_dir:
    talairach:
    use_FLAIR:
    use_T2:
    xopts:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/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 autorecon3.

Cmdline:
	recon-all -autorecon3 -openmp 8 -subjid sub-HCA6018857 -sd /projects/b1145/bram/hcp-aging/derivatives/freesurfer -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -noparcstats -nocortparc2 -noparcstats2 -nocortparc3 -noparcstats3 -nopctsurfcon -nocortribbon -nohyporelabel -noaparc2aseg -nosegstats -nowmparc -nobalabels
Stdout:
	INFO: FreeSurfer build stamps do not match
	Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
	Current Stamp: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
	INFO: SUBJECTS_DIR is /projects/b1145/bram/hcp-aging/derivatives/freesurfer
	Actual FREESURFER_HOME /opt/freesurfer
	-rw-rw-r-- 1 brd2241 p30952 774858 Feb 28 07:21 /projects/b1145/bram/hcp-aging/derivatives/freesurfer/sub-HCA6018857/scripts/recon-all.log
	Linux qnode8140 3.10.0-1160.71.1.el7.x86_64 #1 SMP Wed Jun 15 08:55:08 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
	/projects/b1145/bram/hcp-aging/derivatives/freesurfer/sub-HCA6018857/mri/transforms /projects/b1145/bram/hcp-aging/derivatives/freesurfer/sub-HCA6018857 
	/projects/b1145/bram/hcp-aging/derivatives/freesurfer/sub-HCA6018857 
	#--------------------------------------------
	#@# WhiteSurfs lh Wed Mar  1 10:29:35 CST 2023
	cd /projects/b1145/bram/hcp-aging_nda-pkgs/HCPAgingT1wT2wrsfMRIAllAgePkg/fmriresults01/HCA6018857_V1_MR/T1w/HCA6018857_V1_MR/mri
	mris_place_surface --adgws-in ../surf/autodet.gw.stats.lh.dat --seg aseg.presurf.mgz --threads 8 --wm wm.mgz --invol brain.finalsurfs.mgz --lh --i ../surf/lh.white.preaparc --o ../surf/lh.white --white --nsmooth 0 --rip-label ../label/lh.cortex.label --rip-bg --rip-surf ../surf/lh.white.preaparc --aparc ../label/lh.aparc.annot
	ERROR: reading ../surf/autodet.gw.stats.lh.dat
	Linux qnode8140 3.10.0-1160.71.1.el7.x86_64 #1 SMP Wed Jun 15 08:55:08 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

	recon-all -s sub-HCA6018857 exited with ERRORS at Wed Mar  1 10:29:35 CST 2023

	For more details, see the log file /projects/b1145/bram/hcp-aging/derivatives/freesurfer/sub-HCA6018857/scripts/recon-all.log
	To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Stderr:

Traceback:
	RuntimeError: subprocess exited with code 1.

Thank you!
Bram

Hi @bramdiamond ,

I wonder if there were any breaking changes between this version and version 7.2 (which fmriprep 22+ uses). Could you try with either version 21.0.4 (last release before changing FS versions) or the latest LTS branch 20.2.7?

Best,
Steven

Thanks, @Steven.

I should also say that the pipeline worked with another participant. I can try 21.0.4, but I would ideally like to use the most current stable version of fMRIPrep.

Bram

On the latest branch, does the subject work if you try clearing the cache and running again? Is there anyway to ensure that subject has full FS outputs?