-
Notifications
You must be signed in to change notification settings - Fork 53
Fixes to the SPM function script #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,9 +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 | ||
|
||
#- Load the image given by "fname". | ||
img = nib.load(fname) | ||
#- Get the data | ||
data = img.get_fdata() | ||
#- Calculate the SPM global value for each volume. | ||
spm_vals = [] | ||
for i in range(data.shape[-1]): | ||
volume = data[:, :, :, i] | ||
spm_vals.append(spm_global(volume)) | ||
return spm_vals # Return the result. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the type of If you read the docstring (line 54 above) it says average_spm = get_spm_globals(nifti_file).mean() |
||
|
||
def main(): | ||
# This function run when file executed as a script | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using ellipsis here: