Skip to content

pancy's first pull request #1

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
22 changes: 22 additions & 0 deletions spm_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
%run spm_funcs.py
"""





import numpy as np

import nibabel as nib
Expand All @@ -42,8 +46,23 @@ def spm_global(vol):


def get_spm_globals(fname):

img = nib.load(fname)

data = img.get_fdata()

spm_vals = []

for k in range (data.shape[-1]):
vol = data[...,k]
spm_vals.append(spm_global(vol))
return spm_vals


""" Calculate SPM global metrics for volumes in image filename `fname`



Parameters
----------
fname : str
Expand All @@ -54,6 +73,9 @@ def get_spm_globals(fname):
spm_vals : array
SPM global metric for each 3D volume in the 4D image.
"""



# +++your code here+++
# return

Expand Down