ngio 0.1.6__tar.gz → 0.2.0a1__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.
Files changed (147) hide show
  1. {ngio-0.1.6 → ngio-0.2.0a1}/.github/workflows/build_docs.yml +1 -12
  2. {ngio-0.1.6 → ngio-0.2.0a1}/.github/workflows/ci.yml +6 -27
  3. {ngio-0.1.6 → ngio-0.2.0a1}/.gitignore +10 -2
  4. {ngio-0.1.6 → ngio-0.2.0a1}/.pre-commit-config.yaml +1 -1
  5. {ngio-0.1.6 → ngio-0.2.0a1}/PKG-INFO +18 -39
  6. {ngio-0.1.6 → ngio-0.2.0a1}/docs/notebooks/basic_usage.ipynb +52 -59
  7. {ngio-0.1.6 → ngio-0.2.0a1}/docs/notebooks/image.ipynb +13 -5
  8. {ngio-0.1.6 → ngio-0.2.0a1}/docs/notebooks/processing.ipynb +7 -6
  9. {ngio-0.1.6 → ngio-0.2.0a1}/pyproject.toml +60 -50
  10. ngio-0.2.0a1/src/ngio/__init__.py +41 -0
  11. ngio-0.2.0a1/src/ngio/common/__init__.py +44 -0
  12. ngio-0.2.0a1/src/ngio/common/_array_pipe.py +160 -0
  13. ngio-0.2.0a1/src/ngio/common/_axes_transforms.py +63 -0
  14. ngio-0.2.0a1/src/ngio/common/_common_types.py +5 -0
  15. ngio-0.2.0a1/src/ngio/common/_dimensions.py +113 -0
  16. ngio-0.2.0a1/src/ngio/common/_pyramid.py +222 -0
  17. ngio-0.1.6/src/ngio/core/roi.py → ngio-0.2.0a1/src/ngio/common/_roi.py +22 -23
  18. ngio-0.2.0a1/src/ngio/common/_slicer.py +97 -0
  19. ngio-0.1.6/src/ngio/pipes/_zoom_utils.py → ngio-0.2.0a1/src/ngio/common/_zoom.py +2 -78
  20. ngio-0.2.0a1/src/ngio/hcs/__init__.py +60 -0
  21. ngio-0.2.0a1/src/ngio/images/__init__.py +23 -0
  22. ngio-0.2.0a1/src/ngio/images/abstract_image.py +240 -0
  23. ngio-0.2.0a1/src/ngio/images/create.py +251 -0
  24. ngio-0.2.0a1/src/ngio/images/image.py +383 -0
  25. ngio-0.2.0a1/src/ngio/images/label.py +96 -0
  26. ngio-0.2.0a1/src/ngio/images/omezarr_container.py +512 -0
  27. ngio-0.2.0a1/src/ngio/ome_zarr_meta/__init__.py +35 -0
  28. ngio-0.2.0a1/src/ngio/ome_zarr_meta/_generic_handlers.py +320 -0
  29. ngio-0.2.0a1/src/ngio/ome_zarr_meta/_meta_handlers.py +142 -0
  30. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/__init__.py +63 -0
  31. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/_axes.py +481 -0
  32. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/_channels.py +378 -0
  33. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/_dataset.py +134 -0
  34. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +5 -0
  35. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +434 -0
  36. ngio-0.2.0a1/src/ngio/ome_zarr_meta/ngio_specs/_pixel_size.py +84 -0
  37. ngio-0.2.0a1/src/ngio/ome_zarr_meta/v04/__init__.py +11 -0
  38. ngio-0.2.0a1/src/ngio/ome_zarr_meta/v04/_meta_handlers.py +54 -0
  39. ngio-0.2.0a1/src/ngio/ome_zarr_meta/v04/_v04_spec_utils.py +412 -0
  40. ngio-0.2.0a1/src/ngio/tables/__init__.py +27 -0
  41. ngio-0.2.0a1/src/ngio/tables/_validators.py +192 -0
  42. ngio-0.2.0a1/src/ngio/tables/backends/__init__.py +8 -0
  43. ngio-0.2.0a1/src/ngio/tables/backends/_abstract_backend.py +71 -0
  44. ngio-0.2.0a1/src/ngio/tables/backends/_anndata_utils.py +194 -0
  45. ngio-0.2.0a1/src/ngio/tables/backends/_anndata_v1.py +75 -0
  46. ngio-0.2.0a1/src/ngio/tables/backends/_json_v1.py +56 -0
  47. ngio-0.2.0a1/src/ngio/tables/backends/_table_backends.py +102 -0
  48. ngio-0.2.0a1/src/ngio/tables/tables_container.py +300 -0
  49. ngio-0.2.0a1/src/ngio/tables/v1/__init__.py +8 -0
  50. ngio-0.2.0a1/src/ngio/tables/v1/_feature_table.py +161 -0
  51. ngio-0.2.0a1/src/ngio/tables/v1/_generic_table.py +118 -0
  52. ngio-0.2.0a1/src/ngio/tables/v1/_masking_roi_table.py +175 -0
  53. ngio-0.2.0a1/src/ngio/tables/v1/_roi_table.py +226 -0
  54. ngio-0.2.0a1/src/ngio/utils/__init__.py +43 -0
  55. ngio-0.2.0a1/src/ngio/utils/_datasets.py +51 -0
  56. {ngio-0.1.6 → ngio-0.2.0a1}/src/ngio/utils/_errors.py +10 -4
  57. ngio-0.2.0a1/src/ngio/utils/_zarr_utils.py +378 -0
  58. ngio-0.2.0a1/tests/conftest.py +11 -0
  59. ngio-0.2.0a1/tests/data/meta_v04/base_ome_zarr_image_meta.json +73 -0
  60. ngio-0.2.0a1/tests/data/meta_v04/base_ome_zarr_image_meta_wrong_axis_order.json +73 -0
  61. ngio-0.2.0a1/tests/data/meta_v04/base_ome_zarr_label_meta.json +50 -0
  62. ngio-0.2.0a1/tests/unit/common/test_dimensions.py +78 -0
  63. ngio-0.2.0a1/tests/unit/common/test_pyramid.py +27 -0
  64. ngio-0.2.0a1/tests/unit/common/test_roi.py +43 -0
  65. ngio-0.2.0a1/tests/unit/images/test_omezarr_container.py +95 -0
  66. ngio-0.2.0a1/tests/unit/tables/test_backends.py +197 -0
  67. ngio-0.2.0a1/tests/unit/tables/test_feature_table.py +24 -0
  68. ngio-0.2.0a1/tests/unit/tables/test_generic_table.py +24 -0
  69. ngio-0.2.0a1/tests/unit/tables/test_masking_roi_table_v1.py +60 -0
  70. ngio-0.2.0a1/tests/unit/tables/test_roi_table_v1.py +67 -0
  71. ngio-0.2.0a1/tests/unit/tables/test_table_group.py +9 -0
  72. ngio-0.2.0a1/tests/unit/tables/test_validators.py +53 -0
  73. ngio-0.2.0a1/tests/unit/test_ome_zarr_meta/test_image_handler.py +13 -0
  74. ngio-0.2.0a1/tests/unit/test_ome_zarr_meta/test_unit_ngio_specs.py +465 -0
  75. ngio-0.2.0a1/tests/unit/test_ome_zarr_meta/test_unit_v04_utils.py +41 -0
  76. ngio-0.2.0a1/tests/unit/utils/test_download_datasets.py +17 -0
  77. ngio-0.2.0a1/tests/unit/utils/test_zarr_utils.py +185 -0
  78. ngio-0.1.6/setup_data.sh +0 -9
  79. ngio-0.1.6/src/ngio/__init__.py +0 -15
  80. ngio-0.1.6/src/ngio/core/__init__.py +0 -7
  81. ngio-0.1.6/src/ngio/core/dimensions.py +0 -122
  82. ngio-0.1.6/src/ngio/core/image_handler.py +0 -228
  83. ngio-0.1.6/src/ngio/core/image_like_handler.py +0 -549
  84. ngio-0.1.6/src/ngio/core/label_handler.py +0 -410
  85. ngio-0.1.6/src/ngio/core/ngff_image.py +0 -387
  86. ngio-0.1.6/src/ngio/core/utils.py +0 -287
  87. ngio-0.1.6/src/ngio/io/__init__.py +0 -19
  88. ngio-0.1.6/src/ngio/io/_zarr.py +0 -88
  89. ngio-0.1.6/src/ngio/io/_zarr_array_utils.py +0 -0
  90. ngio-0.1.6/src/ngio/io/_zarr_group_utils.py +0 -60
  91. ngio-0.1.6/src/ngio/iterators/__init__.py +0 -1
  92. ngio-0.1.6/src/ngio/ngff_meta/__init__.py +0 -27
  93. ngio-0.1.6/src/ngio/ngff_meta/fractal_image_meta.py +0 -1267
  94. ngio-0.1.6/src/ngio/ngff_meta/meta_handler.py +0 -92
  95. ngio-0.1.6/src/ngio/ngff_meta/utils.py +0 -235
  96. ngio-0.1.6/src/ngio/ngff_meta/v04/__init__.py +0 -6
  97. ngio-0.1.6/src/ngio/ngff_meta/v04/specs.py +0 -158
  98. ngio-0.1.6/src/ngio/ngff_meta/v04/zarr_utils.py +0 -376
  99. ngio-0.1.6/src/ngio/pipes/__init__.py +0 -7
  100. ngio-0.1.6/src/ngio/pipes/_slicer_transforms.py +0 -176
  101. ngio-0.1.6/src/ngio/pipes/_transforms.py +0 -33
  102. ngio-0.1.6/src/ngio/pipes/data_pipe.py +0 -52
  103. ngio-0.1.6/src/ngio/tables/__init__.py +0 -11
  104. ngio-0.1.6/src/ngio/tables/_ad_reader.py +0 -80
  105. ngio-0.1.6/src/ngio/tables/_utils.py +0 -301
  106. ngio-0.1.6/src/ngio/tables/tables_group.py +0 -252
  107. ngio-0.1.6/src/ngio/tables/v1/__init__.py +0 -7
  108. ngio-0.1.6/src/ngio/tables/v1/_generic_table.py +0 -201
  109. ngio-0.1.6/src/ngio/tables/v1/feature_tables.py +0 -182
  110. ngio-0.1.6/src/ngio/tables/v1/masking_roi_tables.py +0 -243
  111. ngio-0.1.6/src/ngio/tables/v1/roi_tables.py +0 -285
  112. ngio-0.1.6/src/ngio/utils/__init__.py +0 -30
  113. ngio-0.1.6/src/ngio/utils/_common_types.py +0 -5
  114. ngio-0.1.6/src/ngio/utils/_pydantic_utils.py +0 -52
  115. ngio-0.1.6/tests/core/conftest.py +0 -50
  116. ngio-0.1.6/tests/core/test_image_handler.py +0 -31
  117. ngio-0.1.6/tests/core/test_image_like_handler.py +0 -74
  118. ngio-0.1.6/tests/core/test_label_handler.py +0 -30
  119. ngio-0.1.6/tests/core/test_ngff_image.py +0 -87
  120. ngio-0.1.6/tests/core/test_roi.py +0 -20
  121. ngio-0.1.6/tests/io/conftest.py +0 -66
  122. ngio-0.1.6/tests/io/test_zarr_group_utils.py +0 -28
  123. ngio-0.1.6/tests/ngff_meta/conftest.py +0 -44
  124. ngio-0.1.6/tests/ngff_meta/test_fractal_image_meta.py +0 -37
  125. ngio-0.1.6/tests/ngff_meta/test_pixel_size.py +0 -27
  126. ngio-0.1.6/tests/ngff_meta/test_utils.py +0 -121
  127. ngio-0.1.6/tests/ngff_meta/test_v04.py +0 -86
  128. ngio-0.1.6/tests/pipes/conftest.py +0 -46
  129. ngio-0.1.6/tests/pipes/test_zoom.py +0 -102
  130. ngio-0.1.6/tests/tables/conftest.py +0 -39
  131. ngio-0.1.6/tests/tables/test_table_conversion.py +0 -82
  132. ngio-0.1.6/tests/tables/test_table_group.py +0 -39
  133. ngio-0.1.6/tests/tables/test_v1_tables.py +0 -55
  134. ngio-0.1.6/tests/tables/test_validation.py +0 -53
  135. {ngio-0.1.6 → ngio-0.2.0a1}/.copier-answers.yml +0 -0
  136. {ngio-0.1.6 → ngio-0.2.0a1}/.gitattributes +0 -0
  137. {ngio-0.1.6 → ngio-0.2.0a1}/.github/ISSUE_TEMPLATE.md +0 -0
  138. {ngio-0.1.6 → ngio-0.2.0a1}/.github/TEST_FAIL_TEMPLATE.md +0 -0
  139. {ngio-0.1.6 → ngio-0.2.0a1}/.github/dependabot.yml +0 -0
  140. {ngio-0.1.6 → ngio-0.2.0a1}/LICENSE +0 -0
  141. {ngio-0.1.6 → ngio-0.2.0a1}/README.md +0 -0
  142. {ngio-0.1.6 → ngio-0.2.0a1}/_typos.toml +0 -0
  143. {ngio-0.1.6 → ngio-0.2.0a1}/docs/api/core.md +0 -0
  144. {ngio-0.1.6 → ngio-0.2.0a1}/docs/getting-started.md +0 -0
  145. {ngio-0.1.6 → ngio-0.2.0a1}/docs/index.md +0 -0
  146. {ngio-0.1.6 → ngio-0.2.0a1}/mkdocs.yml +0 -0
  147. {ngio-0.1.6 → ngio-0.2.0a1}/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 .[dev2]
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.10", "3.11", "3.12", "3.13"]
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
@@ -119,5 +119,13 @@ pixi.lock
119
119
  *.zarr
120
120
 
121
121
  # ignore data directory
122
- data/
123
- *.zip
122
+ ./data/
123
+ *.zip
124
+
125
+ src/ngio/_v01
126
+ tests/_v01
127
+
128
+ # Ignore locks
129
+ *.lock
130
+
131
+ benchmark/*
@@ -21,7 +21,7 @@ repos:
21
21
  args: [--force-exclude, --write-changes]
22
22
 
23
23
  - repo: https://github.com/charliermarsh/ruff-pre-commit
24
- rev: v0.4.8
24
+ rev: v0.9.6
25
25
  hooks:
26
26
  - id: ruff
27
27
  args: [--fix] # may also add '--unsafe-fixes'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngio
3
- Version: 0.1.6
3
+ Version: 0.2.0a1
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: >=3.10
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
- Provides-Extra: core
27
- Requires-Dist: dask-image; extra == 'core'
28
- Requires-Dist: dask[distributed]; extra == 'core'
29
- Requires-Dist: zarr<3; extra == 'core'
30
- Provides-Extra: dev2
31
- Requires-Dist: dask-image; extra == 'dev2'
32
- Requires-Dist: dask[distributed]; extra == 'dev2'
33
- Requires-Dist: ipython; extra == 'dev2'
34
- Requires-Dist: matplotlib; extra == 'dev2'
35
- Requires-Dist: mypy; extra == 'dev2'
36
- Requires-Dist: napari; extra == 'dev2'
37
- Requires-Dist: notebook; extra == 'dev2'
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 'NgffImage' class to explore and manage an OME-NGFF image.\n",
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
- "## NgffImage\n",
22
+ "## OmeZarr Container\n",
23
23
  "\n",
24
- "The `NgffImage` provides a high-level interface to read, write and manipulate NGFF images.\n",
25
- "A `NgffImage` can be created from a storelike object (e.g. a path to a directory, or a url) or from a `zarr.Group` object. "
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.core import NgffImage\n",
34
+ "from ngio import open_omezarr_container\n",
35
+ "from ngio.utils import download_ome_zarr_dataset\n",
35
36
  "\n",
36
- "# Ngio can stream data from any fsspec-compatible store\n",
37
- "path = \"../../data/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr/B/03/0\"\n",
38
- "ngff_image = NgffImage(path, \"r\")"
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 `ngff_image` object provides a high-level interface to read, write and manipulate OME-Zarr images.\n",
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(ngff_image)"
62
+ "print(omezarr_container)"
62
63
  ]
63
64
  },
64
65
  {
65
66
  "cell_type": "markdown",
66
67
  "metadata": {},
67
68
  "source": [
68
- "From the `NgffImage` object we can easily access access the image data (at any resolution level), the labels and the tables."
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.ngff_meta import PixelSize\n",
87
+ "from ngio import PixelSize\n",
87
88
  "\n",
88
89
  "# 1. Get image from highest resolution (default)\n",
89
- "image = ngff_image.get_image()\n",
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 = ngff_image.get_image(path=\"1\")\n",
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 = ngff_image.get_image(pixel_size=PixelSize(x=0.65, y=0.65, z=1))\n",
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: \", ngff_image.labels.list())\n",
158
+ "print(\"List of Labels: \", omezarr_container.list_labels())\n",
171
159
  "\n",
172
- "label_nuclei = ngff_image.labels.get_label(\"nuclei\", path=\"0\")\n",
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: \", ngff_image.tables.list())\n",
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 = ngff_image.tables.get_table(\"regionprops_DAPI\")\n",
210
- "feature_table.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 = ngff_image.tables.get_table(\"FOV_ROI_table\")\n",
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.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.get_roi(\"FOV_1\")\n",
245
- "roi_data = image.get_array_from_roi(roi, c=0, mode=\"numpy\")\n",
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
- "new_ngff_image = ngff_image.derive_new_image(\n",
271
- " \"../../data/new_ome.zarr\", name=\"new_image\"\n",
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 NgffImage over HTTP\n",
260
+ "## Steam an OmeZarr over HTTP\n",
281
261
  "\n",
282
- "The `NgffImage` 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 `NgffImage` class are available when streaming an image over HTTP (besides anything that requires writing to the image)."
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
- "from ngio.core.utils import get_fsspec_http_store\n",
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
- "# Ngio can stream data from any fsspec-compatible store\n",
294
- "url = \"https://raw.githubusercontent.com/fractal-analytics-platform/fractal-ome-zarr-examples/refs/heads/main/v04/20200812-CardiomyocyteDifferentiation14-Cycle1_B_03_mip.zarr/\"\n",
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
- "print(ngff_image)"
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": "ngio",
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.12.7"
311
+ "version": "3.11.11"
319
312
  }
320
313
  },
321
314
  "nbformat": 4,
@@ -18,10 +18,11 @@
18
18
  "import matplotlib.pyplot as plt\n",
19
19
  "\n",
20
20
  "from ngio.core.ngff_image import NgffImage\n",
21
+ "from ngio.utils import download_ome_zarr_dataset\n",
21
22
  "\n",
22
- "ngff_image = NgffImage(\n",
23
- " \"../../data/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr/B/03/0\"\n",
24
- ")"
23
+ "hcs_path = download_ome_zarr_dataset(\"CardiomyocyteSmallMip\")\n",
24
+ "image_path = hcs_path / \"B\" / \"03\" / \"0\"\n",
25
+ "ngff_image = NgffImage(image_path)"
25
26
  ]
26
27
  },
27
28
  {
@@ -317,11 +318,18 @@
317
318
  "\n",
318
319
  "feat_table.table"
319
320
  ]
321
+ },
322
+ {
323
+ "cell_type": "code",
324
+ "execution_count": null,
325
+ "metadata": {},
326
+ "outputs": [],
327
+ "source": []
320
328
  }
321
329
  ],
322
330
  "metadata": {
323
331
  "kernelspec": {
324
- "display_name": "ngio",
332
+ "display_name": "dev",
325
333
  "language": "python",
326
334
  "name": "python3"
327
335
  },
@@ -335,7 +343,7 @@
335
343
  "name": "python",
336
344
  "nbconvert_exporter": "python",
337
345
  "pygments_lexer": "ipython3",
338
- "version": "3.12.7"
346
+ "version": "3.11.11"
339
347
  }
340
348
  },
341
349
  "nbformat": 4,
@@ -36,10 +36,11 @@
36
36
  "import matplotlib.pyplot as plt\n",
37
37
  "\n",
38
38
  "from ngio.core import NgffImage\n",
39
+ "from ngio.utils import download_ome_zarr_dataset\n",
39
40
  "\n",
40
- "ngff_image = NgffImage(\n",
41
- " \"../../data/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr/B/03/0\"\n",
42
- ")"
41
+ "hcs_path = download_ome_zarr_dataset(\"CardiomyocyteTiny\")\n",
42
+ "image_path = hcs_path / \"B\" / \"03\" / \"0\"\n",
43
+ "ngff_image = NgffImage(image_path)"
43
44
  ]
44
45
  },
45
46
  {
@@ -56,7 +57,7 @@
56
57
  "outputs": [],
57
58
  "source": [
58
59
  "mip_ngff = ngff_image.derive_new_image(\n",
59
- " \"../../data/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr/B/03/0_mip\",\n",
60
+ " \"data/20200812-CardiomyocyteDifferentiation14-Cycle1.zarr/B/03/0_mip\",\n",
60
61
  " name=\"MIP\",\n",
61
62
  " on_disk_shape=(1, 1, 2160, 5120),\n",
62
63
  ")"
@@ -292,7 +293,7 @@
292
293
  ],
293
294
  "metadata": {
294
295
  "kernelspec": {
295
- "display_name": "dev2",
296
+ "display_name": "dev",
296
297
  "language": "python",
297
298
  "name": "python3"
298
299
  },
@@ -306,7 +307,7 @@
306
307
  "name": "python",
307
308
  "nbconvert_exporter": "python",
308
309
  "pygments_lexer": "ipython3",
309
- "version": "3.10.15"
310
+ "version": "3.11.11"
310
311
  }
311
312
  },
312
313
  "nbformat": 4,