The following Matlab project contains the source code and Matlab examples used for determine the necessity for global signal regression.
Determine the Necessity for Global Signal Regression in Resting-State fMRI Studies
Calculate GNI from preprocessed resting state data and a whole brain mask
if GNI>3, global signal regression may not be necessary
Chen G, Chen GY, Xie C, Ward BD, Li W, Antuono P and Li SJ.