I am using the following commands to generate the mean timeseries for each slice.
3dAutomask -prefix ${SINGLE_SUB}.automask -clfrac .25 -eclip -q ${SINGLE_SUB}+orig
3dcalc -a ${SINGLE_SUB}.automask+orig -b K:slicescaling.1D -expr 'a*b' -prefix ${SINGLE_SUB}.slice_mask -datum short -nscale
3dROIstats -mask ${SINGLE_SUB}.slice_mask+orig ${SINGLE_SUB}+orig > ${SINGLE_SUB}.slice.motion.avg.1D
I now would like to subtract the overall slice mean at each timepoint from all of the voxels within that slice at the corresponding timepoint.
Can I use the K:slicescaling.1D as an index within the -expr to point to the column in the slice.motion.avg.1D file that contains each slice's mean timeseries and the correct slice in the +orig file? For example:
3dcalc -a ${SINGLE_SUB}+orig -b K:slicescaling.1D -c ${SINGLE_SUB}.slice.motion.avg.1D -expr 'a(b)-c(b+2)' -prefix ${SINGLE_SUB}.minusmu_slicebyTR -datum short -nscale
c(b+2) is used because in 3dROIstats the first two clumns that are output are just the filename and the timeseries index and not the data.
Is there an easier way to do this with? Also is this the correct -expr for subtracting the slice mean at each timepoint from all the voxels in the slice at that timepoint?
Thanks.
Vincent Costa