Mean/average withing 4D images of same condition

Happy new year to all of you guys,

I’m doing small rodent fMRI and making my own pipeline using nipype. I’m trying to understand how to average multiple (more than 7) EPI datasets (same stimulation condition) to get one 4D image that is an average of all inputs. It seems that AFNI 3dMean should do the job, but it takes only up to 2 images to average through. Other functions I faced and tryied do only 4D -> 3D average.

thanks in advance!!!

Hi @Cherkas

Happy New Year to you as well :slight_smile:

3dMean should in fact be able to handle more than two input images (see the help documentation). The problem might be in the nipype interface – does it error when passing more than two datasets ?

That being said, I’d general recommend against averaging the time courses themselves and would instead calculate summary statistics for each run. Then you can examine the distribution of summary statistics for your effect of interest.


Hi Elizabeth, thanks for sharing your opinion,

yes, the restriction is due to nipype interface (it accepts only 2 input files, I can iterate but without accumulation). I’m doing evoked studies (whisker stimulation), averaging is required to lower the uncorrelated noise at pre- and post-stimulus period, that increases tSNR as sqrt(number of trials). I’ll do search but can you please explain a bit your recommendation as well.