imagej / pyimagej

Use ImageJ from Python
https://pyimagej.readthedocs.io/
Other
474 stars 83 forks source link

Simplify linear axis assignment logic #265

Closed elevans closed 1 year ago

elevans commented 1 year ago

I split this PR from my metadata PR (https://github.com/imagej/pyimagej/pull/247). This PR aims to simply how we assign calibrated linear axes to datasets. Currently we check if net.imagej.axis.EnumeratedAxis is available and use that as our first choice. If net.imagej.axis.EnumeratedAxis is not available, then we fall back to net.imagej.axis.DefaultLinearAxis. This is fine for most things, but unfortunately this logic has some unintended consequences. @gselzer informed me that the BoneJ plugin actually checks for net.imagej.axis.DefaultLinearAxis and is unable to use the net.imagej.axis.EnumeratedAxis. The changes this PR brings are the following:

update 1

Thanks @gselzer for adding in a good way to have both EnumeratedAxis and DefaultLinearAxis as options based on coordinate array linearity.

Things for me to do:

TODO:

update 2

I've added the following changes:

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 90.62% and project coverage change: +0.42 :tada:

Comparison is base (179f482) 76.93% compared to head (de50af9) 77.36%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #265 +/- ## ========================================== + Coverage 76.93% 77.36% +0.42% ========================================== Files 16 16 Lines 1869 1869 ========================================== + Hits 1438 1446 +8 + Misses 431 423 -8 ``` | [Impacted Files](https://app.codecov.io/gh/imagej/pyimagej/pull/265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imagej) | Coverage Δ | | |---|---|---| | [src/imagej/dims.py](https://app.codecov.io/gh/imagej/pyimagej/pull/265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imagej#diff-c3JjL2ltYWdlai9kaW1zLnB5) | `65.73% <86.95%> (+2.62%)` | :arrow_up: | | [src/imagej/\_java.py](https://app.codecov.io/gh/imagej/pyimagej/pull/265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imagej#diff-c3JjL2ltYWdlai9famF2YS5weQ==) | `88.76% <100.00%> (+1.26%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.