1) Do you have separate ANALYZE filepairs for each time point? Or one big 4D ANALYZE filepair?
2) If you have separate time points in files a037.hdr and a039.hdr (say), you could average them with 3dcalc, back into ANALYZE format, using commands like so
3dcalc -a a037.hdr -b a039.hdr -expr '(a+b)/2' -prefix ttt -nscale
3dAFNItoANALYZE -4D a038 ttt+orig
rm -f ttt+orig.*
3) If you have an AFNI 3D+time dataset, and wish to average time points 37 and 39 to replace time point 38 (say), you could do this with a sequence of commands like so
3dcalc -a 'dset+orig[37]' -b 'dset+orig[39]' -expr '(a+b)/2' -prefix t38 -nscale
3dTcat -prefix newdset 'dset+orig[0..37]' t38+orig 'dset+orig[39..$]'
rm -f t38+orig.*
Mutatis mutandum for your case, or for multiple time points that need to be replaced.
4) Both sets of commands above assume you are dealing with unscaled shorts in the input files -- the use of
-nscale is to preserve the unscaled-ness.
5) Another option is to excise these data points from the analysis using the
-censor option to 3dDeconvolve.
bob cox