If you want to average a bunch of one-brick datasets, you can use 3dMean, OR you can use 3dTstat in the following tricky way:
3dTstat -mean "fred+orig ethel+orig lucy+orig ricky+orig"
A little-advertised feature of AFNI dataset names is that a dataset name with a space in it means "do an internal 3dTcat on these collections of datasets" -- so the result of the above command is a voxel-wise average of these 4 one-brick datasets. Of course, you could use Daniel's new -nzmean instead of -mean, to get the results you desire.
This auto-catenation feature should work in just about every program.
Note 1:
If the dataset name contains a "[count ...]" construct for complex sub-brick selection, then the "space = catenate" rule doesn't apply. There is no way to auto-catenate datasets with such complex sub-brick selections. Ordinary sub-brick selection works though, as in
3dTstat -nzmean 'a+orig[3..9] b+orig[7..21]'
which would average in "time" the nonzero values amongst the 22 input sub-bricks presented to the program.
Note 2:
The shell does not directly expand wildcards inside quotes, so if you want to wildcard the filenames, you have to be tricky. For example (in tcsh):
set fredlist = ( `ls fred*+orig.HEAD` )
3dTstat -mean "$fredlist"
should work.
Note 3:
Fully understanding this post is another step on the road to qualifying for Jedi AFNI Master status. Or on the road to complete psychosis, whichever comes first.