[ENH]: Support for handling multiple masks #174

Merged
fraimondo merged 13 commits from enh/multiple_masks into main 2023-02-27 10:37:36 +00:00
fraimondo commented 2023-01-26 14:26:29 +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?

Extracted from a comment on #170 by @LeSasse:

actually the nilearn function https://nilearn.github.io/dev/modules/generated/nilearn.masking.intersect_masks.html can allow intersection, union, and thresholds in between. I guess, this is more interesting when there is actually a lot of different masks, rather than in our case where there might be only few masks, but may be still interesting to use.

How do you imagine this integrated in junifer?

In a pipeline step.

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

No response

Anything else to say?

No response

### 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? Extracted from a comment on #170 by @LeSasse: > actually the nilearn function https://nilearn.github.io/dev/modules/generated/nilearn.masking.intersect_masks.html can allow intersection, union, and thresholds in between. I guess, this is more interesting when there is actually a lot of different masks, rather than in our case where there might be only few masks, but may be still interesting to use. ### How do you imagine this integrated in junifer? In a pipeline step. ### Do you have a sample code that implements this outside of junifer? _No response_ ### Anything else to say? _No response_
fraimondo commented 2023-01-26 09:53:36 +00:00 (Migrated from github.com)

Following the discussion on #175, here's the proposed API:

masks:
  - compute_brain_mask:
    - mask_type: whole-brain
    - threshold: 0.2
  - compute_epi_mask:
    - lower_cutoff: 0.3
    - upper_cutoff: 0.8
  - threshold: 1
  - GM_prob0.2

Which translates to python as:

marker = ParcelAggregation(
    parcellation="Schaefer100x7",
    method="mean",
    name="test_feature",
    on="VBM_GM",
    masks=[
        {"compute_brain_mask": {
            "mask_type":"whole-brain",
            "threshold": 0.2
        }},
        {"compute_epi_mask": {
            "lower_cutoff": 0.3, 
            "upper_cuttoff": 0.8
        }},
        {"threshold": 1},  # full intersection
        "GM_prob0.2 "
    ]
)

The simplest case (one mask) would be:

masks: GM_prob0.2
marker = ParcelAggregation(
    parcellation="Schaefer100x7",
    method="mean",
    name="test_feature",
    on="VBM_GM",
    masks="GM_prob0.2"
    ]
)
Following the discussion on #175, here's the proposed API: ```yaml masks: - compute_brain_mask: - mask_type: whole-brain - threshold: 0.2 - compute_epi_mask: - lower_cutoff: 0.3 - upper_cutoff: 0.8 - threshold: 1 - GM_prob0.2 ``` Which translates to python as: ```Python marker = ParcelAggregation( parcellation="Schaefer100x7", method="mean", name="test_feature", on="VBM_GM", masks=[ {"compute_brain_mask": { "mask_type":"whole-brain", "threshold": 0.2 }}, {"compute_epi_mask": { "lower_cutoff": 0.3, "upper_cuttoff": 0.8 }}, {"threshold": 1}, # full intersection "GM_prob0.2 " ] ) ``` The simplest case (one mask) would be: ```yaml masks: GM_prob0.2 ``` ```python marker = ParcelAggregation( parcellation="Schaefer100x7", method="mean", name="test_feature", on="VBM_GM", masks="GM_prob0.2" ] ) ```
LeSasse commented 2023-01-26 11:07:14 +00:00 (Migrated from github.com)

Looks good to me! Just to double check that i get it correctly, something like a list of simple masks would also work, right so as a yaml it would be sth like:

masks:
    - GM_prob0.2
    - datagrabber
    - threshold: 0

The other question I have: Is it possible with this to specify both a "global mask" that will be used by markers for which no further mask is specified as default, and also "local masks" that are specified for a specific marker that overwrite this default? For the record, I don't think this is something overly necessary (at least for my use cases). I also see a good argument that all masks should be defined marker specific and there should be no "default masks", even if it is more verbose because it means declaring the mask for each marker.

I quite like this interface, and I think with that it will be possible to cover pretty much all masking needs.

Looks good to me! Just to double check that i get it correctly, something like a list of simple masks would also work, right so as a yaml it would be sth like: ``` masks: - GM_prob0.2 - datagrabber - threshold: 0 ``` The other question I have: Is it possible with this to specify both a "global mask" that will be used by markers for which no further mask is specified as default, and also "local masks" that are specified for a specific marker that overwrite this default? For the record, I don't think this is something overly necessary (at least for my use cases). I also see a good argument that all masks should be defined marker specific and there should be no "default masks", even if it is more verbose because it means declaring the mask for each marker. I quite like this interface, and I think with that it will be possible to cover pretty much all masking needs.
fraimondo commented 2023-01-26 11:12:19 +00:00 (Migrated from github.com)

Question 1) Yes, something like this. Changing the datagrabber for inherit.

masks:
    - GM_prob0.2
    - inherit
    - threshold: 0

Question 2) It is called inherit because mask could also be computed in preprocessing step and then "inherited" by all the markers. This would be the "global" mask. It will allow for complex stuff like using BOLD + T1 + whatever to compute a mask and then use later down the pipeline.

Question 1) Yes, something like this. Changing the `datagrabber` for `inherit`. ```yaml masks: - GM_prob0.2 - inherit - threshold: 0 ``` Question 2) It is called inherit because mask could also be computed in preprocessing step and then "inherited" by all the markers. This would be the "global" mask. It will allow for complex stuff like using BOLD + T1 + whatever to compute a mask and then use later down the pipeline.
fraimondo commented 2023-01-26 14:27:33 +00:00 (Migrated from github.com)

@LeSasse: I'm still working on some tests (mostly the union/intersection). But you can already try it. The fMRIConfoundRemover preprocessing will "save" the mask, so you can "inherit" in the markers.

@LeSasse: I'm still working on some tests (mostly the union/intersection). But you can already try it. The fMRIConfoundRemover preprocessing will "save" the mask, so you can "inherit" in the markers.
LeSasse commented 2023-01-26 14:30:29 +00:00 (Migrated from github.com)

@LeSasse: I'm still working on some tests (mostly the union/intersection). But you can already try it. The fMRIConfoundRemover preprocessing will "save" the mask, so you can "inherit" in the markers.

Ah cool, i will likely install from this branch tomorrow morning and try to do some processing then. Although for my and Jean's current main AOMIC pipeline i would still also like the masks from that dataset (largely also so we can compare it to the XCPENGINE output that we have), but now that all this functionality is implemented, that should be "straightforward" to add as well.

> @LeSasse: I'm still working on some tests (mostly the union/intersection). But you can already try it. The fMRIConfoundRemover preprocessing will "save" the mask, so you can "inherit" in the markers. Ah cool, i will likely install from this branch tomorrow morning and try to do some processing then. Although for my and Jean's current main `AOMIC` pipeline i would still also like the masks from that dataset (largely also so we can compare it to the XCPENGINE output that we have), but now that all this functionality is implemented, that should be "straightforward" to add as well.
codecov[bot] commented 2023-01-26 14:31:19 +00:00 (Migrated from github.com)

Codecov Report

Merging #174 (53ac2e2) into main (7ba15ab) will increase coverage by 0.01%.
The diff coverage is 96.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #174      +/-   ##
==========================================
+ Coverage   93.49%   93.50%   +0.01%     
==========================================
  Files          75       75              
  Lines        2874     2912      +38     
  Branches      519      535      +16     
==========================================
+ Hits         2687     2723      +36     
- Misses        126      127       +1     
- Partials       61       62       +1     
Flag Coverage Δ
docs 100.00% <ø> (ø)
junifer 93.50% <96.66%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...nnectivity/edge_functional_connectivity_parcels.py 100.00% <ø> (ø)
...al_connectivity/functional_connectivity_parcels.py 100.00% <ø> (ø)
junifer/preprocess/base.py 85.00% <33.33%> (-4.48%) ⬇️
.../preprocess/confounds/fmriprep_confound_remover.py 98.80% <92.30%> (+0.02%) ⬆️
junifer/data/masks.py 96.46% <100.00%> (+1.46%) ⬆️
junifer/markers/ets_rss.py 100.00% <100.00%> (ø)
junifer/markers/falff/falff_parcels.py 100.00% <100.00%> (ø)
junifer/markers/falff/falff_spheres.py 100.00% <100.00%> (ø)
...ivity/crossparcellation_functional_connectivity.py 100.00% <100.00%> (ø)
...nnectivity/edge_functional_connectivity_spheres.py 88.88% <100.00%> (ø)
... and 7 more
# [Codecov](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report > Merging [#174](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (53ac2e2) into [main](https://codecov.io/gh/juaml/junifer/commit/7ba15ab86f9ee371792b35f588525f55cbfce971?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (7ba15ab) will **increase** coverage by `0.01%`. > The diff coverage is `96.66%`. [![Impacted file tree graph](https://codecov.io/gh/juaml/junifer/pull/174/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/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #174 +/- ## ========================================== + Coverage 93.49% 93.50% +0.01% ========================================== Files 75 75 Lines 2874 2912 +38 Branches 519 535 +16 ========================================== + Hits 2687 2723 +36 - Misses 126 127 +1 - Partials 61 62 +1 ``` | Flag | Coverage Δ | | |---|---|---| | docs | `100.00% <ø> (ø)` | | | junifer | `93.50% <96.66%> (+0.01%)` | :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/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [...nnectivity/edge\_functional\_connectivity\_parcels.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2VkZ2VfZnVuY3Rpb25hbF9jb25uZWN0aXZpdHlfcGFyY2Vscy5weQ==) | `100.00% <ø> (ø)` | | | [...al\_connectivity/functional\_connectivity\_parcels.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X3BhcmNlbHMucHk=) | `100.00% <ø> (ø)` | | | [junifer/preprocess/base.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9wcmVwcm9jZXNzL2Jhc2UucHk=) | `85.00% <33.33%> (-4.48%)` | :arrow_down: | | [.../preprocess/confounds/fmriprep\_confound\_remover.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9wcmVwcm9jZXNzL2NvbmZvdW5kcy9mbXJpcHJlcF9jb25mb3VuZF9yZW1vdmVyLnB5) | `98.80% <92.30%> (+0.02%)` | :arrow_up: | | [junifer/data/masks.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL21hc2tzLnB5) | `96.46% <100.00%> (+1.46%)` | :arrow_up: | | [junifer/markers/ets\_rss.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2V0c19yc3MucHk=) | `100.00% <100.00%> (ø)` | | | [junifer/markers/falff/falff\_parcels.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2ZhbGZmL2ZhbGZmX3BhcmNlbHMucHk=) | `100.00% <100.00%> (ø)` | | | [junifer/markers/falff/falff\_spheres.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2ZhbGZmL2ZhbGZmX3NwaGVyZXMucHk=) | `100.00% <100.00%> (ø)` | | | [...ivity/crossparcellation\_functional\_connectivity.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Nyb3NzcGFyY2VsbGF0aW9uX2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5LnB5) | `100.00% <100.00%> (ø)` | | | [...nnectivity/edge\_functional\_connectivity\_spheres.py](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2VkZ2VfZnVuY3Rpb25hbF9jb25uZWN0aXZpdHlfc3BoZXJlcy5weQ==) | `88.88% <100.00%> (ø)` | | | ... and [7 more](https://codecov.io/gh/juaml/junifer/pull/174?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | |
github-actions[bot] commented 2023-01-26 14:31:24 +00:00 (Migrated from github.com)
PR Preview Action v1.3.0
Preview removed because the pull request was closed.
2023-02-27 10:42 UTC
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.3.0 :---: Preview removed because the pull request was closed. 2023-02-27 10:42 UTC <!-- Sticky Pull Request Commentpr-preview -->
LeSasse (Migrated from github.com) reviewed 2023-01-27 08:46:37 +00:00
LeSasse (Migrated from github.com) left a comment

Really very nice and this should now cover all the masking functionality that I will ever need. I have one question only now left about the convention for masks in datagrabbers. For example will we have a convention to add a pattern for an element in a datagrabber such as "BOLD_mask": "sub-{sub}_task-{task}_space-{space}_desc-brain_mask.nii.gz" that can then be used by some name like datagrabber. Or is this already covered by the "inherit" keyword?

Really very nice and this should now cover all the masking functionality that I will ever need. I have one question only now left about the convention for masks in datagrabbers. For example will we have a convention to add a pattern for an element in a datagrabber such as `"BOLD_mask": "sub-{sub}_task-{task}_space-{space}_desc-brain_mask.nii.gz"` that can then be used by some name like datagrabber. Or is this already covered by the "inherit" keyword?
@ -0,0 +1,68 @@
.. include:: ../links.inc
LeSasse (Migrated from github.com) commented 2023-01-27 08:21:46 +00:00

typo: constraint -> constrain

typo: constraint -> constrain
LeSasse (Migrated from github.com) commented 2023-01-27 08:42:06 +00:00

Overall really cool, I think it will also be good to state here that in BOLD preprocessing of large 4D NIfTI files, the masks can have a beneficial effect on memory usage (just because when i started doing BOLD processing with nilearn without a mask, I would get the occasional memory error).

Overall really cool, I think it will also be good to state here that in BOLD preprocessing of large 4D NIfTI files, the masks can have a beneficial effect on memory usage (just because when i started doing BOLD processing with nilearn without a mask, I would get the occasional memory error).
LeSasse (Migrated from github.com) commented 2023-01-27 08:33:31 +00:00

seems only fair xD

seems only fair xD
fraimondo (Migrated from github.com) reviewed 2023-01-27 08:49:27 +00:00
@ -0,0 +1,68 @@
.. include:: ../links.inc
fraimondo (Migrated from github.com) commented 2023-01-27 08:49:27 +00:00

I am no expert in fMRI analysis, that's why I don't want to add much. I think this section could be improved.

Also, if we "mask" at the preprocessing, then all the markers must set the mask to "inherit". Otherwise, non-clean voxels might be used.

I am no expert in fMRI analysis, that's why I don't want to add much. I think this section could be improved. Also, if we "mask" at the preprocessing, then all the markers _must_ set the mask to "inherit". Otherwise, non-clean voxels might be used.
fraimondo commented 2023-01-27 08:50:06 +00:00 (Migrated from github.com)

Really very nice and this should now cover all the masking functionality that I will ever need. I have one question only now left about the convention for masks in datagrabbers. For example will we have a convention to add a pattern for an element in a datagrabber such as "BOLD_mask": "sub-{sub}_task-{task}_space-{space}_desc-brain_mask.nii.gz" that can then be used by some name like datagrabber. Or is this already covered by the "inherit" keyword?

Yes, and also add in the "BOLD" dictionary, a "mask_item" key with "BOLD_mask" as value.

out["BOLD"]["mask_item"] = "BOLD_mask"
> Really very nice and this should now cover all the masking functionality that I will ever need. I have one question only now left about the convention for masks in datagrabbers. For example will we have a convention to add a pattern for an element in a datagrabber such as `"BOLD_mask": "sub-{sub}_task-{task}_space-{space}_desc-brain_mask.nii.gz"` that can then be used by some name like datagrabber. Or is this already covered by the "inherit" keyword? Yes, and also add in the "BOLD" dictionary, a "mask_item" key with "BOLD_mask" as value. ```python out["BOLD"]["mask_item"] = "BOLD_mask" ```
LeSasse commented 2023-01-27 08:54:32 +00:00 (Migrated from github.com)

Ok, I think in that case, maybe I can make an issue and PR to add this to the aomic datagrabber as it has all the nice fmriprep output, and then it serves as a future reference too.

Ok, I think in that case, maybe I can make an issue and PR to add this to the aomic datagrabber as it has all the nice fmriprep output, and then it serves as a future reference too.
LeSasse (Migrated from github.com) reviewed 2023-01-27 09:02:05 +00:00
LeSasse commented 2023-01-27 09:55:39 +00:00 (Migrated from github.com)

Yes, and also add in the "BOLD" dictionary, a "mask_item" key with "BOLD_mask" as value.

out["BOLD"]["mask_item"] = "BOLD_mask"

This has to be done in one of the datagrabber baseclasses? Specifically in this method of the pattern datagrabber i just add it if type is BOLD? https://github.com/juaml/junifer/blob/main/junifer/datagrabber/pattern.py#L162

> Yes, and also add in the "BOLD" dictionary, a "mask_item" key with "BOLD_mask" as value. > > ```python > out["BOLD"]["mask_item"] = "BOLD_mask" > ``` This has to be done in one of the datagrabber baseclasses? Specifically in this method of the pattern datagrabber i just add it if type is BOLD? https://github.com/juaml/junifer/blob/main/junifer/datagrabber/pattern.py#L162
fraimondo commented 2023-01-27 10:00:44 +00:00 (Migrated from github.com)

Yes, and also add in the "BOLD" dictionary, a "mask_item" key with "BOLD_mask" as value.

out["BOLD"]["mask_item"] = "BOLD_mask"

This has to be done in one of the datagrabber baseclasses? Specifically in this method of the pattern datagrabber i just add it if type is BOLD? https://github.com/juaml/junifer/blob/main/junifer/datagrabber/pattern.py#L162

No. It needs to be added in the concrete clases that implement datagrabbers with masks.

> > Yes, and also add in the "BOLD" dictionary, a "mask_item" key with "BOLD_mask" as value. > > ```python > > out["BOLD"]["mask_item"] = "BOLD_mask" > > ``` > > This has to be done in one of the datagrabber baseclasses? Specifically in this method of the pattern datagrabber i just add it if type is BOLD? https://github.com/juaml/junifer/blob/main/junifer/datagrabber/pattern.py#L162 No. It needs to be added in the concrete clases that implement datagrabbers with masks.
synchon (Migrated from github.com) requested changes 2023-01-30 10:41:29 +00:00
synchon (Migrated from github.com) left a comment

Please take care of the coverage as well. :D

Please take care of the coverage as well. :D
@ -19,0 +20,4 @@
.. _using_components:
Using junifer common components
synchon (Migrated from github.com) commented 2023-01-30 10:02:46 +00:00

I think this should either have its own index or be a sub-section as it comes up as a section now. Here: https://juaml.github.io/junifer/pr-preview/pr-174/using/index.html, you have the section entry and also have a separate outermost entry in ToC.

I think this should either have its own index or be a sub-section as it comes up as a section now. Here: https://juaml.github.io/junifer/pr-preview/pr-174/using/index.html, you have the section entry and also have a separate outermost entry in ToC.
@ -0,0 +1,68 @@
.. include:: ../links.inc
synchon (Migrated from github.com) commented 2023-01-30 10:04:07 +00:00

... a mask ...

... a mask ...
synchon (Migrated from github.com) commented 2023-01-30 10:05:06 +00:00

... ratio of gray matter to white matter / cerebrospinal fluid ...

... ratio of gray matter to white matter / cerebrospinal fluid ...
synchon (Migrated from github.com) commented 2023-01-30 10:06:30 +00:00

... ``masks`` ...

```... ``masks`` ...```
synchon (Migrated from github.com) commented 2023-01-30 10:07:27 +00:00

... **only** ...

```... **only** ...```
synchon (Migrated from github.com) commented 2023-01-30 10:08:45 +00:00

... specifies the ``GM_prob0.2``...

```... specifies the ``GM_prob0.2``...```
synchon (Migrated from github.com) commented 2023-01-30 10:10:02 +00:00

... ``compute_brain_mask`` ...

```... ``compute_brain_mask`` ...```
synchon (Migrated from github.com) commented 2023-01-30 10:11:12 +00:00

... allows you to ...

... allows you to ...
synchon (Migrated from github.com) commented 2023-01-30 10:12:00 +00:00

... ``GM_prob0.2`` and ``compute_brain_mask`` ...

```... ``GM_prob0.2`` and ``compute_brain_mask`` ...```
@ -36,7 +37,10 @@ if TYPE_CHECKING:
_masks_path = Path(__file__).parent / "masks"
synchon (Migrated from github.com) commented 2023-01-30 10:27:31 +00:00
  • ... Default is None ... => ... (default None).
  • Why have the extra_dict parameter if it's not used?
- ... Default is None ... => ... (default None). - Why have the `extra_dict` parameter if it's not used?
@ -150,2 +156,4 @@
masks: Union[str, Dict, List[Union[Dict, str]]],
target_data: Dict[str, Any],
extra_input: Optional[Dict[str, Any]] = None,
) -> "Nifti1Image":
synchon (Migrated from github.com) commented 2023-01-30 10:31:37 +00:00

... Default is None ... => ... (default None).

... Default is None ... => ... (default None).
LeSasse (Migrated from github.com) reviewed 2023-02-02 09:28:59 +00:00
@ -150,2 +156,4 @@
masks: Union[str, Dict, List[Union[Dict, str]]],
target_data: Dict[str, Any],
extra_input: Optional[Dict[str, Any]] = None,
) -> "Nifti1Image":
LeSasse (Migrated from github.com) commented 2023-02-02 09:28:58 +00:00

I think this should actually be called extra_input to be consistent with the extra_input parameter in other markers: https://github.com/juaml/junifer/blob/main/junifer/markers/parcel_aggregation.py#L103

I think this should actually be called `extra_input` to be consistent with the `extra_input` parameter in other markers: https://github.com/juaml/junifer/blob/main/junifer/markers/parcel_aggregation.py#L103
LeSasse (Migrated from github.com) reviewed 2023-02-02 12:44:19 +00:00
@ -184,9 +184,11 @@ class ParcelAggregation(BaseMarker):
img=parcellation_img_res,
LeSasse (Migrated from github.com) commented 2023-02-02 12:44:19 +00:00

this needs to hand over the extra_input to get_mask

this needs to hand over the `extra_input` to get_mask
fraimondo (Migrated from github.com) reviewed 2023-02-23 11:35:55 +00:00
@ -19,0 +20,4 @@
.. _using_components:
Using junifer common components
fraimondo (Migrated from github.com) commented 2023-02-23 11:35:55 +00:00

should be a subheading

should be a subheading
fraimondo (Migrated from github.com) reviewed 2023-02-23 11:40:16 +00:00
@ -36,7 +37,10 @@ if TYPE_CHECKING:
_masks_path = Path(__file__).parent / "masks"
fraimondo (Migrated from github.com) commented 2023-02-23 11:40:16 +00:00

it's used.

it's used.
fraimondo (Migrated from github.com) reviewed 2023-02-23 11:42:51 +00:00
@ -36,7 +37,10 @@ if TYPE_CHECKING:
_masks_path = Path(__file__).parent / "masks"
fraimondo (Migrated from github.com) commented 2023-02-23 11:42:50 +00:00

sorry, not used there, it was left by mistake.

sorry, not used there, it was left by mistake.
fraimondo (Migrated from github.com) reviewed 2023-02-23 11:42:57 +00:00
@ -150,2 +156,4 @@
masks: Union[str, Dict, List[Union[Dict, str]]],
target_data: Dict[str, Any],
extra_input: Optional[Dict[str, Any]] = None,
) -> "Nifti1Image":
fraimondo (Migrated from github.com) commented 2023-02-23 11:42:57 +00:00

good point

good point
fraimondo (Migrated from github.com) reviewed 2023-02-23 11:44:10 +00:00
@ -184,9 +184,11 @@ class ParcelAggregation(BaseMarker):
img=parcellation_img_res,
fraimondo (Migrated from github.com) commented 2023-02-23 11:44:10 +00:00

good catch!

good catch!
synchon (Migrated from github.com) requested changes 2023-02-24 10:03:19 +00:00
synchon (Migrated from github.com) left a comment

h5io submodule has been committed here, I believe by mistake. And, needs to go though linting.

`h5io` submodule has been committed here, I believe by mistake. And, needs to go though linting.
@ -289,1 +336,4 @@
assert_array_equal(mask.get_fdata(), ni_mask.get_fdata())
def test_get_mask_inherit() -> None:
synchon (Migrated from github.com) commented 2023-02-24 10:00:24 +00:00

Missing Parameters section in the docstring.

Missing Parameters section in the docstring.
synchon commented 2023-02-24 10:18:46 +00:00 (Migrated from github.com)

@fraimondo Please check my comment about h5io submodule and linting.

@fraimondo Please check my comment about `h5io` submodule and linting.
fraimondo commented 2023-02-24 10:39:11 +00:00 (Migrated from github.com)

@fraimondo Please check my comment about h5io submodule and linting.

done

> @fraimondo Please check my comment about `h5io` submodule and linting. done
synchon commented 2023-02-24 13:33:51 +00:00 (Migrated from github.com)

@fraimondo Please check my comment about h5io submodule and linting.

done

Missing linting.

> > @fraimondo Please check my comment about `h5io` submodule and linting. > > done Missing linting.
fraimondo commented 2023-02-25 11:31:03 +00:00 (Migrated from github.com)

@fraimondo Please check my comment about h5io submodule and linting.

done

Missing linting.

Test pass, this is the linting check. Linting is OK to merge.

> > > @fraimondo Please check my comment about `h5io` submodule and linting. > > > > > > done > > Missing linting. Test pass, this is the linting check. Linting is OK to merge.
synchon commented 2023-02-25 11:43:30 +00:00 (Migrated from github.com)

@fraimondo Please check my comment about h5io submodule and linting.

done

Missing linting.

Test pass, this is the linting check. Linting is OK to merge.

The linting check in CI doesn't consider isort and black. This causes unnecessary changes in other PRs which can be handled in the respective PRs. If you are ok, I can push the changes.

> > > > @fraimondo Please check my comment about `h5io` submodule and linting. > > > > > > > > > done > > > > > > Missing linting. > > Test pass, this is the linting check. Linting is OK to merge. The linting check in CI doesn't consider `isort` and `black`. This causes unnecessary changes in other PRs which can be handled in the respective PRs. If you are ok, I can push the changes.
fraimondo commented 2023-02-25 12:39:57 +00:00 (Migrated from github.com)

Go ahead

Go ahead
synchon (Migrated from github.com) approved these changes 2023-02-25 13:33:26 +00:00
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!174
No description provided.