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

[REF] Refactor load_data for gifti images with more than one data array #153

Merged
merged 2 commits into from
May 22, 2024

Conversation

VinceBaz
Copy link
Member

@VinceBaz VinceBaz commented Mar 1, 2024

This PR refactors the load_data function to allow it's use for gifti images with more than one data array (e.g. for timeseries/functional data). There were a few issues with the function, which are related to how the agg_data method for GiftiImage objects (from nibabel) handles the intents of data arrays: when the intents of a data array is set to NIFTI_INTENT_TIMESERIES, the agg_data method returns a 2D ndarray, but when the intents are something else (e.g. NIFTI_INTENT_SHAPE), then the data arrays are returned as a tuple of multiple 1D array. The load_data was not working as expected in either of these cases (i.e. it couldn't load nor stack data images into numpy arrays).

This PR should fix Issue #139

This commit refactors the `load_data` function to allow the
transformation of GiftiImages with more than one data array (e.g.
timeseries data).
@VinceBaz VinceBaz merged commit af78397 into netneurolab:main May 22, 2024
8 checks passed
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.

None yet

1 participant