Skip to content
Open
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions spm_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ 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) # Load image
data = img.get_fdata() # Get image data

spm_values = np.asarray([]) # create empty array for spm values per volume
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete this line - you aren't using it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course, thank you. I started a for loop then converted to a list comprehension and forgot to del. Fixing...


return [
spm_global(data[..., i])
for i in range(data.shape[-1])
]
return


def main():
Expand Down