FZJ-INM1-BDA / siibra-python

Software interfaces for interacting with brain atlases - Python client
Apache License 2.0
48 stars 10 forks source link

Increase intensity profile compounding speed #510

Closed AhmetNSimsek closed 8 months ago

AhmetNSimsek commented 10 months ago

This PR increases the speed of combining anchors of Bigbrain intensity profiles significantly since the pairwise summing of point anchors scales linearly with the number of points. Potentially, there could be 170k points if one queries for the whole big brain template. This could take up to an hour with the current methods. This PR allows the implementation of a method special to such features to quickly produce a merged anchor.

import siibra
fts = siibra.features.get(siibra.get_template('bigbrain'), siibra.features.cellular.BigBrainIntensityProfile)

Or simply

import siibra
fts = siibra.features.get(siibra.get_region('julich 2.9', 'occipital cortex'), siibra.features.cellular.BigBrainIntensityProfile)

speeds up from 136.9s to 0.03s (on an i5-1145G7)

codecov-commenter commented 10 months ago

Codecov Report

Attention: 1318 lines in your changes are missing coverage. Please review.

Comparison is base (5a0e6b3) 36.81% compared to head (4d6f42f) 50.42%. Report is 321 commits behind head on main.

Files Patch % Lines
siibra/volumes/volume.py 41.30% 135 Missing :warning:
siibra/features/feature.py 48.13% 125 Missing :warning:
siibra/explorer/url.py 0.00% 107 Missing :warning:
siibra/volumes/parcellationmap.py 20.61% 104 Missing :warning:
siibra/core/region.py 62.50% 90 Missing :warning:
...bra/features/connectivity/regional_connectivity.py 25.97% 57 Missing :warning:
siibra/retrieval/datasets.py 49.53% 54 Missing :warning:
siibra/explorer/util.py 0.00% 51 Missing :warning:
...a/features/tabular/regional_timeseries_activity.py 25.00% 48 Missing :warning:
siibra/configuration/factory.py 54.83% 42 Missing :warning:
... and 38 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #510 +/- ## =========================================== + Coverage 36.81% 50.42% +13.60% =========================================== Files 61 69 +8 Lines 5421 6517 +1096 =========================================== + Hits 1996 3286 +1290 + Misses 3425 3231 -194 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.