You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the napari-ome-zarr-navigator refactor to ngio (see fractal-napari-plugins-collection/napari-ome-zarr-navigator#31), I've looked for a way to do the following:
Given the pixel size of my intensity image, load the label image that is closest to it in resolution. If "closest" means 4x downsampled, that's totally fine.
File ~/mambaforge/envs/navigator_ngio/lib/python3.10/site-packages/ngio/ngff_meta/fractal_image_meta.py:997, in BaseMeta._get_dataset_by_pixel_size(self=<ngio.ngff_meta.fractal_image_meta.LabelMeta object>, pixel_size=PixelSize(x=0.1625, y=0.1625, z=1.0, unit=<SpaceUnits.micrometer: 'micrometer'>, virtual=False), strict=True, tol=1e-06)
996 if strict and min_dist > tol:
--> 997 raise ValueError("No dataset with a pixel size close enough.")
999 return closest_dataset
ValueError: No dataset with a pixel size close enough.
It looks like there is a strict mode at play here. Would it work with strict=False? If so, can we expose that for get_label?
Setting strict to false would fix this issue, and the logic is fully implemented. But this has not yet been exposed in the API.
Before exposing it, we need to decide if we want to also expose the dynamic scaling of the images when loading the array.
If the answer is no, we can expose the strict: bool = True.
If the answer is yes, it would be better to have something like mode: Literal["strict", "closest", "dynamic"] = "strict"
During the napari-ome-zarr-navigator refactor to ngio (see fractal-napari-plugins-collection/napari-ome-zarr-navigator#31), I've looked for a way to do the following:
Given the pixel size of my intensity image, load the label image that is closest to it in resolution. If "closest" means 4x downsampled, that's totally fine.
I tried this:
but get:
It looks like there is a strict mode at play here. Would it work with strict=False? If so, can we expose that for
get_label
?I had a way to do that with my old ome-zarr-image model class, see https://github.com/fractal-napari-plugins-collection/napari-ome-zarr-navigator/blob/0356e8854075555267dfc86e037aee739a691ffe/src/napari_ome_zarr_navigator/ome_zarr_image.py#L240
The text was updated successfully, but these errors were encountered: