[ENH]: Add support for masks (GM/WM/etc) #79

Merged
fraimondo merged 8 commits from enh/masks into main 2022-11-23 16:07:50 +00:00
fraimondo commented 2022-11-23 09:52:03 +00:00 (Migrated from github.com)

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

Which feature do you want to include?

In the same way we support atlases and coordinates, we should be able to support masks to be used, for example, in the spheres masker.

How do you imagine this integrated in junifer?

Copy/paste the atlases and modify for masks (give or take the family and atlas-specific parameters)

Do you have a sample code that implements this outside of junifer?

No response

Anything else to say?

a "good" general purpose GM mask :)
https://zenodo.org/record/6463123#.YyHOOrRBzEY

### Are you requiring a new dataset or marker? - [X] I understand this is not a marker or dataset request ### Which feature do you want to include? In the same way we support atlases and coordinates, we should be able to support masks to be used, for example, in the spheres masker. ### How do you imagine this integrated in junifer? Copy/paste the atlases and modify for masks (give or take the family and atlas-specific parameters) ### Do you have a sample code that implements this outside of junifer? _No response_ ### Anything else to say? a "good" general purpose GM mask :) https://zenodo.org/record/6463123#.YyHOOrRBzEY
codecov[bot] commented 2022-11-23 09:54:01 +00:00 (Migrated from github.com)

Codecov Report

Merging #79 (46a7761) into main (cc861a1) will increase coverage by 0.02%.
The diff coverage is 95.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   95.09%   95.11%   +0.02%     
==========================================
  Files          57       59       +2     
  Lines        2264     2335      +71     
  Branches      426      440      +14     
==========================================
+ Hits         2153     2221      +68     
- Misses         71       73       +2     
- Partials       40       41       +1     
Flag Coverage Δ
docs 100.00% <ø> (ø)
junifer 95.10% <95.69%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
junifer/data/masks.py 91.83% <91.83%> (ø)
junifer/data/__init__.py 100.00% <100.00%> (ø)
junifer/data/parcellations.py 97.77% <100.00%> (+0.42%) ⬆️
junifer/data/utils.py 100.00% <100.00%> (ø)
...rkers/crossparcellation_functional_connectivity.py 100.00% <100.00%> (ø)
junifer/markers/ets_rss.py 93.33% <100.00%> (+0.47%) ⬆️
junifer/markers/functional_connectivity_parcels.py 100.00% <100.00%> (ø)
junifer/markers/functional_connectivity_spheres.py 100.00% <100.00%> (ø)
junifer/markers/parcel_aggregation.py 95.38% <100.00%> (+0.46%) ⬆️
junifer/markers/sphere_aggregation.py 97.91% <100.00%> (+0.24%) ⬆️
# [Codecov](https://codecov.io/gh/juaml/junifer/pull/79?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report > Merging [#79](https://codecov.io/gh/juaml/junifer/pull/79?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (46a7761) into [main](https://codecov.io/gh/juaml/junifer/commit/cc861a1a226a61d8be0fa83e517a48c1634d6cb6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (cc861a1) will **increase** coverage by `0.02%`. > The diff coverage is `95.69%`. [![Impacted file tree graph](https://codecov.io/gh/juaml/junifer/pull/79/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://codecov.io/gh/juaml/junifer/pull/79?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #79 +/- ## ========================================== + Coverage 95.09% 95.11% +0.02% ========================================== Files 57 59 +2 Lines 2264 2335 +71 Branches 426 440 +14 ========================================== + Hits 2153 2221 +68 - Misses 71 73 +2 - Partials 40 41 +1 ``` | Flag | Coverage Δ | | |---|---|---| | docs | `100.00% <ø> (ø)` | | | junifer | `95.10% <95.69%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/juaml/junifer/pull/79?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [junifer/data/masks.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL21hc2tzLnB5) | `91.83% <91.83%> (ø)` | | | [junifer/data/\_\_init\_\_.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [junifer/data/parcellations.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL3BhcmNlbGxhdGlvbnMucHk=) | `97.77% <100.00%> (+0.42%)` | :arrow_up: | | [junifer/data/utils.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL3V0aWxzLnB5) | `100.00% <100.00%> (ø)` | | | [...rkers/crossparcellation\_functional\_connectivity.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Nyb3NzcGFyY2VsbGF0aW9uX2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5LnB5) | `100.00% <100.00%> (ø)` | | | [junifer/markers/ets\_rss.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2V0c19yc3MucHk=) | `93.33% <100.00%> (+0.47%)` | :arrow_up: | | [junifer/markers/functional\_connectivity\_parcels.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X3BhcmNlbHMucHk=) | `100.00% <100.00%> (ø)` | | | [junifer/markers/functional\_connectivity\_spheres.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X3NwaGVyZXMucHk=) | `100.00% <100.00%> (ø)` | | | [junifer/markers/parcel\_aggregation.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL3BhcmNlbF9hZ2dyZWdhdGlvbi5weQ==) | `95.38% <100.00%> (+0.46%)` | :arrow_up: | | [junifer/markers/sphere\_aggregation.py](https://codecov.io/gh/juaml/junifer/pull/79/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL3NwaGVyZV9hZ2dyZWdhdGlvbi5weQ==) | `97.91% <100.00%> (+0.24%)` | :arrow_up: |
github-actions[bot] commented 2022-11-23 10:02:19 +00:00 (Migrated from github.com)
PR Preview Action v1.2.0
Preview removed because the pull request was closed.
2022-11-23 16:12 UTC
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.2.0 :---: Preview removed because the pull request was closed. 2022-11-23 16:12 UTC <!-- Sticky Pull Request Commentpr-preview -->
synchon (Migrated from github.com) requested changes 2022-11-23 10:59:19 +00:00
@ -0,0 +1,186 @@
"""Provide functions for masks."""
synchon (Migrated from github.com) commented 2022-11-23 10:44:50 +00:00

Dict[str, Dict[str, str]]?

`Dict[str, Dict[str, str]]`?
@ -0,0 +1,43 @@
"""Provide tests for data utils."""
synchon (Migrated from github.com) commented 2022-11-23 10:48:35 +00:00

For consistency: the docstring is missing the Parameters section.

For consistency: the docstring is missing the Parameters section.
@ -0,0 +1,42 @@
"""Provide utilities for data module."""
synchon (Migrated from github.com) commented 2022-11-23 10:52:49 +00:00

float or None?

float or None?
synchon (Migrated from github.com) commented 2022-11-23 10:53:26 +00:00

list of float or int, or np.ndarray?

list of float or int, or np.ndarray?
synchon (Migrated from github.com) commented 2022-11-23 10:53:36 +00:00

float or int

float or int
@ -32,6 +32,10 @@ class CrossParcellationFC(BaseMarker):
correlation_method : str, optional
synchon (Migrated from github.com) commented 2022-11-23 10:57:06 +00:00

(default None).

`(default None).`
@ -29,9 +29,16 @@ class RSSETSMarker(BaseMarker):
parcellation : str
synchon (Migrated from github.com) commented 2022-11-23 10:57:29 +00:00

(default None).

`(default None).`
@ -40,6 +40,10 @@ class FunctionalConnectivityParcels(BaseMarker):
cor_method_params : dict, optional
synchon (Migrated from github.com) commented 2022-11-23 10:57:40 +00:00

(default None).

`(default None).`
@ -43,6 +43,10 @@ class FunctionalConnectivitySpheres(BaseMarker):
cor_method_params : dict, optional
synchon (Migrated from github.com) commented 2022-11-23 10:58:03 +00:00

(default None).

`(default None).`
@ -35,6 +35,10 @@ class ParcelAggregation(BaseMarker):
method_params : dict, optional
synchon (Migrated from github.com) commented 2022-11-23 10:58:12 +00:00

(default None).

`(default None).`
@ -37,6 +37,10 @@ class SphereAggregation(BaseMarker):
(default "mean").
synchon (Migrated from github.com) commented 2022-11-23 10:58:18 +00:00

(default None).

`(default None).`
fraimondo (Migrated from github.com) reviewed 2022-11-23 14:35:17 +00:00
@ -0,0 +1,186 @@
"""Provide functions for masks."""
fraimondo (Migrated from github.com) commented 2022-11-23 14:35:16 +00:00

not entirely. Inner values could be anything

not entirely. Inner values could be anything
synchon (Migrated from github.com) reviewed 2022-11-23 15:04:58 +00:00
@ -0,0 +1,186 @@
"""Provide functions for masks."""
synchon (Migrated from github.com) commented 2022-11-23 15:04:58 +00:00

But shouldn't be the inner dict keys be string?

But shouldn't be the inner dict keys be string?
synchon (Migrated from github.com) reviewed 2022-11-23 15:05:57 +00:00
@ -0,0 +1,186 @@
"""Provide functions for masks."""
synchon (Migrated from github.com) commented 2022-11-23 15:05:57 +00:00

Okay now, saw the change.

Okay now, saw the change.
synchon (Migrated from github.com) requested changes 2022-11-23 15:36:33 +00:00
@ -0,0 +23,4 @@
(None, [1.0, 2.0, 3.0], 1.0),
],
)
def test_closest_resolution(
synchon (Migrated from github.com) commented 2022-11-23 15:07:07 +00:00

list of float

`list of float`
synchon (Migrated from github.com) approved these changes 2022-11-23 15:44:07 +00:00
synchon (Migrated from github.com) left a comment

🚀

🚀
synchon commented 2022-11-23 15:44:38 +00:00 (Migrated from github.com)

Will wait for the CI to complete before merging.

Will wait for the CI to complete before merging.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!79
No description provided.