Skip to content
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

enh: add to get_spm_globals() #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eilidhmacnicol
Copy link

Adding the body to the get_spm_globals() function by taking the data from an image, and calling spm_global on each volume in the 4th dimension of the image.

The list of values is then returned

data = img.get_fdata()

vals = np.array([
spm_global(data[:,:,:,vol]) for vol in range(img.shape[-1])
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice list comprehension! You might also look into np.vectorize, or even consider vectorizing the spm_global calculation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants