[ENH]: Introduce _AntsApplyTransformsWarper #293

Merged
synchon merged 23 commits from update/add-ants-warping into main 2024-01-15 09:04:34 +00:00
synchon commented 2024-01-10 09:38:48 +00:00 (Migrated from github.com)
  • description of feature/fix
  • tests added/passed
  • add an entry for the latest changes

This PR introduces _AntsApplyTransformsWarper as a generic ANTs antsApplyTransforms wrapper class for internal use. It also adapts BOLDWarper, get_mask, get_parcellation and get_coordinates to dynamically choose FSL or ANTs depending on warp file extension. It also completes unit tests for _ApplyWarper and BOLDWarper.

* [x] description of feature/fix * [x] tests added/passed * [x] add an entry for the latest changes This PR introduces `_AntsApplyTransformsWarper` as a generic ANTs `antsApplyTransforms` wrapper class for internal use. It also adapts `BOLDWarper`, `get_mask`, `get_parcellation` and `get_coordinates` to dynamically choose FSL or ANTs depending on warp file extension. It also completes unit tests for `_ApplyWarper` and `BOLDWarper`.
codecov[bot] commented 2024-01-10 09:48:09 +00:00 (Migrated from github.com)

Codecov Report

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

Comparison is base (4f42f76) 89.46% compared to head (9c0b219) 88.09%.

❗ Current head 9c0b219 differs from pull request most recent head 150871a. Consider uploading reports for the commit 150871a to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #293      +/-   ##
==========================================
- Coverage   89.46%   88.09%   -1.37%     
==========================================
  Files          98       99       +1     
  Lines        4405     4512     +107     
  Branches      847      865      +18     
==========================================
+ Hits         3941     3975      +34     
- Misses        323      396      +73     
  Partials      141      141              
Flag Coverage Δ
docs 100.00% <ø> (ø)
junifer 88.09% <17.55%> (-1.37%) ⬇️

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

Files Coverage Δ
junifer/preprocess/fsl/apply_warper.py 38.46% <ø> (ø)
junifer/preprocess/bold_warper.py 54.83% <9.09%> (-17.89%) ⬇️
junifer/data/masks.py 75.49% <4.76%> (-7.47%) ⬇️
junifer/data/parcellations.py 86.27% <4.76%> (-2.32%) ⬇️
junifer/data/coordinates.py 56.09% <0.00%> (-14.68%) ⬇️
...er/preprocess/ants/ants_apply_transforms_warper.py 38.46% <38.46%> (ø)

... and 3 files with indirect coverage changes

## [Codecov](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report Attention: `108 lines` in your changes are missing coverage. Please review. > Comparison is base [(`4f42f76`)](https://app.codecov.io/gh/juaml/junifer/commit/4f42f7682c84b4009795913222e26dd24b2369ec?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) 89.46% compared to head [(`9c0b219`)](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) 88.09%. > :exclamation: Current head 9c0b219 differs from pull request most recent head 150871a. Consider uploading reports for the commit 150871a to get more accurate results <details><summary>Additional details and impacted files</summary> [![Impacted file tree graph](https://app.codecov.io/gh/juaml/junifer/pull/293/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://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #293 +/- ## ========================================== - Coverage 89.46% 88.09% -1.37% ========================================== Files 98 99 +1 Lines 4405 4512 +107 Branches 847 865 +18 ========================================== + Hits 3941 3975 +34 - Misses 323 396 +73 Partials 141 141 ``` | [Flag](https://app.codecov.io/gh/juaml/junifer/pull/293/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs](https://app.codecov.io/gh/juaml/junifer/pull/293/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `100.00% <ø> (ø)` | | | [junifer](https://app.codecov.io/gh/juaml/junifer/pull/293/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `88.09% <17.55%> (-1.37%)` | :arrow_down: | 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. | [Files](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [junifer/preprocess/fsl/apply\_warper.py](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9wcmVwcm9jZXNzL2ZzbC9hcHBseV93YXJwZXIucHk=) | `38.46% <ø> (ø)` | | | [junifer/preprocess/bold\_warper.py](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9wcmVwcm9jZXNzL2JvbGRfd2FycGVyLnB5) | `54.83% <9.09%> (-17.89%)` | :arrow_down: | | [junifer/data/masks.py](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL21hc2tzLnB5) | `75.49% <4.76%> (-7.47%)` | :arrow_down: | | [junifer/data/parcellations.py](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL3BhcmNlbGxhdGlvbnMucHk=) | `86.27% <4.76%> (-2.32%)` | :arrow_down: | | [junifer/data/coordinates.py](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL2Nvb3JkaW5hdGVzLnB5) | `56.09% <0.00%> (-14.68%)` | :arrow_down: | | [...er/preprocess/ants/ants\_apply\_transforms\_warper.py](https://app.codecov.io/gh/juaml/junifer/pull/293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9wcmVwcm9jZXNzL2FudHMvYW50c19hcHBseV90cmFuc2Zvcm1zX3dhcnBlci5weQ==) | `38.46% <38.46%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/juaml/junifer/pull/293/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) </details>
github-actions[bot] commented 2024-01-10 10:14:02 +00:00 (Migrated from github.com)
PR Preview Action v1.4.6
Preview removed because the pull request was closed.
2024-01-15 09:08 UTC
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.4.6 :---: Preview removed because the pull request was closed. 2024-01-15 09:08 UTC <!-- Sticky Pull Request Commentpr-preview -->
fraimondo (Migrated from github.com) reviewed 2024-01-15 08:13:36 +00:00
@ -40,3 +45,4 @@
"commands": ["ResampleImage", "antsApplyTransforms"],
},
]
fraimondo (Migrated from github.com) commented 2024-01-15 08:13:36 +00:00

How does this work with the dependency check?

How does this work with the dependency check?
synchon (Migrated from github.com) reviewed 2024-01-15 08:39:18 +00:00
@ -40,3 +45,4 @@
"commands": ["ResampleImage", "antsApplyTransforms"],
},
]
synchon (Migrated from github.com) commented 2024-01-15 08:39:18 +00:00

In the BOLDWarper, the check is optional, but when the actual preprocessor class i.e., ApplyWarper and AntsApplyTransformsWarper are initialised inside it, the checks are mandatory and fails if the tools are not found.

In the `BOLDWarper`, the check is optional, but when the actual preprocessor class i.e., `ApplyWarper` and `AntsApplyTransformsWarper` are initialised inside it, the checks are mandatory and fails if the tools are not found.
fraimondo (Migrated from github.com) reviewed 2024-01-15 08:44:19 +00:00
@ -40,3 +45,4 @@
"commands": ["ResampleImage", "antsApplyTransforms"],
},
]
fraimondo (Migrated from github.com) commented 2024-01-15 08:44:19 +00:00

Excellent!

Excellent!
fraimondo (Migrated from github.com) approved these changes 2024-01-15 08:44:42 +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!293
No description provided.