Summary of what happened:
Hi everyone,
I’m running into issues with preprocessing multiple sessions for a single subject.
I have multiple sessions for a single subject run. Whenever I run fmriprep, the session 1 fmriprep outputs look right. However, when I use the same script for other sessions for the same subject, I get missing fmap and anat folders under the additional sessions, and have an overarching anat directory under the subject but not specified to the sessions (see below for structure). I collect fieldmaps and T1 for each session, and have checked my anat and fmap .nii.gz and .json files - they’re named correctly and the IntendedFor correctly lists for the bold files collected during that session. Not sure what’s the issue with why I’m not seeing fmap directory under the preprocessed fmriprep output folders! Please see below for my data structure:
sub-XX
---anat
---ses-01
--------anat
--------fmap
--------func
---ses-02
--------anat
------------ sub-XX_ses-02_from-orig_to-T1w_mode-image_xfm.txt
--------func
------------ all preprocessed bold
Command used (and if a helper script was used, a link to the helper script or the command generated):
docker run --rm -it \
--platform linux/amd64 \
-v "$1:/data:ro" \
-v "$2:/out" \
-v "$3:/workdir" \
-v "$4:/opt/freesurfer/license.txt:ro" \
-e OMP_NUM_THREADS=1 \
-e KMP_AFFINITY=disabled \
nipreps/fmriprep:latest \
/data /out participant \
--fs-license-file /opt/freesurfer/license.txt \
--output-spaces MNI152NLin2009cAsym:res-2 \
--skip-bids-validation \
--participant-label $5 \
--level full \
--me-output-echos \
--stop-on-first-crash
Version:
fMRIPrep-25.0.0
Environment (Docker, Singularity / Apptainer, custom installation):
Docker. I’m running the command shared above in a python script. But, this is the only place that calls fmriprep.
Data formatted according to a validatable standard? Please provide the output of the validator:
I ran dcm2bids, so should be validated to standard.
Relevant log outputs (up to 20 lines):
There were no errors thrown. I’m pasting a bit from the log that may show fmap was ran.
250601-19:16:10,236 nipype.workflow INFO:
[Node] Setting-up "fmriprep_25_0_wf.sub_51_wf.bold_ses_02_task_intervention_run_1_echo_1_wf.bold_fit_wf.fmapref_buffer" in "/tmp/work/fmriprep_25_0_wf/sub_51_wf/bold_ses_02_task_intervention_run_1_echo_1_wf/bold_fit_wf/fmapref_buffer".
250601-19:16:10,238 nipype.workflow INFO:
[Node] Executing "fmapref_buffer" <nipype.interfaces.utility.wrappers.Function>
250601-19:16:10,239 nipype.workflow INFO:
[Node] Finished "fmapref_buffer", elapsed time 0.000362s.
250601-19:16:10,280 nipype.interface WARNING:
Changing /out/sub-51/ses-02/func/sub-51_ses-02_task-intervention_run-1_desc-hmc_boldref.nii.gz dtype from uint16 to float32
250601-19:16:10,608 nipype.workflow INFO:
[Node] Setting-up "fmriprep_25_0_wf.sub_51_wf.bold_ses_02_task_movie_run_1_echo_1_wf.bold_fit_wf.fmapref_buffer" in "/tmp/work/fmriprep_25_0_wf/sub_51_wf/bold_ses_02_task_movie_run_1_echo_1_wf/bold_fit_wf/fmapref_buffer".
250601-19:16:10,609 nipype.workflow INFO:
[Node] Executing "fmapref_buffer" <nipype.interfaces.utility.wrappers.Function>
250601-19:16:10,610 nipype.workflow INFO:
[Node] Finished "fmapref_buffer", elapsed time 0.000348s.
250601-19:16:10,863 nipype.interface WARNING:
Changing /out/sub-51/ses-02/func/sub-51_ses-02_task-movie_run-1_desc-hmc_boldref.nii.gz dtype from uint16 to float32
250601-19:16:11,233 nipype.workflow INFO:
[Node] Setting-up "fmriprep_25_0_wf.sub_51_wf.bold_ses_02_task_movie_run_2_echo_1_wf.bold_fit_wf.fmapref_buffer" in "/tmp/work/fmriprep_25_0_wf/sub_51_wf/bold_ses_02_task_movie_run_2_echo_1_wf/bold_fit_wf/fmapref_buffer".