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

introduce map.get_volume() which returns a FilteredVolume #624

Merged
merged 8 commits into from
Dec 12, 2024

Conversation

AhmetNSimsek
Copy link
Collaborator

@AhmetNSimsek AhmetNSimsek commented Nov 26, 2024

Based on #554 (comment)

  • Remove region_or_index in map.fetch(). New use:
map.fetch('region name') or map.fetch(region='region name')
map.fetch(index=<MapIndex>)
  • fixes region.get_regional_map only returns the mask of the maps #602. region.get_regional_map only gets a volume that is mapped in a parcellation map. region.get_regional_mask gets a volume to use as a mask, and also can combine several child masks to create a mask for parent regions. threshold only applies to get_regional_mask and for statistical maps.
  • Introduce map.get_volume which returns a FilteredVolume. FilteredVolume can have label, fragment, and threshold specifications to allow for lazy fetching of these specifications and these only. get_regional_mask always return a FilteredVolume. get_regional_map can return a Volume if the map is defined as an individual volume in the configuration; but they do not have more information like a labelled map volume of julich brain 2.9 on mni152 space.
  • remove via_space kwarg from region.get_regional_map. This was performing a linear transformation and it is not explicit. Deprecated for clarity as users can resample the maps themselves with nilearn if they'd like.

@AhmetNSimsek AhmetNSimsek force-pushed the maint_regional_volume branch 3 times, most recently from 0046bd2 to 9e38603 Compare November 27, 2024 13:18
@AhmetNSimsek AhmetNSimsek changed the title introduce map.get_volume() which returns a RefinedVolume introduce map.get_volume() which returns a FilteredVolume Dec 4, 2024
@AhmetNSimsek AhmetNSimsek force-pushed the maint_regional_volume branch 2 times, most recently from 0651917 to 7039290 Compare December 6, 2024 08:22
@AhmetNSimsek AhmetNSimsek mentioned this pull request Dec 6, 2024
@AhmetNSimsek
Copy link
Collaborator Author

Dev Meeting 2024-12-06: The PR is a go. Just need to update the tests.

…lume`s

`FilteredVolume` is a volume which can only fetch specific a label and/or a fragment specifications. This enables user to get a volume of a regional mask from a labelled volume without fetching the data to obey lazy fetching design.
…fetched correctly from FilteredVolumes. Bug fixes.
@AhmetNSimsek AhmetNSimsek marked this pull request as ready for review December 12, 2024 12:55
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 42.24138% with 67 lines in your changes missing coverage. Please review.

Project coverage is 45.60%. Comparing base (e45a688) to head (667ac1d).
Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
siibra/volumes/volume.py 44.44% 25 Missing ⚠️
siibra/core/region.py 47.22% 19 Missing ⚠️
siibra/volumes/parcellationmap.py 46.66% 8 Missing ⚠️
siibra/volumes/providers/neuroglancer.py 20.00% 8 Missing ⚠️
siibra/locations/boundingbox.py 28.57% 5 Missing ⚠️
siibra/volumes/providers/nifti.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #624      +/-   ##
==========================================
- Coverage   46.14%   45.60%   -0.54%     
==========================================
  Files          75       75              
  Lines        7171     7194      +23     
==========================================
- Hits         3309     3281      -28     
- Misses       3862     3913      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AhmetNSimsek AhmetNSimsek merged commit 14aed67 into main Dec 12, 2024
25 of 41 checks passed
@AhmetNSimsek AhmetNSimsek deleted the maint_regional_volume branch December 12, 2024 17:59
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.

region.get_regional_map only returns the mask of the maps
1 participant