ngio 0.2.0b2__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ngio-0.2.0b2 → ngio-0.2.1}/.github/workflows/build_docs.yml +2 -1
- {ngio-0.2.0b2 → ngio-0.2.1}/PKG-INFO +9 -5
- {ngio-0.2.0b2 → ngio-0.2.1}/README.md +4 -4
- {ngio-0.2.0b2 → ngio-0.2.1}/_typos.toml +2 -1
- ngio-0.2.1/docs/api/common.md +6 -0
- ngio-0.2.1/docs/api/hcs.md +6 -0
- ngio-0.2.1/docs/api/images.md +6 -0
- ngio-0.2.1/docs/api/ngio.md +6 -0
- ngio-0.2.1/docs/api/tables.md +6 -0
- ngio-0.2.1/docs/api/utils.md +6 -0
- ngio-0.2.1/docs/code_of_conduct.md +2 -0
- ngio-0.2.1/docs/contributing.md +4 -0
- ngio-0.2.1/docs/getting_started/0_quickstart.md +99 -0
- ngio-0.2.1/docs/getting_started/1_ome_zarr_containers.md +181 -0
- ngio-0.2.1/docs/getting_started/2_images.md +200 -0
- ngio-0.2.1/docs/getting_started/3_tables.md +219 -0
- ngio-0.2.1/docs/getting_started/4_masked_images.md +148 -0
- ngio-0.2.1/docs/getting_started/5_hcs.md +164 -0
- ngio-0.2.1/docs/index.md +64 -0
- ngio-0.2.1/docs/tutorials/feature_extraction.ipynb +35 -0
- ngio-0.2.1/docs/tutorials/hcs_processing.ipynb +21 -0
- ngio-0.2.1/docs/tutorials/image_processing.ipynb +21 -0
- ngio-0.2.1/docs/tutorials/image_segmentation.ipynb +176 -0
- ngio-0.2.1/index.md +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/mkdocs.yml +30 -8
- {ngio-0.2.0b2 → ngio-0.2.1}/pyproject.toml +4 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/__init__.py +11 -9
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/__init__.py +3 -3
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_array_pipe.py +6 -7
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_masking_roi.py +4 -4
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_roi.py +12 -12
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/hcs/__init__.py +2 -2
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/hcs/plate.py +86 -34
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/images/__init__.py +7 -7
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/images/abstract_image.py +50 -10
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/images/create.py +4 -3
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/images/image.py +2 -2
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/images/label.py +10 -6
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/images/masked_image.py +19 -5
- ngio-0.2.0b2/src/ngio/images/omezarr_container.py → ngio-0.2.1/src/ngio/images/ome_zarr_container.py +57 -30
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/__init__.py +3 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/__init__.py +2 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +5 -4
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +9 -19
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/v04/_v04_spec_utils.py +1 -2
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/__init__.py +2 -2
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/tables_container.py +3 -3
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/v1/__init__.py +2 -2
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/v1/_feature_table.py +20 -1
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/v1/_generic_table.py +10 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/v1/_roi_table.py +35 -13
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/common/test_roi.py +4 -4
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/hcs/test_plate.py +16 -16
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/images/test_create.py +7 -7
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/images/test_masked_images.py +9 -7
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/images/test_omezarr_container.py +51 -44
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_feature_table.py +4 -1
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_generic_table.py +1 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_masking_roi_table_v1.py +8 -6
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_roi_table_v1.py +5 -4
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/test_ome_zarr_meta/test_unit_ngio_specs.py +2 -7
- ngio-0.2.0b2/docs/api/core.md +0 -3
- ngio-0.2.0b2/docs/getting-started.md +0 -34
- ngio-0.2.0b2/docs/index.md +0 -43
- ngio-0.2.0b2/docs/notebooks/basic_usage.ipynb +0 -351
- ngio-0.2.0b2/docs/notebooks/image.ipynb +0 -359
- ngio-0.2.0b2/docs/notebooks/processing.ipynb +0 -321
- {ngio-0.2.0b2 → ngio-0.2.1}/.copier-answers.yml +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.gitattributes +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.github/ISSUE_TEMPLATE.md +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.github/TEST_FAIL_TEMPLATE.md +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.github/dependabot.yml +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.github/scripts/download_data.sh +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.github/workflows/ci.yml +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.gitignore +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/.pre-commit-config.yaml +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/LICENSE +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_axes_transforms.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_common_types.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_dimensions.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_pyramid.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_slicer.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/common/_zoom.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/_meta_handlers.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_axes.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_channels.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_dataset.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_pixel_size.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/ome_zarr_meta/v04/__init__.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/_validators.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/backends/__init__.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/backends/_abstract_backend.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/backends/_anndata_utils.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/backends/_anndata_v1.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/backends/_json_v1.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/tables/backends/_table_backends.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/utils/__init__.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/utils/_datasets.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/utils/_errors.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/utils/_fractal_fsspec_store.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/utils/_logger.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/src/ngio/utils/_zarr_utils.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/conftest.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/.zattrs +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/.zgroup +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/0/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/1/.zarray +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/meta/base_ome_zarr_image_meta.json +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/meta/base_ome_zarr_image_meta_wrong_axis_order.json +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/data/v04/meta/base_ome_zarr_label_meta.json +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/common/test_dimensions.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/common/test_pyramid.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/images/test_images.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_backends.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_table_group.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/tables/test_validators.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/test_ome_zarr_meta/test_image_handler.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/test_ome_zarr_meta/test_unit_v04_utils.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/utils/test_download_datasets.py +0 -0
- {ngio-0.2.0b2 → ngio-0.2.1}/tests/unit/utils/test_zarr_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ngio
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Next Generation file format IO
|
|
5
5
|
Project-URL: homepage, https://github.com/lorenzocerrone/ngio
|
|
6
6
|
Project-URL: repository, https://github.com/lorenzocerrone/ngio
|
|
@@ -41,6 +41,8 @@ Requires-Dist: rich; extra == 'dev'
|
|
|
41
41
|
Requires-Dist: ruff; extra == 'dev'
|
|
42
42
|
Requires-Dist: scikit-image; extra == 'dev'
|
|
43
43
|
Provides-Extra: docs
|
|
44
|
+
Requires-Dist: markdown-exec[ansi]; extra == 'docs'
|
|
45
|
+
Requires-Dist: matplotlib; extra == 'docs'
|
|
44
46
|
Requires-Dist: mike; extra == 'docs'
|
|
45
47
|
Requires-Dist: mkdocs; extra == 'docs'
|
|
46
48
|
Requires-Dist: mkdocs-autorefs; extra == 'docs'
|
|
@@ -49,7 +51,9 @@ Requires-Dist: mkdocs-git-revision-date-localized-plugin; extra == 'docs'
|
|
|
49
51
|
Requires-Dist: mkdocs-jupyter; extra == 'docs'
|
|
50
52
|
Requires-Dist: mkdocs-material; extra == 'docs'
|
|
51
53
|
Requires-Dist: mkdocstrings[python]; extra == 'docs'
|
|
54
|
+
Requires-Dist: rich; extra == 'docs'
|
|
52
55
|
Requires-Dist: scikit-image; extra == 'docs'
|
|
56
|
+
Requires-Dist: tabulate; extra == 'docs'
|
|
53
57
|
Provides-Extra: test
|
|
54
58
|
Requires-Dist: pytest; extra == 'test'
|
|
55
59
|
Requires-Dist: pytest-cov; extra == 'test'
|
|
@@ -61,7 +65,7 @@ Description-Content-Type: text/markdown
|
|
|
61
65
|
[](https://github.com/lorenzocerrone/ngio/raw/main/LICENSE)
|
|
62
66
|
[](https://pypi.org/project/ngio)
|
|
63
67
|
[](https://python.org)
|
|
64
|
-
[](https://github.com/fractal-analytics-platform/ngio/actions/workflows/ci.yml)
|
|
65
69
|
[](https://codecov.io/gh/fractal-analytics-platform/ngio)
|
|
66
70
|
|
|
67
71
|
NGIO is a Python library to streamline OME-Zarr image analysis workflows.
|
|
@@ -69,9 +73,9 @@ NGIO is a Python library to streamline OME-Zarr image analysis workflows.
|
|
|
69
73
|
**Main Goals:**
|
|
70
74
|
|
|
71
75
|
- Abstract object base API for handling OME-Zarr files
|
|
72
|
-
-
|
|
76
|
+
- Powerful iterators for processing data using common access patterns
|
|
73
77
|
- Tight integration with [Fractal's Table Fractal](https://fractal-analytics-platform.github.io/fractal-tasks-core/tables/)
|
|
74
|
-
-
|
|
78
|
+
- Validation of OME-Zarr files
|
|
75
79
|
|
|
76
80
|
To get started, check out the [Getting Started](https://fractal-analytics-platform.github.io/ngio/getting-started/) guide. Or checkout our [Documentation](https://fractal-analytics-platform.github.io/ngio/)
|
|
77
81
|
|
|
@@ -91,7 +95,7 @@ To get started, check out the [Getting Started](https://fractal-analytics-platfo
|
|
|
91
95
|
| Basic Iterators | Ongoing | End-September | Read and Write Iterators for common access patterns |
|
|
92
96
|
| Base Documentation | ✅ | End-September | API Documentation and Examples |
|
|
93
97
|
| Beta Ready Testing | ✅ | End-September | Beta Testing; Library is ready for testing, but the API is not stable |
|
|
94
|
-
| Streaming from Fractal | Ongoing | December | Ngio can stream
|
|
98
|
+
| Streaming from Fractal | Ongoing | December | Ngio can stream OME-Zarr from fractal |
|
|
95
99
|
| Mask Iterators | Ongoing | Early 2025 | Iterators over Masked Tables |
|
|
96
100
|
| Advanced Iterators | Not started | mid-2025 | Iterators for advanced access patterns |
|
|
97
101
|
| Parallel Iterators | Not started | mid-2025 | Concurrent Iterators for parallel read and write |
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/lorenzocerrone/ngio/raw/main/LICENSE)
|
|
4
4
|
[](https://pypi.org/project/ngio)
|
|
5
5
|
[](https://python.org)
|
|
6
|
-
[](https://github.com/fractal-analytics-platform/ngio/actions/workflows/ci.yml)
|
|
7
7
|
[](https://codecov.io/gh/fractal-analytics-platform/ngio)
|
|
8
8
|
|
|
9
9
|
NGIO is a Python library to streamline OME-Zarr image analysis workflows.
|
|
@@ -11,9 +11,9 @@ NGIO is a Python library to streamline OME-Zarr image analysis workflows.
|
|
|
11
11
|
**Main Goals:**
|
|
12
12
|
|
|
13
13
|
- Abstract object base API for handling OME-Zarr files
|
|
14
|
-
-
|
|
14
|
+
- Powerful iterators for processing data using common access patterns
|
|
15
15
|
- Tight integration with [Fractal's Table Fractal](https://fractal-analytics-platform.github.io/fractal-tasks-core/tables/)
|
|
16
|
-
-
|
|
16
|
+
- Validation of OME-Zarr files
|
|
17
17
|
|
|
18
18
|
To get started, check out the [Getting Started](https://fractal-analytics-platform.github.io/ngio/getting-started/) guide. Or checkout our [Documentation](https://fractal-analytics-platform.github.io/ngio/)
|
|
19
19
|
|
|
@@ -33,7 +33,7 @@ To get started, check out the [Getting Started](https://fractal-analytics-platfo
|
|
|
33
33
|
| Basic Iterators | Ongoing | End-September | Read and Write Iterators for common access patterns |
|
|
34
34
|
| Base Documentation | ✅ | End-September | API Documentation and Examples |
|
|
35
35
|
| Beta Ready Testing | ✅ | End-September | Beta Testing; Library is ready for testing, but the API is not stable |
|
|
36
|
-
| Streaming from Fractal | Ongoing | December | Ngio can stream
|
|
36
|
+
| Streaming from Fractal | Ongoing | December | Ngio can stream OME-Zarr from fractal |
|
|
37
37
|
| Mask Iterators | Ongoing | Early 2025 | Iterators over Masked Tables |
|
|
38
38
|
| Advanced Iterators | Not started | mid-2025 | Iterators for advanced access patterns |
|
|
39
39
|
| Parallel Iterators | Not started | mid-2025 | Concurrent Iterators for parallel read and write |
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
!!! warning
|
|
2
|
+
The library is still in the early stages of development, no contribution guidelines are established yet.
|
|
3
|
+
But contributions are welcome! Please open an issue or a pull request to discuss your ideas.
|
|
4
|
+
We are looking for contributors to help us improve the library and documentation.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
Ngio is a Python package that provides a simple and intuitive API for reading and writing data to and from OME-Zarr. This guide will walk you through the basics of using `ngio` to read and write data.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`ngio` can be installed from PyPI, conda-forge, or from source.
|
|
8
|
+
|
|
9
|
+
- `ngio` requires Python `>=3.11`
|
|
10
|
+
|
|
11
|
+
=== "pip"
|
|
12
|
+
|
|
13
|
+
The recommended way to install `ngio` is from PyPI using pip:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install ngio
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
=== "mamba/conda"
|
|
20
|
+
|
|
21
|
+
Alternatively, you can install `ngio` using mamba:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
mamba install -c conda-forge ngio
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
or conda:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
conda install -c conda-forge ngio
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
=== "Source"
|
|
34
|
+
|
|
35
|
+
1. Clone the repository:
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/fractal-analytics-platform/ngio.git
|
|
38
|
+
cd ngio
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. Install the package:
|
|
42
|
+
```bash
|
|
43
|
+
pip install .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Troubleshooting
|
|
47
|
+
|
|
48
|
+
Please report installation problems by opening an issue on our [GitHub repository](https://github.com/fractal-analytics-platform/ngio).
|
|
49
|
+
|
|
50
|
+
## Setup some test data
|
|
51
|
+
|
|
52
|
+
Let's start by downloading a sample OME-Zarr dataset to work with.
|
|
53
|
+
|
|
54
|
+
```python exec="true" source="material-block" session="quickstart"
|
|
55
|
+
from pathlib import Path
|
|
56
|
+
from ngio.utils import download_ome_zarr_dataset
|
|
57
|
+
|
|
58
|
+
# Download a sample dataset
|
|
59
|
+
download_dir = Path("./data")
|
|
60
|
+
download_dir = Path(".").absolute().parent.parent / "data" # markdown-exec: hide
|
|
61
|
+
hcs_path = download_ome_zarr_dataset("CardiomyocyteSmallMip", download_dir=download_dir)
|
|
62
|
+
image_path = hcs_path / "B" / "03" / "0"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Open an OME-Zarr image
|
|
66
|
+
|
|
67
|
+
Let's start by opening an OME-Zarr file and inspecting its contents.
|
|
68
|
+
|
|
69
|
+
```pycon exec="true" source="console" session="quickstart"
|
|
70
|
+
>>> from ngio import open_ome_zarr_container
|
|
71
|
+
>>> ome_zarr_container = open_ome_zarr_container(image_path)
|
|
72
|
+
>>> ome_zarr_container
|
|
73
|
+
>>> print(ome_zarr_container) # markdown-exec: hide
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### What is the OME-Zarr container?
|
|
77
|
+
|
|
78
|
+
The `OME-Zarr Container` is the core of ngio and the entry point to working with OME-Zarr images. It provides high-level access to the image metadata, images, labels, and tables.
|
|
79
|
+
|
|
80
|
+
### What is the OME-Zarr container not?
|
|
81
|
+
|
|
82
|
+
The `OME-Zarr Container` object does not allow the user to interact with the image data directly. For that, we need to use the `Image`, `Label`, and `Table` objects.
|
|
83
|
+
|
|
84
|
+
## Next steps
|
|
85
|
+
|
|
86
|
+
To learn how to work with the `OME-Zarr Container` object, but also with the image, label, and table data, check out the following guides:
|
|
87
|
+
|
|
88
|
+
- [OME-Zarr Container](1_ome_zarr_containers.md): An overview on how to use the OME-Zarr Container object and how to create new images and labels.
|
|
89
|
+
- [Images/Labels](2_images.md): To know more on how to work with image data.
|
|
90
|
+
- [Tables](3_tables.md): To know more on how to work with table data, and how you can combine tables with image data.
|
|
91
|
+
- [Masked Images/Labels](4_masked_images.md): To know more on how to work with masked image data.
|
|
92
|
+
- [HCS Plates](5_hcs.md): To know more on how to work with HCS plate data.
|
|
93
|
+
|
|
94
|
+
Also, checkout our jupyer notebook tutorials for more examples:
|
|
95
|
+
|
|
96
|
+
- [Image Processing](../tutorials/image_processing.ipynb): Learn how to perform simple image processing operations.
|
|
97
|
+
- [Image Segmentation](../tutorials/image_segmentation.ipynb): Learn how to create new labels from images.
|
|
98
|
+
- [Feature Extraction](../tutorials/feature_extraction.ipynb): Learn how to extract features from images.
|
|
99
|
+
- [HCS Processing](../tutorials/hcs_processing.ipynb): Learn how to process high-content screening data using ngio.
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# 1. OME-Zarr Container
|
|
2
|
+
|
|
3
|
+
Let's see how to open and explore an OME-Zarr image using `ngio`:
|
|
4
|
+
|
|
5
|
+
```python exec="true" source="material-block" session="get_started"
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from ngio import open_ome_zarr_container
|
|
8
|
+
from ngio.utils import download_ome_zarr_dataset
|
|
9
|
+
|
|
10
|
+
# Download a sample dataset
|
|
11
|
+
download_dir = Path("./data")
|
|
12
|
+
download_dir = Path(".").absolute().parent.parent / "data" # markdown-exec: hide
|
|
13
|
+
hcs_path = download_ome_zarr_dataset("CardiomyocyteSmallMip", download_dir=download_dir)
|
|
14
|
+
image_path = hcs_path / "B" / "03" / "0"
|
|
15
|
+
|
|
16
|
+
# Open the OME-Zarr container
|
|
17
|
+
ome_zarr_container = open_ome_zarr_container(image_path)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The `OME-Zarr Container` in is your entry point to working with OME-Zarr images. It provides high-level access to the image metadata, images, labels, and tables.
|
|
21
|
+
|
|
22
|
+
```pycon exec="true" source="console" session="get_started"
|
|
23
|
+
>>> ome_zarr_container
|
|
24
|
+
>>> print(ome_zarr_container) # markdown-exec: hide
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The `OME-Zarr Container` will be the starting point for all your image processing tasks.
|
|
28
|
+
|
|
29
|
+
## Main concepts
|
|
30
|
+
|
|
31
|
+
### What is the OME-Zarr container?
|
|
32
|
+
|
|
33
|
+
The `OME-Zarr Container` in ngio is your entry point to working with OME-Zarr images.
|
|
34
|
+
|
|
35
|
+
It provides:
|
|
36
|
+
|
|
37
|
+
- **OME-Zarr overview**: get an overview of the OME-Zarr file, including the number of image levels, list of labels, and tables available.
|
|
38
|
+
- **Image access**: get access to the images at different resolution levels and pixel sizes.
|
|
39
|
+
- **Label management**: check which labels are available, access them, and create new labels.
|
|
40
|
+
- **Table management**: check which tables are available, access them, and create new tables.
|
|
41
|
+
- **Derive new OME-Zarr images**: create new images based on the original one, with the same or similar metadata.
|
|
42
|
+
|
|
43
|
+
### What is the OME-Zarr container not?
|
|
44
|
+
|
|
45
|
+
The `OME-Zarr Container` object does not allow the user to interact with the image data directly. For that, we need to use the `Image`, `Label`, and `Table` objects.
|
|
46
|
+
|
|
47
|
+
## OME-Zarr overview
|
|
48
|
+
|
|
49
|
+
Examples of the OME-Zarr metadata access:
|
|
50
|
+
|
|
51
|
+
=== "Number of Resolution Levels"
|
|
52
|
+
Show the number of resolution levels:
|
|
53
|
+
```pycon exec="true" source="console" session="get_started"
|
|
54
|
+
>>> ome_zarr_container.levels # Show the number of resolution levels
|
|
55
|
+
>>> print(ome_zarr_container.levels) # markdown-exec: hide
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
=== "Available Paths"
|
|
59
|
+
Show the paths to all available resolution levels:
|
|
60
|
+
```pycon exec="true" source="console" session="get_started"
|
|
61
|
+
>>> ome_zarr_container.levels_paths # Show the paths to all available images
|
|
62
|
+
>>> print(ome_zarr_container.levels_paths) # markdown-exec: hide
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
=== "Dimensionality"
|
|
66
|
+
Show if the image is 2D or 3D:
|
|
67
|
+
```pycon exec="true" source="console" session="get_started"
|
|
68
|
+
>>> ome_zarr_container.is_3d # Get if the image is 3D
|
|
69
|
+
>>> print(ome_zarr_container.is_3d) # markdown-exec: hide
|
|
70
|
+
```
|
|
71
|
+
or if the image is a time series:
|
|
72
|
+
```pycon exec="true" source="console" session="get_started"
|
|
73
|
+
>>> ome_zarr_container.is_time_series # Get if the image is a time series
|
|
74
|
+
>>> print(ome_zarr_container.is_time_series) # markdown-exec: hide
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
=== "Full Metadata Object"
|
|
78
|
+
```pycon exec="true" source="console" session="get_started"
|
|
79
|
+
>>> metadata = ome_zarr_container.image_meta
|
|
80
|
+
>>> print(metadata) # markdown-exec: hide
|
|
81
|
+
```
|
|
82
|
+
The metadata object contains all the information about the image, for example, the channel labels:
|
|
83
|
+
```pycon exec="true" source="console" session="get_started"
|
|
84
|
+
>>> metadata.channel_labels
|
|
85
|
+
>>> print(metadata.channel_labels) # markdown-exec: hide
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Accessing images / labels / tables
|
|
89
|
+
|
|
90
|
+
To access images, labels, and tables, you can use the `get_image`, `get_label`, and `get_table` methods of the `OME-Zarr Container` object.
|
|
91
|
+
|
|
92
|
+
A variety of examples and additional information can be found in the [Images and Labels](./2_images.md), and [Tables](../3_tables.md) sections.
|
|
93
|
+
|
|
94
|
+
## Creating derived images
|
|
95
|
+
|
|
96
|
+
When processing an image, you might want to create a new image with the same metadata:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
# Create a new image based on the original
|
|
100
|
+
new_image = ome_zarr_container.derive_image("data/new_ome.zarr", overwrite=True)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This will create a new OME-Zarr image with the same metadata as the original image.
|
|
104
|
+
But you can also create a new image with slightly different metadata, for example, with a different shape:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
# Create a new image with a different shape
|
|
108
|
+
new_image = ome_zarr_container.derive_image(
|
|
109
|
+
"data/new_ome.zarr",
|
|
110
|
+
overwrite=True,
|
|
111
|
+
shape=(16, 128, 128),
|
|
112
|
+
xy_pixelsize=0.65,
|
|
113
|
+
z_spacing=1.0
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Creating new images
|
|
118
|
+
|
|
119
|
+
You can create OME-Zarr images from an existing numpy array using the `create_ome_zarr_from_array` function.
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
import numpy as np
|
|
123
|
+
from ngio import create_ome_zarr_from_array
|
|
124
|
+
|
|
125
|
+
# Create a random 3D array
|
|
126
|
+
x = np.random.randint(0, 255, (16, 128, 128), dtype=np.uint8)
|
|
127
|
+
|
|
128
|
+
# Save as OME-Zarr
|
|
129
|
+
new_ome_zarr_image = create_ome_zarr_from_array(
|
|
130
|
+
store="random_ome.zarr",
|
|
131
|
+
array=x,
|
|
132
|
+
xy_pixelsize=0.65,
|
|
133
|
+
z_spacing=1.0
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Alternatively, if you wanto to create an a empty OME-Zarr image, you can use the `create_empty_ome_zarr` function:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from ngio import create_empty_ome_zarr
|
|
141
|
+
# Create an empty OME-Zarr image
|
|
142
|
+
new_ome_zarr_image = create_empty_ome_zarr(
|
|
143
|
+
store="empty_ome.zarr",
|
|
144
|
+
shape=(16, 128, 128),
|
|
145
|
+
xy_pixelsize=0.65,
|
|
146
|
+
z_spacing=1.0
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
This will create an empty OME-Zarr image with the specified shape and pixel sizes.
|
|
151
|
+
|
|
152
|
+
## Opening remote OME-Zarr containers
|
|
153
|
+
|
|
154
|
+
You can use `ngio` to open remote OME-Zarr containers.
|
|
155
|
+
For publicly available OME-Zarr containers, you can just use the `open_ome_zarr_container` function with a URL.
|
|
156
|
+
|
|
157
|
+
For example, to open a remote OME-Zarr container hosted on a github repository:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
from ngio.utils import fractal_fsspec_store
|
|
161
|
+
|
|
162
|
+
url = (
|
|
163
|
+
"https://raw.githubusercontent.com/"
|
|
164
|
+
"fractal-analytics-platform/fractal-ome-zarr-examples/"
|
|
165
|
+
"refs/heads/main/v04/"
|
|
166
|
+
"20200812-CardiomyocyteDifferentiation14-Cycle1_B_03_mip.zarr/"
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
store = fractal_fsspec_store(url=url)
|
|
170
|
+
ome_zarr_container = open_ome_zarr_container(store)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
For fractal users, the `fractal_fsspec_store` function can be used to open private OME-Zarr containers.
|
|
174
|
+
In this case we need to provide a `fractal_token` to authenticate the user.
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
from ngio.utils import fractal_fsspec_store
|
|
178
|
+
|
|
179
|
+
store = fractal_fsspec_store(url="https://fractal_url...", fractal_token="**your_secret_token**")
|
|
180
|
+
ome_zarr_container = open_ome_zarr_container(store)
|
|
181
|
+
```
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# 2. Images and Labels
|
|
2
|
+
|
|
3
|
+
## Images
|
|
4
|
+
|
|
5
|
+
In order to start working with the image data, we need to instantiate an `Image` object.
|
|
6
|
+
ngio provides a high-level API to access the image data at different resolution levels and pixel sizes.
|
|
7
|
+
|
|
8
|
+
### Getting an image
|
|
9
|
+
|
|
10
|
+
=== "Highest Resolution Image"
|
|
11
|
+
By default, the `get_image` method returns the highest resolution image:
|
|
12
|
+
```pycon exec="true" source="console" session="get_started"
|
|
13
|
+
>>> ome_zarr_container.get_image() # Get the highest resolution image
|
|
14
|
+
>>> print(ome_zarr_container.get_image()) # markdown-exec: hide
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
=== "Specific Pyramid Level"
|
|
18
|
+
To get a specific pyramid level, you can use the `path` parameter:
|
|
19
|
+
```pycon exec="true" source="console" session="get_started"
|
|
20
|
+
>>> ome_zarr_container.get_image(path="1") # Get a specific pyramid level
|
|
21
|
+
>>> print(ome_zarr_container.get_image(path="1")) # markdown-exec: hide
|
|
22
|
+
```
|
|
23
|
+
This will return the image at the specified pyramid level.
|
|
24
|
+
|
|
25
|
+
=== "Specific Resolution"
|
|
26
|
+
If you want to get an image with a specific pixel size, you can use the `pixel_size` parameter:
|
|
27
|
+
```pycon exec="true" source="console" session="get_started"
|
|
28
|
+
>>> from ngio import PixelSize
|
|
29
|
+
>>> pixel_size = PixelSize(x=0.65, y=0.65, z=1.0)
|
|
30
|
+
>>> ome_zarr_container.get_image(pixel_size=pixel_size)
|
|
31
|
+
>>> image = ome_zarr_container.get_image(pixel_size=pixel_size) # markdown-exec: hide
|
|
32
|
+
>>> print(image) # markdown-exec: hide
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
=== "Nearest Resolution"
|
|
36
|
+
By default the pixels must match exactly the requested pixel size. If you want to get the nearest resolution, you can use the `strict` parameter:
|
|
37
|
+
```pycon exec="true" source="console" session="get_started"
|
|
38
|
+
>>> from ngio import PixelSize
|
|
39
|
+
>>> pixel_size = PixelSize(x=0.60, y=0.60, z=1.0)
|
|
40
|
+
>>> ome_zarr_container.get_image(pixel_size=pixel_size, strict=False)
|
|
41
|
+
>>> image = ome_zarr_container.get_image(pixel_size=pixel_size, strict=False) # markdown-exec: hide
|
|
42
|
+
>>> print(image) # markdown-exec: hide
|
|
43
|
+
```
|
|
44
|
+
This will return the image with the nearest resolution to the requested pixel size.
|
|
45
|
+
|
|
46
|
+
Similarly to the `OME-Zarr Container`, the `Image` object provides a high-level API to access the image metadata.
|
|
47
|
+
|
|
48
|
+
=== "Dimensions"
|
|
49
|
+
```pycon exec="true" source="console" session="get_started"
|
|
50
|
+
>>> image.dimensions
|
|
51
|
+
>>> print(image.dimensions) # markdown-exec: hide
|
|
52
|
+
```
|
|
53
|
+
The `dimensions` attribute returns a object with the image dimensions for each axis.
|
|
54
|
+
|
|
55
|
+
=== "Pixel Size"
|
|
56
|
+
```pycon exec="true" source="console" session="get_started"
|
|
57
|
+
>>> image.pixel_size
|
|
58
|
+
>>> print(image.pixel_size) # markdown-exec: hide
|
|
59
|
+
```
|
|
60
|
+
The `pixel_size` attribute returns the pixel size for each axis.
|
|
61
|
+
|
|
62
|
+
=== "On disk array infos"
|
|
63
|
+
```pycon exec="true" source="console" session="get_started"
|
|
64
|
+
>>> image.shape, image.dtype, image.chunks
|
|
65
|
+
>>> print(image.shape, image.dtype, image.chunks) # markdown-exec: hide
|
|
66
|
+
```
|
|
67
|
+
The `axes` attribute returns the order of the axes in the image.
|
|
68
|
+
|
|
69
|
+
### Working with image data
|
|
70
|
+
|
|
71
|
+
Once you have the `Image` object, you can access the image data as a:
|
|
72
|
+
|
|
73
|
+
=== "Numpy Array"
|
|
74
|
+
```pycon exec="true" source="console" session="get_started"
|
|
75
|
+
>>> data = image.get_array() # Get the image as a numpy array
|
|
76
|
+
>>> data.shape, data.dtype
|
|
77
|
+
>>> print(data.shape, data.dtype) # markdown-exec: hide
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
=== "Dask Array"
|
|
81
|
+
```pycon exec="true" source="console" session="get_started"
|
|
82
|
+
>>> dask_array = image.get_array(mode="dask") # Get the image as a dask array
|
|
83
|
+
>>> dask_array
|
|
84
|
+
>>> print(dask_array) # markdown-exec: hide
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
=== "Dask Delayed"
|
|
88
|
+
```pycon exec="true" source="console" session="get_started"
|
|
89
|
+
>>> dask_delayed = image.get_array(mode="delayed") # Get the image as a dask delayed object
|
|
90
|
+
>>> dask_delayed
|
|
91
|
+
>>> print(dask_delayed) # markdown-exec: hide
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The `get_array` can also be used to slice the image data, and query specific axes in specific orders:
|
|
95
|
+
|
|
96
|
+
```pycon exec="true" source="console" session="get_started"
|
|
97
|
+
>>> image_slice = image.get_array(c=0, x=slice(0, 128), axes_order=["t", "z", "y", "x", "c"]) # Get a specific channel and axes order
|
|
98
|
+
>>> image_slice.shape
|
|
99
|
+
>>> print(image_slice.shape) # markdown-exec: hide
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If you want to edit the image data, you can use the `set_array` method:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
>>> image.set_array(data) # Set the image data
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The `set_array` method can be used to set the image data from a numpy array, dask array, or dask delayed object.
|
|
109
|
+
|
|
110
|
+
A minimal example of how to use the `get_array` and `set_array` methods:
|
|
111
|
+
|
|
112
|
+
```python exec="true" source="material-block" session="get_started"
|
|
113
|
+
# Get the image data as a numpy array
|
|
114
|
+
data = image.get_array(c=0, x=slice(0, 128), y=slice(0, 128), axes_order=["z", "y", "x", "c"])
|
|
115
|
+
|
|
116
|
+
# Modify the image data
|
|
117
|
+
some_function = lambda x: x # markdown-exec: hide
|
|
118
|
+
data = some_function(data)
|
|
119
|
+
|
|
120
|
+
# Set the modified image data
|
|
121
|
+
image.set_array(data, c=0, x=slice(0, 128), y=slice(0, 128), axes_order=["z", "y", "x", "c"])
|
|
122
|
+
image.consolidate() # Consolidate the changes to all resolution levels, see below for more details
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
!!! important
|
|
126
|
+
The `set_array` method will overwrite the image data at single resolution level. After you have finished editing the image data, you need to `consolidate` the changes to the OME-Zarr file at all resolution levels:
|
|
127
|
+
```python
|
|
128
|
+
>>> image.consolidate() # Consolidate the changes
|
|
129
|
+
```
|
|
130
|
+
This will write the changes to the OME-Zarr file at all resolution levels.
|
|
131
|
+
|
|
132
|
+
## Labels
|
|
133
|
+
|
|
134
|
+
`Labels` represent segmentation masks that identify objects in the image. In ngio `Labels` are similar to `Images` and can
|
|
135
|
+
be accessed and manipulated in the same way.
|
|
136
|
+
|
|
137
|
+
### Getting a label
|
|
138
|
+
|
|
139
|
+
Now let's see what labels are available in our image:
|
|
140
|
+
|
|
141
|
+
```pycon exec="true" source="console" session="get_started"
|
|
142
|
+
# List all available labels
|
|
143
|
+
>>> ome_zarr_container.list_labels() # Available labels
|
|
144
|
+
>>> print(ome_zarr_container.list_labels()) # markdown-exec: hide
|
|
145
|
+
>>> print("") # markdown-exec: hide
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
We have `4` labels available in our image. Let's see how to access them:
|
|
149
|
+
|
|
150
|
+
=== "Highest Resolution Label"
|
|
151
|
+
By default, the `get_label` method returns the highest resolution label:
|
|
152
|
+
```pycon exec="true" source="console" session="get_started"
|
|
153
|
+
>>> ome_zarr_container.get_label("nuclei") # Get the highest resolution label
|
|
154
|
+
>>> print(ome_zarr_container.get_label("nuclei")) # markdown-exec: hide
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
=== "Specific Pyramid Level"
|
|
158
|
+
To get a specific pyramid level, you can use the `path` parameter:
|
|
159
|
+
```pycon exec="true" source="console" session="get_started"
|
|
160
|
+
>>> ome_zarr_container.get_label("nuclei", path="1") # Get a specific pyramid level
|
|
161
|
+
>>> print(ome_zarr_container.get_label("nuclei", path="1")) # markdown-exec: hide
|
|
162
|
+
```
|
|
163
|
+
This will return the label at the specified pyramid level.
|
|
164
|
+
|
|
165
|
+
=== "Specific Resolution"
|
|
166
|
+
If you want to get a label with a specific pixel size, you can use the `pixel_size` parameter:
|
|
167
|
+
```pycon exec="true" source="console" session="get_started"
|
|
168
|
+
>>> from ngio import PixelSize
|
|
169
|
+
>>> pixel_size = PixelSize(x=0.65, y=0.65, z=1.0)
|
|
170
|
+
>>> ome_zarr_container.get_label("nuclei", pixel_size=pixel_size)
|
|
171
|
+
>>> label_nuclei = ome_zarr_container.get_label("nuclei", pixel_size=pixel_size) # markdown-exec: hide
|
|
172
|
+
>>> print(label_nuclei) # markdown-exec: hide
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
=== "Nearest Resolution"
|
|
176
|
+
By default the pixels must match exactly the requested pixel size. If you want to get the nearest resolution, you can use the `strict` parameter:
|
|
177
|
+
```pycon exec="true" source="console" session="get_started"
|
|
178
|
+
>>> from ngio import PixelSize
|
|
179
|
+
>>> pixel_size = PixelSize(x=0.60, y=0.60, z=1.0)
|
|
180
|
+
>>> ome_zarr_container.get_label("nuclei", pixel_size=pixel_size, strict=False)
|
|
181
|
+
>>> label_nuclei = ome_zarr_container.get_label("nuclei", pixel_size=pixel_size, strict=False) # markdown-exec: hide
|
|
182
|
+
>>> print(label_nuclei) # markdown-exec: hide
|
|
183
|
+
```
|
|
184
|
+
This will return the label with the nearest resolution to the requested pixel size.
|
|
185
|
+
|
|
186
|
+
### Working with label data
|
|
187
|
+
|
|
188
|
+
Data access and manipulation for `Labels` is similar to `Images`. You can use the `get_array` and `set_array` methods to access and modify the label data.
|
|
189
|
+
|
|
190
|
+
### Deriving a label
|
|
191
|
+
|
|
192
|
+
Often, you might want to create a new label based on an existing image. You can do this using the `derive_label` method:
|
|
193
|
+
|
|
194
|
+
```pycon exec="true" source="console" session="get_started"
|
|
195
|
+
>>> new_label = ome_zarr_container.derive_label("new_label", overwrite=True) # Derive a new label
|
|
196
|
+
>>> print(new_label) # markdown-exec: hide
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
This will create a new label with the same dimensions as the original image (without channels) and compatible metadata.
|
|
200
|
+
If you want to create a new label with slightly different metadata see [API Reference](../api/images.md).
|