Skip to content

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