Running fmriprep with a single t1 and multiple sessions

Hi everyone,

I have a dataset with 11 sessions per subject and a single t1-weighted image per subject (we used a headcase to stabilize the head for all sessions). To make sure the data were BIDS-compliant, I included the same t1 for all sessions under anat/ for each subject.

I assume that this is an issue because fmriprep by default tries to average the t1s across sessions and realizes that they are identical. I get the following error:

 Sigma too small: 0 (identical images?)
[init] ========================= TP 9 to TP 1 ==============================
         Register TP 9 ( /scratch/fmriprep_wf/single_subject_860_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_corr>
          to      TP 1 ( /scratch/fmriprep_wf/single_subject_860_wf/anat_preproc_wf/anat_template_wf/n4_correct/mapflow/_n4_corr>

Standard error:
CostFunctions::centroid is NAN (empty image? n = 0 )
Return code: 1

Does anyone have suggestions for how to use a single T1-weighted image for multiple sessions?

Thanks! I appreciate your help.

Put the T1 in the first session only. I believe all subsequent sessions will register to it.

Thanks! I started running session by session and have no issue there, which seems to point to the t1 copies being an issue. I’ll give your solution a try too.

If your software is complaining that two T1w images are identical before a registration step, you can just apply some small, random, rigid-body transformation to it, and to make sure it goes ahead, perhaps add some normally distributed noise. [Please, don’t do this]

Where does the BIDS specification say this is necessary? I’d rather say you made sure it is not BIDS compliant - it would be actually a good thing to add to the validator a check that makes sure two images are not identical.

Yes, just have the T1w stored within the session it was acquired.

Please don’t call this a solution, just solve the issue by not creating it in the first place :slight_smile:

(and yet, if you find an instance where BIDS suggests anything remotely resembling what you did, please report it on the GitHub repo because that must be addressed ASAP)

Hi Oscar,

Yeah, this sounds like a really bad idea. Not planning to artificially add noise.

The idea that each session required a t1 was a misplaced assumption on my part regarding the BIDS format.

I wholeheartedly agree that running session-by-session is not a solution. I was just collecting more data about my hypothesized problem and I was under a tight time constraint.

The solution from heffjos worked – I simply included the single t1 in the anat/ folder for the acquisition session and left the anat/ folder for the other sessions empty.

Thanks for your reply.

Thanks! This worked.

Glad you figured it out!

1 Like