def gcor(func, mask):
    '\n    Compute the :abbr:`GCOR (global correlation)`.\n\n    :param numpy.ndarray func: input fMRI dataset, after motion correction\n    :param numpy.ndarray mask: 3D brain mask\n    :return: the computed GCOR value\n\n    '
    tv_mask = zero_variance(func, mask)
    idx = np.where((tv_mask > 0))
    zscores = scipy.stats.mstats.zscore(func[idx[0], idx[1], idx[2], :], axis=1)
    avg_ts = zscores.mean(axis=0)
    return float((avg_ts.transpose().dot(avg_ts) / len(avg_ts)))
Compute the :abbr:`GCOR (global correlation)`.

:param numpy.ndarray func: input fMRI dataset, after motion correction
:param numpy.ndarray mask: 3D brain mask
:return: the computed GCOR value
def gcor(func, mask):
    '\n    Compute the :abbr:`GCOR (global correlation)`.\n\n    :param numpy.ndarray func: input fMRI dataset, after motion correction\n    :param numpy.ndarray mask: 3D brain mask\n    :return: the computed GCOR value\n\n    '
    tv_mask = zero_variance(func, mask)
    idx = np.where((tv_mask > 0))
    zscores = scipy.stats.mstats.zscore(func[idx[0], idx[1], idx[2], :], axis=1)
    avg_ts = zscores.mean(axis=0)
    return float((avg_ts.transpose().dot(avg_ts) / len(avg_ts)))