# Extract a timecourse from fMRI (fmri_img) using a binary mask (mask_roi)
# usually a standard space 4D fMRI dataset and some atlas-defined mask region
# (mask_roi)
# fslmeants extracts an average value for the roi at each time point
# and puts it in the txt file named after the -o flag.
fslmeants -i fmri_img -o fmri_img.txt -m mask_roi
# Note fslstats can provide the same result with the -t flag:
fslstats -t fmri_img -k mask_roi -M