How to run sessionwise analysis separately in fmriprep?

I want to run sessionwise fmriprep analysis for four sessions individually. I have preprared the bids filter file for the same. Only issue is since they share the same anatomical T1w file. I am assuming there will be overwritten files due to same output structure of output of subsequent sessions. Should I create instances of anatomical file, one for each session then run the analysis or is there any other way to overcome this issue?

Hi @Satwick,

As long as you use the same working directory for each job, most anatomical processing steps should not be repeated for each session. What files are you worried about being overwritten?

Best,
Steven

If the anatomical image is shared, then there is no difference in processing by running analysis session-wise. The only reason to do it would be for the sake of parallelism or if a large workflow causes problems on your system.

If you do not want to reuse working directories, you can just reuse the anatomical derivatives:

fmriprep $INPUT $ANAT_OUTPUT participant --anat-only $OPTIONS
for FILTER in code/filter-*.json; do
    fmriprep $INPUT $OUTPUT participant \
      --derivatives $ANAT_OUTPUT --bids-filter-file $FILTER $OPTIONS
done

I am running analysis separately, because I want to isolate the T2w images from each session to be utilized for analysis in the particular session only. And for each participant I have one T1w image which is being reused for all sessions. But, I am assuming after running analysis for the first session the anatomical output will be reused for other subsequent sessions. I dont need the preprocessed output of anat files, but the confound regressors for each run will be required for ICA, so I am not sure whether this sequential analysis pipeline might corrupt the confound timeseries or not?

Each of the T2w images will be registered to the T1w image, but this is purely part of the anatomical workflow. It will have no impact on functional processing, unless you rerun FreeSurfer for each session and sample the BOLD series to the surface, and then the effect should be minimal.

So, if I just run Freesurfer for the first session and preprocess the other sessions using the same Freesurfer output the effects will be negligible?

So, if I just run Freesurfer for the first session and preprocess the other sessions using the same Freesurfer output the effects will be negligible?

Yes.