Fmriprep separate two sessions

Hi,

I have a dataset where I have pre/post data before and after an intervention. I am trying to run fmriprep but am running into an issue where it is saying


You are trying to re-run an existing subject with (possibly)
         new input data (-i). If this is truly new input data, you should delete
         the subject folder and re-run, or specify a different subject name.
         If you are just continuing an analysis of an existing subject, then 
         omit all -i flags."

I dont want to use the -longitudinal flag because I believe my T1s will be different at pre and post. So i want to fully run freesurfer and fmriprep separately for both timepoints.

the only solution i can come up with is creating two bids folders: one with pre intervention data and one with post intervention data. I would like to keep it all together. does anyone have a solution for this?

thank you!

Hi @ET_123456 and welcome to neurostars!

Your original BIDS folder should not be changed. If you want to process just one time point at a time, you can use a --bids-filter-file, have each timepoint output go to a different output folder temporarily, and then recombine them at the end when both sessions are done.

Best,
Steven

thanks Steven, would my bids filter file look something like this?

{
    "t1w": {
        "datatype": "anat",
        "session": "post",
        "acquisition": null,
        "suffix": "T1w"
    },
    "bold": {
        "datatype": "func",
        "session": "post",
        "suffix": "bold"
    }
}

Looks good to me, give it a shot!

Hi steven,

i am getting this error:

You are trying to re-run an existing subject with (possibly)
	 new input data (-i). If this is truly new input data, you should delete
	 the subject folder and re-run, or specify a different subject name.
	 If you are just continuing an analysis of an existing subject, then 
	 omit all -i flags.

which is the same error i got when i wasnt using the filter file. any tips?

Make sure you are using a fresh working directory and not having fmriprep reuse any Freesurfer data.

Hi, i am starting completely from scratch in a new working dir and still getting this same error. do you have any suggestions? Thanks!!

What is your command? What version of fmriprep? Are your data BIDS valid?

This is my command:
cmd="${SINGULARITY_CMD} /data /data/${DERIVS_DIR} participant --participant-label 01 -w /work/ -vv --omp-nthreads 8 --nthreads 12 --mem_mb 30000 --output-spaces MNI152NLin2009cAsym:res-2 anat fsnative fsaverage5 --use-aroma --fs-subjects-dir /fsdir --skip_bids_validation --bids-filter-file /data/filter-file.json"

the error comes up during recon-all:
recon-all -autorecon1 -i /data/sub-01/ses-post/anat/sub-01_ses-post_run-01_T1w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -hires -openmp 8 -subjid sub-01 -sd /fsdir -expert /work/fmriprep_23_0_wf/single_subject_01_wf/anat_preproc_wf/surface_recon_wf/autorecon1/expert.opts

my data is bids valid. it works with only one session in the folder. The version is 23.0.2

Are you sure you are making previous Freesurfer outputs unavailable to fmriprep? e.g., deleting previous runs, or using a different fs-subjects-dir? What is the output of the BIDS validator?