Error running fMRIprep on pre-run Freesurfer outputs

Summary of what happened:

Hello!

I have run fMRIprep (v. 22.0.1) once on my data (just one subject, one session, two runs). When I first ran it, I used my fMRIprep command to run recon-all. Now, I want to run it again, but this time I would like to use the recon-all outputs that I got from my first time running fMRIprep (they are stored in bids-root/derivatives/sourcedata/freesurfer, and are in a BIDS compatible format). Unfortunately, it crashed, and I am not sure how to address the issue.

I’m confused as to why everything was undefined, and also confused how my subject ID got set to “recon_all” …?

Is there any way to fix this? I am running fMRIprep on an institutional HPC and the only fMRIprep versions that we have installed on it are v22.0.1 and v20.2.3.

Thanks!

Ryann

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

FMRIPREP=/global/software/fmriprep/containers/fmriprep-22.0.1.simg

singularity run $FMRIPREP bids-root bids-root/derivatives3 participant \
			  --fs-license-file license.txt \
			  --fs-subjects-dir bids-root/derivatives/sourcedata/freesurfer \
			  -w fmriprep_work_dir3

Version:

22.0.1

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity

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

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

Node: fmriprep_22_0_wf.single_subject_AUDXX1_wf.anat_preproc_wf.surface_recon_wf.autorecon1
Working directory: /home/ryann.tansey/fmriprep_work_dir3/fmriprep_22_0_wf/single_subject_AUDXX1_wf/anat_preproc_wf/surface_recon_wf/autorecon1

Node inputs:

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

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 524, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 642, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 750, in _run_command
    raise NodeExecutionError(
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node autorecon1.

RuntimeError: subprocess exited with code 1.

Screenshots / relevant information:


Hi @rytan,

For future posts like this, please use the Software Support category, which prompts you for important information we can use to help debug your issue. You can see I have relabeled and reorganized your post this time. You can edit your post to add any additional missing info.

Some other things (not all directly related to the issue):

You should always run singularity with the -e flag to make sure no environment variables (such as those used for FSL and FreeSurfer) are carried into the container.

We recommend upgrading just in case the bug fix was already implemented. You can try to install other containers with singularity build fmriprep_23.2.1.img docker://nipreps/fmriprep:23.2.1 (that’s the most recent version at this time).

  1. Is that the full error log, nothing else?

  2. How much memory/CPUs are you devoting to the job?

  3. Is this error subject specific or happening for each subject?

  4. What version was used for originally generating the FreeSurfer outputs?

  5. Does the error persist when using a fresh working directory and not reusing freesurfer data?

Best,
Steven

Hi Steven,

Thanks for the prompt reply! And sorry about the post tag/formatting, I was unsure where to file it when I was making the initial post.

  1. Okay, I will add that in next time I run.
  2. Unfortunately I do not have control over which containers get built on the HPC. I can potentially ask the IT department that oversees the HPC but I didn’t want to ask them to install the new version since I am not sure I will be using fMRIprep for my preprocessing yet as I believe they have limited room for what gets installed on there.
  3. That is the crash log I got from bids-root/derivatives3/sub-AUDXX1/log.
  4. I requested 50GB of RAM for the job on a single CPU.
  5. I only have one subject, with one session (1 anat run, 2 func runs).
  6. It’s the same version for both – fMRIprep v22.0.1. The Freesurfer version used is v6.0.
  7. I was using a fresh working directory when I got the error. This is actually the third time I ran fMRIprep – the first two times I ran the exact same code, but on the 2nd time output it into new derivatives folders and used a new working directory, and both times it ran recon-all. The first two times I ran it, it worked (and the 2nd time I had generated new Freesurfer data, not re-used it from the 1st time) – but the confounds I got out were different from one another so I was trying to see if that was because Freesurfer performed slightly differently or because of something else. That led me to now, trying to run it a 3rd time, reusing the Freesurfer data from the 1st time, in order to determine whether the confounds were different because of the different Freesurfer runs or not.

Thanks!

Ryann

Hi @rytan,

As detailed in the fmriprep changelog, versions past 22.0.1 include changes in error reporting and how freesurfer data are used, so I am personally hesitant to debug this much further unless it persists in a more recent version. Maybe someone else has different thoughts though.

Best,
Steven