diff --git a/spm_funcs.py b/spm_funcs.py index 450c1ab..352307e 100644 --- a/spm_funcs.py +++ b/spm_funcs.py @@ -54,8 +54,13 @@ def get_spm_globals(fname): spm_vals : array SPM global metric for each 3D volume in the 4D image. """ - # +++your code here+++ - # return + img = nib.load(fname) + data = img.get_fdata() + spm_vals = [] + for t in range(data.shape[-1]): + vol = data[..., t] + spm_vals.append(spm_global(vol)) + return np.array(spm_vals) # Return the result. def main():