ngio 0.1.6__tar.gz → 0.2.0a2__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.1.6 → ngio-0.2.0a2}/.github/workflows/build_docs.yml +1 -12
- {ngio-0.1.6 → ngio-0.2.0a2}/.github/workflows/ci.yml +6 -27
- {ngio-0.1.6 → ngio-0.2.0a2}/.gitignore +10 -2
- {ngio-0.1.6 → ngio-0.2.0a2}/.pre-commit-config.yaml +1 -1
- {ngio-0.1.6 → ngio-0.2.0a2}/PKG-INFO +18 -39
- {ngio-0.1.6 → ngio-0.2.0a2}/docs/notebooks/basic_usage.ipynb +52 -59
- {ngio-0.1.6 → ngio-0.2.0a2}/docs/notebooks/image.ipynb +79 -62
- {ngio-0.1.6 → ngio-0.2.0a2}/docs/notebooks/processing.ipynb +40 -39
- {ngio-0.1.6 → ngio-0.2.0a2}/pyproject.toml +60 -50
- ngio-0.2.0a2/src/ngio/__init__.py +41 -0
- ngio-0.2.0a2/src/ngio/common/__init__.py +44 -0
- ngio-0.2.0a2/src/ngio/common/_array_pipe.py +160 -0
- ngio-0.2.0a2/src/ngio/common/_axes_transforms.py +63 -0
- ngio-0.2.0a2/src/ngio/common/_common_types.py +5 -0
- ngio-0.2.0a2/src/ngio/common/_dimensions.py +113 -0
- ngio-0.2.0a2/src/ngio/common/_pyramid.py +223 -0
- ngio-0.1.6/src/ngio/core/roi.py → ngio-0.2.0a2/src/ngio/common/_roi.py +22 -23
- ngio-0.2.0a2/src/ngio/common/_slicer.py +97 -0
- ngio-0.1.6/src/ngio/pipes/_zoom_utils.py → ngio-0.2.0a2/src/ngio/common/_zoom.py +2 -78
- ngio-0.2.0a2/src/ngio/hcs/__init__.py +60 -0
- ngio-0.2.0a2/src/ngio/images/__init__.py +23 -0
- ngio-0.2.0a2/src/ngio/images/abstract_image.py +240 -0
- ngio-0.2.0a2/src/ngio/images/create.py +251 -0
- ngio-0.2.0a2/src/ngio/images/image.py +389 -0
- ngio-0.2.0a2/src/ngio/images/label.py +236 -0
- ngio-0.2.0a2/src/ngio/images/omezarr_container.py +535 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/__init__.py +35 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/_generic_handlers.py +320 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/_meta_handlers.py +142 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/__init__.py +63 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/_axes.py +481 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/_channels.py +378 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/_dataset.py +134 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +5 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +434 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/ngio_specs/_pixel_size.py +84 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/v04/__init__.py +11 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/v04/_meta_handlers.py +54 -0
- ngio-0.2.0a2/src/ngio/ome_zarr_meta/v04/_v04_spec_utils.py +412 -0
- ngio-0.2.0a2/src/ngio/tables/__init__.py +27 -0
- ngio-0.2.0a2/src/ngio/tables/_validators.py +192 -0
- ngio-0.2.0a2/src/ngio/tables/backends/__init__.py +8 -0
- ngio-0.2.0a2/src/ngio/tables/backends/_abstract_backend.py +71 -0
- ngio-0.2.0a2/src/ngio/tables/backends/_anndata_utils.py +194 -0
- ngio-0.2.0a2/src/ngio/tables/backends/_anndata_v1.py +75 -0
- ngio-0.2.0a2/src/ngio/tables/backends/_json_v1.py +56 -0
- ngio-0.2.0a2/src/ngio/tables/backends/_table_backends.py +102 -0
- ngio-0.2.0a2/src/ngio/tables/tables_container.py +300 -0
- ngio-0.2.0a2/src/ngio/tables/v1/__init__.py +8 -0
- ngio-0.2.0a2/src/ngio/tables/v1/_feature_table.py +161 -0
- ngio-0.2.0a2/src/ngio/tables/v1/_generic_table.py +118 -0
- ngio-0.2.0a2/src/ngio/tables/v1/_masking_roi_table.py +175 -0
- ngio-0.2.0a2/src/ngio/tables/v1/_roi_table.py +226 -0
- ngio-0.2.0a2/src/ngio/utils/__init__.py +43 -0
- ngio-0.2.0a2/src/ngio/utils/_datasets.py +51 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/src/ngio/utils/_errors.py +10 -4
- ngio-0.2.0a2/src/ngio/utils/_zarr_utils.py +378 -0
- ngio-0.2.0a2/tests/conftest.py +11 -0
- ngio-0.2.0a2/tests/data/meta_v04/base_ome_zarr_image_meta.json +73 -0
- ngio-0.2.0a2/tests/data/meta_v04/base_ome_zarr_image_meta_wrong_axis_order.json +73 -0
- ngio-0.2.0a2/tests/data/meta_v04/base_ome_zarr_label_meta.json +50 -0
- ngio-0.2.0a2/tests/unit/common/test_dimensions.py +78 -0
- ngio-0.2.0a2/tests/unit/common/test_pyramid.py +27 -0
- ngio-0.2.0a2/tests/unit/common/test_roi.py +43 -0
- ngio-0.2.0a2/tests/unit/images/test_omezarr_container.py +95 -0
- ngio-0.2.0a2/tests/unit/tables/test_backends.py +197 -0
- ngio-0.2.0a2/tests/unit/tables/test_feature_table.py +24 -0
- ngio-0.2.0a2/tests/unit/tables/test_generic_table.py +24 -0
- ngio-0.2.0a2/tests/unit/tables/test_masking_roi_table_v1.py +60 -0
- ngio-0.2.0a2/tests/unit/tables/test_roi_table_v1.py +67 -0
- ngio-0.2.0a2/tests/unit/tables/test_table_group.py +9 -0
- ngio-0.2.0a2/tests/unit/tables/test_validators.py +53 -0
- ngio-0.2.0a2/tests/unit/test_ome_zarr_meta/test_image_handler.py +13 -0
- ngio-0.2.0a2/tests/unit/test_ome_zarr_meta/test_unit_ngio_specs.py +465 -0
- ngio-0.2.0a2/tests/unit/test_ome_zarr_meta/test_unit_v04_utils.py +41 -0
- ngio-0.2.0a2/tests/unit/utils/test_download_datasets.py +17 -0
- ngio-0.2.0a2/tests/unit/utils/test_zarr_utils.py +185 -0
- ngio-0.1.6/setup_data.sh +0 -9
- ngio-0.1.6/src/ngio/__init__.py +0 -15
- ngio-0.1.6/src/ngio/core/__init__.py +0 -7
- ngio-0.1.6/src/ngio/core/dimensions.py +0 -122
- ngio-0.1.6/src/ngio/core/image_handler.py +0 -228
- ngio-0.1.6/src/ngio/core/image_like_handler.py +0 -549
- ngio-0.1.6/src/ngio/core/label_handler.py +0 -410
- ngio-0.1.6/src/ngio/core/ngff_image.py +0 -387
- ngio-0.1.6/src/ngio/core/utils.py +0 -287
- ngio-0.1.6/src/ngio/io/__init__.py +0 -19
- ngio-0.1.6/src/ngio/io/_zarr.py +0 -88
- ngio-0.1.6/src/ngio/io/_zarr_array_utils.py +0 -0
- ngio-0.1.6/src/ngio/io/_zarr_group_utils.py +0 -60
- ngio-0.1.6/src/ngio/iterators/__init__.py +0 -1
- ngio-0.1.6/src/ngio/ngff_meta/__init__.py +0 -27
- ngio-0.1.6/src/ngio/ngff_meta/fractal_image_meta.py +0 -1267
- ngio-0.1.6/src/ngio/ngff_meta/meta_handler.py +0 -92
- ngio-0.1.6/src/ngio/ngff_meta/utils.py +0 -235
- ngio-0.1.6/src/ngio/ngff_meta/v04/__init__.py +0 -6
- ngio-0.1.6/src/ngio/ngff_meta/v04/specs.py +0 -158
- ngio-0.1.6/src/ngio/ngff_meta/v04/zarr_utils.py +0 -376
- ngio-0.1.6/src/ngio/pipes/__init__.py +0 -7
- ngio-0.1.6/src/ngio/pipes/_slicer_transforms.py +0 -176
- ngio-0.1.6/src/ngio/pipes/_transforms.py +0 -33
- ngio-0.1.6/src/ngio/pipes/data_pipe.py +0 -52
- ngio-0.1.6/src/ngio/tables/__init__.py +0 -11
- ngio-0.1.6/src/ngio/tables/_ad_reader.py +0 -80
- ngio-0.1.6/src/ngio/tables/_utils.py +0 -301
- ngio-0.1.6/src/ngio/tables/tables_group.py +0 -252
- ngio-0.1.6/src/ngio/tables/v1/__init__.py +0 -7
- ngio-0.1.6/src/ngio/tables/v1/_generic_table.py +0 -201
- ngio-0.1.6/src/ngio/tables/v1/feature_tables.py +0 -182
- ngio-0.1.6/src/ngio/tables/v1/masking_roi_tables.py +0 -243
- ngio-0.1.6/src/ngio/tables/v1/roi_tables.py +0 -285
- ngio-0.1.6/src/ngio/utils/__init__.py +0 -30
- ngio-0.1.6/src/ngio/utils/_common_types.py +0 -5
- ngio-0.1.6/src/ngio/utils/_pydantic_utils.py +0 -52
- ngio-0.1.6/tests/core/conftest.py +0 -50
- ngio-0.1.6/tests/core/test_image_handler.py +0 -31
- ngio-0.1.6/tests/core/test_image_like_handler.py +0 -74
- ngio-0.1.6/tests/core/test_label_handler.py +0 -30
- ngio-0.1.6/tests/core/test_ngff_image.py +0 -87
- ngio-0.1.6/tests/core/test_roi.py +0 -20
- ngio-0.1.6/tests/io/conftest.py +0 -66
- ngio-0.1.6/tests/io/test_zarr_group_utils.py +0 -28
- ngio-0.1.6/tests/ngff_meta/conftest.py +0 -44
- ngio-0.1.6/tests/ngff_meta/test_fractal_image_meta.py +0 -37
- ngio-0.1.6/tests/ngff_meta/test_pixel_size.py +0 -27
- ngio-0.1.6/tests/ngff_meta/test_utils.py +0 -121
- ngio-0.1.6/tests/ngff_meta/test_v04.py +0 -86
- ngio-0.1.6/tests/pipes/conftest.py +0 -46
- ngio-0.1.6/tests/pipes/test_zoom.py +0 -102
- ngio-0.1.6/tests/tables/conftest.py +0 -39
- ngio-0.1.6/tests/tables/test_table_conversion.py +0 -82
- ngio-0.1.6/tests/tables/test_table_group.py +0 -39
- ngio-0.1.6/tests/tables/test_v1_tables.py +0 -55
- ngio-0.1.6/tests/tables/test_validation.py +0 -53
- {ngio-0.1.6 → ngio-0.2.0a2}/.copier-answers.yml +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/.gitattributes +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/.github/ISSUE_TEMPLATE.md +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/.github/TEST_FAIL_TEMPLATE.md +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/.github/dependabot.yml +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/LICENSE +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/README.md +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/_typos.toml +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/docs/api/core.md +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/docs/getting-started.md +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/docs/index.md +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/mkdocs.yml +0 -0
- {ngio-0.1.6 → ngio-0.2.0a2}/src/ngio/utils/_logger.py +0 -0
|
@@ -21,22 +21,11 @@ jobs:
|
|
|
21
21
|
python-version: "3.13"
|
|
22
22
|
cache-dependency-path: "pyproject.toml"
|
|
23
23
|
cache: "pip"
|
|
24
|
-
|
|
25
|
-
- name: Download Dataset from Zenodo
|
|
26
|
-
run: |
|
|
27
|
-
mkdir -p data
|
|
28
|
-
wget -O data/dataset.zip https://zenodo.org/records/13305156/files/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip?download=1?
|
|
29
|
-
unzip -o data/dataset.zip -d data
|
|
30
|
-
- name: Download Dataset from Zenodo MIP
|
|
31
|
-
run: |
|
|
32
|
-
mkdir -p data
|
|
33
|
-
wget -O data/dataset.zip https://zenodo.org/records/13305316/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip?download=1?
|
|
34
|
-
unzip -o data/dataset.zip -d data
|
|
35
24
|
|
|
36
25
|
- name: Install Dependencies
|
|
37
26
|
run: |
|
|
38
27
|
python -m pip install -U pip
|
|
39
|
-
python -m pip install .[
|
|
28
|
+
python -m pip install .[dev]
|
|
40
29
|
python -m pip install .[docs]
|
|
41
30
|
|
|
42
31
|
- name: 📚 Build Docs
|
|
@@ -32,11 +32,14 @@ jobs:
|
|
|
32
32
|
strategy:
|
|
33
33
|
fail-fast: false
|
|
34
34
|
matrix:
|
|
35
|
-
python-version: ["3.
|
|
36
|
-
# Skip Windows for now It's seems there are some issues with the
|
|
37
|
-
# ZarrV3 on Windows
|
|
35
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
38
36
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
39
37
|
# platform: [ubuntu-latest, macos-latest]
|
|
38
|
+
exclude:
|
|
39
|
+
- python-version: "3.11"
|
|
40
|
+
platform: windows-latest
|
|
41
|
+
- python-version: "3.12"
|
|
42
|
+
platform: windows-latest
|
|
40
43
|
|
|
41
44
|
steps:
|
|
42
45
|
- uses: actions/checkout@v4
|
|
@@ -78,30 +81,6 @@ jobs:
|
|
|
78
81
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
79
82
|
files: /home/runner/work/ngio/ngio/coverage.xml
|
|
80
83
|
|
|
81
|
-
zarrv3:
|
|
82
|
-
name: Test zarr-python v3 compatibility
|
|
83
|
-
runs-on: ubuntu-latest
|
|
84
|
-
|
|
85
|
-
steps:
|
|
86
|
-
- uses: actions/checkout@v4
|
|
87
|
-
|
|
88
|
-
- name: 🐍 Set up Python
|
|
89
|
-
uses: actions/setup-python@v5
|
|
90
|
-
with:
|
|
91
|
-
python-version: "3.11"
|
|
92
|
-
cache-dependency-path: "pyproject.toml"
|
|
93
|
-
cache: "pip"
|
|
94
|
-
|
|
95
|
-
- name: Install Dependencies
|
|
96
|
-
run: |
|
|
97
|
-
python -m pip install -U pip
|
|
98
|
-
# if running a cron job, we add the --pre flag to test against pre-releases
|
|
99
|
-
python -m pip install .[dev3] ${{ github.event_name == 'schedule' && '--pre' || '' }}
|
|
100
|
-
|
|
101
|
-
- name: 🧪 Run Tests
|
|
102
|
-
run: pytest
|
|
103
|
-
continue-on-error: true
|
|
104
|
-
|
|
105
84
|
deploy:
|
|
106
85
|
name: Deploy
|
|
107
86
|
needs: test
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ngio
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0a2
|
|
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
|
|
@@ -10,54 +10,34 @@ License-File: LICENSE
|
|
|
10
10
|
Classifier: Development Status :: 3 - Alpha
|
|
11
11
|
Classifier: License :: OSI Approved :: BSD License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
16
|
Classifier: Typing :: Typed
|
|
18
|
-
Requires-Python:
|
|
17
|
+
Requires-Python: <3.14,>=3.11
|
|
19
18
|
Requires-Dist: aiohttp
|
|
20
19
|
Requires-Dist: anndata>=0.8.0
|
|
21
20
|
Requires-Dist: dask[array]
|
|
21
|
+
Requires-Dist: dask[distributed]
|
|
22
|
+
Requires-Dist: filelock
|
|
22
23
|
Requires-Dist: numpy
|
|
24
|
+
Requires-Dist: ome-zarr-models
|
|
23
25
|
Requires-Dist: pandas>=1.2.0
|
|
26
|
+
Requires-Dist: pooch
|
|
24
27
|
Requires-Dist: pydantic
|
|
25
28
|
Requires-Dist: requests
|
|
26
|
-
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist: pdbpp; extra == 'dev2'
|
|
39
|
-
Requires-Dist: plotly; extra == 'dev2'
|
|
40
|
-
Requires-Dist: pre-commit; extra == 'dev2'
|
|
41
|
-
Requires-Dist: pyqt5; extra == 'dev2'
|
|
42
|
-
Requires-Dist: pytest; extra == 'dev2'
|
|
43
|
-
Requires-Dist: pytest-cov; extra == 'dev2'
|
|
44
|
-
Requires-Dist: rich; extra == 'dev2'
|
|
45
|
-
Requires-Dist: ruff; extra == 'dev2'
|
|
46
|
-
Requires-Dist: scikit-image; extra == 'dev2'
|
|
47
|
-
Requires-Dist: zarr<3; extra == 'dev2'
|
|
48
|
-
Provides-Extra: dev3
|
|
49
|
-
Requires-Dist: dask-image; extra == 'dev3'
|
|
50
|
-
Requires-Dist: dask[distributed]; extra == 'dev3'
|
|
51
|
-
Requires-Dist: ipython; extra == 'dev3'
|
|
52
|
-
Requires-Dist: mypy; extra == 'dev3'
|
|
53
|
-
Requires-Dist: notebook; extra == 'dev3'
|
|
54
|
-
Requires-Dist: pdbpp; extra == 'dev3'
|
|
55
|
-
Requires-Dist: pre-commit; extra == 'dev3'
|
|
56
|
-
Requires-Dist: pytest; extra == 'dev3'
|
|
57
|
-
Requires-Dist: pytest-cov; extra == 'dev3'
|
|
58
|
-
Requires-Dist: rich; extra == 'dev3'
|
|
59
|
-
Requires-Dist: ruff; extra == 'dev3'
|
|
60
|
-
Requires-Dist: zarr==v3.0.0-alpha.4; extra == 'dev3'
|
|
29
|
+
Requires-Dist: xarray
|
|
30
|
+
Requires-Dist: zarr<3
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: matplotlib; extra == 'dev'
|
|
33
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
34
|
+
Requires-Dist: napari; extra == 'dev'
|
|
35
|
+
Requires-Dist: notebook; extra == 'dev'
|
|
36
|
+
Requires-Dist: pdbpp; extra == 'dev'
|
|
37
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
38
|
+
Requires-Dist: pyqt5; extra == 'dev'
|
|
39
|
+
Requires-Dist: rich; extra == 'dev'
|
|
40
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
61
41
|
Provides-Extra: docs
|
|
62
42
|
Requires-Dist: mkdocs; extra == 'docs'
|
|
63
43
|
Requires-Dist: mkdocs-autorefs; extra == 'docs'
|
|
@@ -70,7 +50,6 @@ Requires-Dist: scikit-image; extra == 'docs'
|
|
|
70
50
|
Provides-Extra: test
|
|
71
51
|
Requires-Dist: pytest; extra == 'test'
|
|
72
52
|
Requires-Dist: pytest-cov; extra == 'test'
|
|
73
|
-
Requires-Dist: zarr<3; extra == 'test'
|
|
74
53
|
Description-Content-Type: text/markdown
|
|
75
54
|
|
|
76
55
|
# NGIO - Next Generation file format IO
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"source": [
|
|
7
7
|
"# OME-Zarr Image Exploration\n",
|
|
8
8
|
"\n",
|
|
9
|
-
"In this notebook we will show how to use the '
|
|
9
|
+
"In this notebook we will show how to use the 'OmeZarr Container' class to explore and manage an OME-NGFF image.\n",
|
|
10
10
|
"\n",
|
|
11
11
|
"For this example we will use a small example image that can be downloaded from the following link: [example ome-zarr](https://zenodo.org/records/13305156)\n",
|
|
12
12
|
"\n",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"```\n",
|
|
20
20
|
"from the root of the repository.\n",
|
|
21
21
|
"\n",
|
|
22
|
-
"##
|
|
22
|
+
"## OmeZarr Container\n",
|
|
23
23
|
"\n",
|
|
24
|
-
"The `
|
|
25
|
-
"A `
|
|
24
|
+
"The `OmeZarr Container` provides a high-level interface to read, write and manipulate NGFF images.\n",
|
|
25
|
+
"A `OmeZarr Container` can be created from a storelike object (e.g. a path to a directory, or a url) or from a `zarr.Group` object. "
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
"metadata": {},
|
|
32
32
|
"outputs": [],
|
|
33
33
|
"source": [
|
|
34
|
-
"from ngio
|
|
34
|
+
"from ngio import open_omezarr_container\n",
|
|
35
|
+
"from ngio.utils import download_ome_zarr_dataset\n",
|
|
35
36
|
"\n",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
37
|
+
"hcs_path = download_ome_zarr_dataset(\"CardiomyocyteSmallMip\")\n",
|
|
38
|
+
"image_path = hcs_path / \"B\" / \"03\" / \"0\"\n",
|
|
39
|
+
"omezarr_container = open_omezarr_container(image_path)"
|
|
39
40
|
]
|
|
40
41
|
},
|
|
41
42
|
{
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"metadata": {},
|
|
44
45
|
"source": [
|
|
45
46
|
"\n",
|
|
46
|
-
"The `
|
|
47
|
+
"The `omezarr_container` object provides a high-level interface to read, write and manipulate OME-Zarr images.\n",
|
|
47
48
|
"\n",
|
|
48
49
|
"Print the image will show some overview information like:\n",
|
|
49
50
|
"* The path to the image\n",
|
|
@@ -58,14 +59,14 @@
|
|
|
58
59
|
"metadata": {},
|
|
59
60
|
"outputs": [],
|
|
60
61
|
"source": [
|
|
61
|
-
"print(
|
|
62
|
+
"print(omezarr_container)"
|
|
62
63
|
]
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
66
|
"cell_type": "markdown",
|
|
66
67
|
"metadata": {},
|
|
67
68
|
"source": [
|
|
68
|
-
"From the `
|
|
69
|
+
"From the `OmeZarr Container` object we can easily access access the image data (at any resolution level), the labels and the tables."
|
|
69
70
|
]
|
|
70
71
|
},
|
|
71
72
|
{
|
|
@@ -83,18 +84,18 @@
|
|
|
83
84
|
"metadata": {},
|
|
84
85
|
"outputs": [],
|
|
85
86
|
"source": [
|
|
86
|
-
"from ngio
|
|
87
|
+
"from ngio import PixelSize\n",
|
|
87
88
|
"\n",
|
|
88
89
|
"# 1. Get image from highest resolution (default)\n",
|
|
89
|
-
"image =
|
|
90
|
+
"image = omezarr_container.get_image()\n",
|
|
90
91
|
"print(image)\n",
|
|
91
92
|
"\n",
|
|
92
93
|
"# 2. Get image from a specific level using the path keyword\n",
|
|
93
|
-
"image =
|
|
94
|
+
"image = omezarr_container.get_image(path=\"1\")\n",
|
|
94
95
|
"print(image)\n",
|
|
95
96
|
"\n",
|
|
96
97
|
"# 3. Get image from a specific pixel size using the pixel_size keyword\n",
|
|
97
|
-
"image =
|
|
98
|
+
"image = omezarr_container.get_image(pixel_size=PixelSize(x=0.65, y=0.65, z=1))\n",
|
|
98
99
|
"print(image)"
|
|
99
100
|
]
|
|
100
101
|
},
|
|
@@ -112,7 +113,6 @@
|
|
|
112
113
|
"outputs": [],
|
|
113
114
|
"source": [
|
|
114
115
|
"print(\"Shape\", image.shape)\n",
|
|
115
|
-
"print(\"Axes\", image.axes_names)\n",
|
|
116
116
|
"print(\"PixelSize\", image.pixel_size)\n",
|
|
117
117
|
"print(\"Dimensions\", image.dimensions)\n",
|
|
118
118
|
"print(\"Channel Names\", image.channel_labels)"
|
|
@@ -137,19 +137,7 @@
|
|
|
137
137
|
"metadata": {},
|
|
138
138
|
"source": [
|
|
139
139
|
"`ngio` design is to always provide the data in a canonical axis order (`t`, `c`, `z`, `y`, `x`) no matter what is the order on disk. \n",
|
|
140
|
-
"The `Image` object provides methods to access the data in this order. \n"
|
|
141
|
-
"If you want to access data or metadata in the on-disk order, you can by using `on_disk_{method_name}` methods.\n"
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"cell_type": "code",
|
|
146
|
-
"execution_count": null,
|
|
147
|
-
"metadata": {},
|
|
148
|
-
"outputs": [],
|
|
149
|
-
"source": [
|
|
150
|
-
"print(\"On-disk shape\", image.on_disk_shape)\n",
|
|
151
|
-
"print(\"On-disk array\", image.on_disk_array)\n",
|
|
152
|
-
"print(\"On-disk dask array\", image.on_disk_dask_array)"
|
|
140
|
+
"The `Image` object provides methods to access the data in this order. \n"
|
|
153
141
|
]
|
|
154
142
|
},
|
|
155
143
|
{
|
|
@@ -167,9 +155,9 @@
|
|
|
167
155
|
"metadata": {},
|
|
168
156
|
"outputs": [],
|
|
169
157
|
"source": [
|
|
170
|
-
"print(\"List of Labels: \",
|
|
158
|
+
"print(\"List of Labels: \", omezarr_container.list_labels())\n",
|
|
171
159
|
"\n",
|
|
172
|
-
"label_nuclei =
|
|
160
|
+
"label_nuclei = omezarr_container.get_label(\"nuclei\", path=\"0\")\n",
|
|
173
161
|
"print(label_nuclei)"
|
|
174
162
|
]
|
|
175
163
|
},
|
|
@@ -193,10 +181,7 @@
|
|
|
193
181
|
"metadata": {},
|
|
194
182
|
"outputs": [],
|
|
195
183
|
"source": [
|
|
196
|
-
"print(\"List of Tables: \",
|
|
197
|
-
"print(\" - Feature tables: \", ngff_image.tables.list(table_type=\"feature_table\"))\n",
|
|
198
|
-
"print(\" - Roi tables: \", ngff_image.tables.list(table_type=\"roi_table\"))\n",
|
|
199
|
-
"print(\" - Masking Roi tables: \", ngff_image.tables.list(table_type=\"masking_roi_table\"))"
|
|
184
|
+
"print(\"List of Tables: \", omezarr_container.list_tables())"
|
|
200
185
|
]
|
|
201
186
|
},
|
|
202
187
|
{
|
|
@@ -206,8 +191,8 @@
|
|
|
206
191
|
"outputs": [],
|
|
207
192
|
"source": [
|
|
208
193
|
"# Loading a table\n",
|
|
209
|
-
"feature_table =
|
|
210
|
-
"feature_table.
|
|
194
|
+
"feature_table = omezarr_container.get_table(\"regionprops_DAPI\")\n",
|
|
195
|
+
"feature_table.dataframe"
|
|
211
196
|
]
|
|
212
197
|
},
|
|
213
198
|
{
|
|
@@ -217,12 +202,9 @@
|
|
|
217
202
|
"outputs": [],
|
|
218
203
|
"source": [
|
|
219
204
|
"# Loading a roi table\n",
|
|
220
|
-
"roi_table =
|
|
221
|
-
"\n",
|
|
222
|
-
"print(f\"{roi_table.field_indexes=}\")\n",
|
|
223
|
-
"print(f\"{roi_table.get_roi('FOV_1')=}\")\n",
|
|
205
|
+
"roi_table = omezarr_container.get_table(\"FOV_ROI_table\")\n",
|
|
224
206
|
"\n",
|
|
225
|
-
"roi_table.
|
|
207
|
+
"print(f\"{roi_table.get('FOV_1')=}\")"
|
|
226
208
|
]
|
|
227
209
|
},
|
|
228
210
|
{
|
|
@@ -241,10 +223,10 @@
|
|
|
241
223
|
"import matplotlib.pyplot as plt\n",
|
|
242
224
|
"\n",
|
|
243
225
|
"# Plotting a single ROI\n",
|
|
244
|
-
"roi = roi_table.
|
|
245
|
-
"roi_data = image.
|
|
226
|
+
"roi = roi_table.get(\"FOV_1\")\n",
|
|
227
|
+
"roi_data = image.get_roi(roi, c=0, mode=\"numpy\")\n",
|
|
246
228
|
"plt.title(\"ROI: FOV_1\")\n",
|
|
247
|
-
"plt.imshow(roi_data[0], cmap=\"gray\")\n",
|
|
229
|
+
"plt.imshow(roi_data[0, 0], cmap=\"gray\")\n",
|
|
248
230
|
"plt.axis(\"off\")\n",
|
|
249
231
|
"plt.show()"
|
|
250
232
|
]
|
|
@@ -267,19 +249,17 @@
|
|
|
267
249
|
"metadata": {},
|
|
268
250
|
"outputs": [],
|
|
269
251
|
"source": [
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
")\n",
|
|
273
|
-
"print(new_ngff_image)"
|
|
252
|
+
"new_omezarr_image = omezarr_container.derive_image(\"data/new_ome.zarr\", overwrite=True)\n",
|
|
253
|
+
"print(new_omezarr_image)"
|
|
274
254
|
]
|
|
275
255
|
},
|
|
276
256
|
{
|
|
277
257
|
"cell_type": "markdown",
|
|
278
258
|
"metadata": {},
|
|
279
259
|
"source": [
|
|
280
|
-
"## Steam an
|
|
260
|
+
"## Steam an OmeZarr over HTTP\n",
|
|
281
261
|
"\n",
|
|
282
|
-
"The `
|
|
262
|
+
"The `OmeZarr` class can also be used to stream an image over HTTP. This is useful when the image is stored on a remote server and you want to access it without downloading the entire image. All features of the `OmeZarr` class are available when streaming an image over HTTP (besides anything that requires writing to the image)."
|
|
283
263
|
]
|
|
284
264
|
},
|
|
285
265
|
{
|
|
@@ -288,20 +268,33 @@
|
|
|
288
268
|
"metadata": {},
|
|
289
269
|
"outputs": [],
|
|
290
270
|
"source": [
|
|
291
|
-
"
|
|
271
|
+
"import fsspec.implementations.http\n",
|
|
272
|
+
"\n",
|
|
273
|
+
"url = (\n",
|
|
274
|
+
" \"https://raw.githubusercontent.com/\"\n",
|
|
275
|
+
" \"fractal-analytics-platform/fractal-ome-zarr-examples/\"\n",
|
|
276
|
+
" \"refs/heads/main/v04/\"\n",
|
|
277
|
+
" \"20200812-CardiomyocyteDifferentiation14-Cycle1_B_03_mip.zarr/\"\n",
|
|
278
|
+
")\n",
|
|
292
279
|
"\n",
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"store = get_fsspec_http_store(url)\n",
|
|
296
|
-
"ngff_image = NgffImage(store, \"r\")\n",
|
|
280
|
+
"fs = fsspec.implementations.http.HTTPFileSystem(client_kwargs={})\n",
|
|
281
|
+
"store = fs.get_mapper(url)\n",
|
|
297
282
|
"\n",
|
|
298
|
-
"
|
|
283
|
+
"omezarr = open_omezarr_container(store)\n",
|
|
284
|
+
"omezarr"
|
|
299
285
|
]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"cell_type": "code",
|
|
289
|
+
"execution_count": null,
|
|
290
|
+
"metadata": {},
|
|
291
|
+
"outputs": [],
|
|
292
|
+
"source": []
|
|
300
293
|
}
|
|
301
294
|
],
|
|
302
295
|
"metadata": {
|
|
303
296
|
"kernelspec": {
|
|
304
|
-
"display_name": "
|
|
297
|
+
"display_name": "dev",
|
|
305
298
|
"language": "python",
|
|
306
299
|
"name": "python3"
|
|
307
300
|
},
|
|
@@ -315,7 +308,7 @@
|
|
|
315
308
|
"name": "python",
|
|
316
309
|
"nbconvert_exporter": "python",
|
|
317
310
|
"pygments_lexer": "ipython3",
|
|
318
|
-
"version": "3.
|
|
311
|
+
"version": "3.11.11"
|
|
319
312
|
}
|
|
320
313
|
},
|
|
321
314
|
"nbformat": 4,
|