I got the script created by Ged Ridgway as follows:
I do not know how to use it. Would you mind to give me a detailed example
using get_totals.m. So far I have the files including the volume and mask in
image format and threshold value. Thanks in advance.