Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions spm_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ def get_spm_globals(fname):
SPM global metric for each 3D volume in the 4D image.
"""
# +++your code here+++
img = nib.load(fname)
data = img.get_fdata()
spm_vals = []
for i in range(data.shape[-1]):
vol = data[..., i]
spm_vals.append(spm_global(vol))
return spm_vals
# return


Expand Down