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