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

Definition of get_spm_globals() inside spm_funcs.py for calculating the spm_global of each volume of a 4D image #19

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

Conversation

jagruti8
Copy link

@jagruti8 jagruti8 commented Aug 28, 2022

Defined the get_spm_globals() inside the spm_funcs.py file. This function will take a 4D image as input and will calculate the spm global metric for each 3D volume in the 4D image and return these values as a 1D array.

Copy link

@oesteban oesteban left a comment

Choose a reason for hiding this comment

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

Outstanding!

  • More details on the PR title and discussion, as well as commit messages are useful to other developers of the project.
  • I challenge you to reduce lines 62 through 65 to one line using python list comprehensions.

Great work!

…obals function for calculating the spm_global of each volume in the given 4D image
@jagruti8 jagruti8 changed the title Fixes to the spm_funcs.py to get the spm_global for each volume Definition of get_spm_globals() inside spm_funcs.py for calculating the spm_global of each volume of a 4D image Aug 31, 2022
for i in range(data.shape[-1]):
spm_vals.append(spm_global(data[...,i]))
return np.array(spm_vals)
spm_vals = np.array([spm_global(data[...,i]) for i in range(data.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!

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.

3 participants