I would like to preprocess only sessions 03–05 using the anatomical scan from session 01. The dataset previously processed successfully for sessions 01 and 02 using the same T1w image. Here’s the command I used:
FileNotFoundError: No "t1w" images found for sub-02
My questions are:
Is it expected that --session-label 03 04 05 prevents fMRIPrep from using a T1w acquired in ses-01?
Should fMRIPrep automatically reuse a T1w from another session when processing later sessions?
Is the recommended workflow to always include ses-01 in the preprocessing command, e.g.:
--session-label 01 03 04 05
even if I only need outputs from sessions 03–05?
If I have already processed ses-01 previously, is there a way to preprocess only new sessions while reusing the existing anatomical processing results, without rerunning ses-01?
If you only have one t1w you want to apply everywhere, can you try putting the anatomical image above the session level? E.g. sub-02/anat/sub-02_T1w.nii.gz|.json.
260604-04:16:14,874 nipype.workflow ERROR:
could not run node: fmriprep_25_2_wf.sub_02_ses_03-04-05_wf.bidssrc
260604-04:16:15,108 nipype.workflow CRITICAL:
fMRIPrep failed: Traceback (most recent call last):
File "/app/.pixi/envs/fmriprep/lib/python3.12/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
result["result"] = node.run(updatehash=updatehash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.pixi/envs/fmriprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 525, in run
result = self._run_interface(execute=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.pixi/envs/fmriprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 643, in _run_interface
return self._run_command(execute)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.pixi/envs/fmriprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 769, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node bidssrc.
Traceback:
Traceback (most recent call last):
File "/app/.pixi/envs/fmriprep/lib/python3.12/site-packages/nipype/interfaces/base/core.py", line 401, in run
runtime = self._run_interface(runtime)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.pixi/envs/fmriprep/lib/python3.12/site-packages/niworkflows/interfaces/bids.py", line 297, in _run_interface
raise FileNotFoundError(msg)
FileNotFoundError: No "t1w" images found for sub-02
fMRIPrep: Please report errors to https://github.com/nipreps/fmriprep/issues
I wonder whether specifying --session-label 03 04 05 could be causing this issue.
The way you mentioned worked. I have a quick follow-up question: if I have already processed some sessions, like with –session-label anat 03 04 05, and need to run new sessions with –session-label anat 06, will this affect the preprocessed T1w image?
I would say no (but I am not a fmriprep developper). fmriprep will reuse the already run freesurfer output, and also, should be using all the anat preprocessed files already computed if you point to the same working directory (-w ) during you second execution of fmriprep.
Hi @jsein. I processed a new session using –session-label anat 06 with the same working directory. The freesurfer output was reused, but the preprocessed T1w was processed again and overwritten. I wonder if it will cause problems for the previous sessions.
Hi @Yan_Huang , my guess is that the re-preprocessed T1w should very similar to the originally preprocessed T1w, since in it using the same input image and the same freesurfer derivatives. The difference must be coming from the normalisation of the T1w image in the template space with ANTs which may be giving slightly different result on two identical execution.
Food for thoughts: I have never played with those parameters but I also guess that --skull-strip-fixed-seed and --random-seedmay be useful for better repeatability in your case.
Thanks for the advice @jsein. I checked the T1w outputs generated from two separate fMRIPrep runs using --skull-strip-fixed-seed, --random-seed, and --omp-nthreads. After comparing them in AFNI, the results appear to be virtually identical across the two runs. The same goes for the normalization results.