You should be able to get this done with either 3dcalc or 3dTsmooth.
# this command uses relative indexing for the 'b' dataset.
# The "a-l" uses the "minus ell" to refer to the previous time index
# for the following time index instead, use "a+l" ("a plus ell")
3dcalc -a epi_r1+orig -b a-l -expr 'a+b' -prefix rm_3dcalc_sum2.nii.gz -overwrite
# make a single column of the temporal kernel
# (must have an odd number, so put 0 on the 3rd line for the following time index coefficient)
cat > sum2.1D
1
1
0
^c
3dTsmooth -custom sum2.1D -prefix rm_tsmooth_sum2.nii.gz epi_r1+orig.
Edited 1 time(s). Last edit at 02/07/2022 02:00PM by Daniel Glen.