-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ngio projection #866
base: main
Are you sure you want to change the base?
Ngio projection #866
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
logger.info(f"{init_args.origin_url=}") | ||
logger.info(f"{zarr_url=}") | ||
logger.info(f"{method=}") | ||
ngio_logger.info(f"{init_args.origin_url=}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to generally transition to using ngio logger in any task that uses ngio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to generally transition to using ngio logger in any task that uses ngio?
In my opinion we should not do this, and we should rather keep two different loggers - ref #867
@@ -189,5 +142,5 @@ def projection( | |||
|
|||
run_fractal_task( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To discuss with @tcompa: When does run_fractal_task
use the logger name? Is the ngio_logger also a reasonable choice here?
) | ||
|
||
roi_list = [] | ||
for roi in table.rois: | ||
roi.z_length = roi.z + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to set roi.z = 0, to avoid getting IndexErrors if roi.z was not 0 before. It should be 0 before in all our cases though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up: why is roi.z
even needed here? That is, why not setting roi.z_length = 1
?
Naively, I expect roi.z
to be some kind of coordinate, which should not matter when assigning a value to a length.
This is great @lorenzocerrone ! A few brief questions: Have you tried running this projection task on a zyx dataset (no channel or time dimension)? Also, would we expect this task to already work with time-data, e.g. an tczyx dataset? How much we should test in tasks-core? Can we add an option to copy over additional tables (e.g. user can deactivate that, but we copy non-roi tables by default). We'd keep them & ignore edge-cases (like missing label images) for now. TODO Joel: provide example dataset of condition tables for this. TODO for myself:
|
@@ -15,7 +15,7 @@ jobs: | |||
|
|||
strategy: | |||
matrix: | |||
python-version: ["3.9", "3.10", "3.11", "3.12"] | |||
python-version: ["3.10", "3.11", "3.12"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear to me: are we planning to keep support for python3.9 in fractal-tasks-core? If so, is there a specific reason for removing from the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we're planning to drop support for Python 3.9 in fractal-tasks-core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also drop it in pyproject.toml
if TYPE_CHECKING: | ||
from ngio.core import Image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused by this approach. Any clarification is welcome.
For instance:
Why do we useNow I got it, I was mixing upImage
, if this function always receivesNgffImage
objects?original_ngff_image
andoriginal_image
- Independently on point 1, does importing
Image
have any side-effect? If not, is there a special reason for hiding it behindTYPE_CHECKING
or is it "only" as a best practice? (e.g. because the import is slow, or if there are circular imports)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD: Coming in a separate PR if we want this style across tasks core
# Ends | ||
|
||
# Copy over the tables | ||
for roi_table in original_ngff_image.tables.list(table_type="roi_table"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor readability detail:
table = something(roi_table)
was very confusing at a first read, before checking what original_ngff_image.tables.list(
actually does. I'd suggest renaming roi_table
into e.g. roi_table_name
or table_name
.
new_image.consolidate() | ||
# Ends | ||
|
||
# Copy over the tables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naive question by someone who is not involved in ngio development/integration: where does this feature fit best?
Would it make sense to have something like
ngio.copy_tables(original_ngff_image, new_ngff_image, project_z=True)
or at least
ngio.copy_tables(original_ngff_image, new_ngff_image)
# and then set `z_length` manually
or would it be just additional complexity?
Thanks @lorenzocerrone! |
Checklist before merging
CHANGELOG.md