ngio 0.2.0b3__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.
Files changed (206) hide show
  1. {ngio-0.2.0b3 → ngio-0.2.1}/PKG-INFO +8 -5
  2. {ngio-0.2.0b3 → ngio-0.2.1}/README.md +3 -4
  3. {ngio-0.2.0b3 → ngio-0.2.1}/_typos.toml +2 -1
  4. ngio-0.2.1/docs/api/common.md +6 -0
  5. ngio-0.2.1/docs/api/hcs.md +6 -0
  6. ngio-0.2.1/docs/api/images.md +6 -0
  7. ngio-0.2.1/docs/api/ngio.md +6 -0
  8. ngio-0.2.1/docs/api/tables.md +6 -0
  9. ngio-0.2.1/docs/api/utils.md +6 -0
  10. ngio-0.2.1/docs/code_of_conduct.md +2 -0
  11. ngio-0.2.1/docs/contributing.md +4 -0
  12. ngio-0.2.1/docs/getting_started/0_quickstart.md +99 -0
  13. ngio-0.2.1/docs/getting_started/1_ome_zarr_containers.md +181 -0
  14. ngio-0.2.1/docs/getting_started/2_images.md +200 -0
  15. ngio-0.2.1/docs/getting_started/3_tables.md +219 -0
  16. ngio-0.2.1/docs/getting_started/4_masked_images.md +148 -0
  17. ngio-0.2.1/docs/getting_started/5_hcs.md +164 -0
  18. ngio-0.2.1/docs/index.md +64 -0
  19. ngio-0.2.1/docs/tutorials/feature_extraction.ipynb +35 -0
  20. ngio-0.2.1/docs/tutorials/hcs_processing.ipynb +21 -0
  21. ngio-0.2.1/docs/tutorials/image_processing.ipynb +21 -0
  22. ngio-0.2.1/docs/tutorials/image_segmentation.ipynb +176 -0
  23. ngio-0.2.1/index.md +0 -0
  24. {ngio-0.2.0b3 → ngio-0.2.1}/mkdocs.yml +30 -8
  25. {ngio-0.2.0b3 → ngio-0.2.1}/pyproject.toml +4 -0
  26. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/__init__.py +11 -9
  27. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/__init__.py +3 -3
  28. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_array_pipe.py +7 -1
  29. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_masking_roi.py +4 -4
  30. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_roi.py +12 -12
  31. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/hcs/__init__.py +2 -2
  32. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/hcs/plate.py +86 -34
  33. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/images/__init__.py +7 -7
  34. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/images/abstract_image.py +20 -10
  35. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/images/create.py +4 -3
  36. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/images/image.py +2 -2
  37. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/images/label.py +10 -6
  38. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/images/masked_image.py +19 -5
  39. ngio-0.2.0b3/src/ngio/images/omezarr_container.py → ngio-0.2.1/src/ngio/images/ome_zarr_container.py +27 -30
  40. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/__init__.py +3 -0
  41. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/__init__.py +2 -0
  42. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +5 -4
  43. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +9 -13
  44. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/v04/_v04_spec_utils.py +1 -2
  45. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/__init__.py +2 -2
  46. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/tables_container.py +3 -3
  47. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/v1/__init__.py +2 -2
  48. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/v1/_feature_table.py +20 -1
  49. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/v1/_generic_table.py +10 -0
  50. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/v1/_roi_table.py +35 -13
  51. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/common/test_roi.py +4 -4
  52. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/hcs/test_plate.py +16 -16
  53. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/images/test_create.py +7 -7
  54. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/images/test_masked_images.py +9 -7
  55. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/images/test_omezarr_container.py +51 -49
  56. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_feature_table.py +4 -1
  57. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_generic_table.py +1 -0
  58. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_masking_roi_table_v1.py +8 -6
  59. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_roi_table_v1.py +5 -4
  60. ngio-0.2.0b3/docs/api/core.md +0 -3
  61. ngio-0.2.0b3/docs/getting-started.md +0 -34
  62. ngio-0.2.0b3/docs/index.md +0 -43
  63. ngio-0.2.0b3/docs/notebooks/basic_usage.ipynb +0 -351
  64. ngio-0.2.0b3/docs/notebooks/image.ipynb +0 -359
  65. ngio-0.2.0b3/docs/notebooks/processing.ipynb +0 -321
  66. {ngio-0.2.0b3 → ngio-0.2.1}/.copier-answers.yml +0 -0
  67. {ngio-0.2.0b3 → ngio-0.2.1}/.gitattributes +0 -0
  68. {ngio-0.2.0b3 → ngio-0.2.1}/.github/ISSUE_TEMPLATE.md +0 -0
  69. {ngio-0.2.0b3 → ngio-0.2.1}/.github/TEST_FAIL_TEMPLATE.md +0 -0
  70. {ngio-0.2.0b3 → ngio-0.2.1}/.github/dependabot.yml +0 -0
  71. {ngio-0.2.0b3 → ngio-0.2.1}/.github/scripts/download_data.sh +0 -0
  72. {ngio-0.2.0b3 → ngio-0.2.1}/.github/workflows/build_docs.yml +0 -0
  73. {ngio-0.2.0b3 → ngio-0.2.1}/.github/workflows/ci.yml +0 -0
  74. {ngio-0.2.0b3 → ngio-0.2.1}/.gitignore +0 -0
  75. {ngio-0.2.0b3 → ngio-0.2.1}/.pre-commit-config.yaml +0 -0
  76. {ngio-0.2.0b3 → ngio-0.2.1}/LICENSE +0 -0
  77. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_axes_transforms.py +0 -0
  78. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_common_types.py +0 -0
  79. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_dimensions.py +0 -0
  80. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_pyramid.py +0 -0
  81. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_slicer.py +0 -0
  82. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/common/_zoom.py +0 -0
  83. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/_meta_handlers.py +0 -0
  84. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_axes.py +0 -0
  85. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_channels.py +0 -0
  86. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_dataset.py +0 -0
  87. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/ngio_specs/_pixel_size.py +0 -0
  88. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/ome_zarr_meta/v04/__init__.py +0 -0
  89. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/_validators.py +0 -0
  90. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/backends/__init__.py +0 -0
  91. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/backends/_abstract_backend.py +0 -0
  92. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/backends/_anndata_utils.py +0 -0
  93. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/backends/_anndata_v1.py +0 -0
  94. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/backends/_json_v1.py +0 -0
  95. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/tables/backends/_table_backends.py +0 -0
  96. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/utils/__init__.py +0 -0
  97. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/utils/_datasets.py +0 -0
  98. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/utils/_errors.py +0 -0
  99. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/utils/_fractal_fsspec_store.py +0 -0
  100. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/utils/_logger.py +0 -0
  101. {ngio-0.2.0b3 → ngio-0.2.1}/src/ngio/utils/_zarr_utils.py +0 -0
  102. {ngio-0.2.0b3 → ngio-0.2.1}/tests/conftest.py +0 -0
  103. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/.zattrs +0 -0
  104. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/.zgroup +0 -0
  105. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/0/.zarray +0 -0
  106. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/1/.zarray +0 -0
  107. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/.zattrs +0 -0
  108. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/.zgroup +0 -0
  109. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/.zattrs +0 -0
  110. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/.zgroup +0 -0
  111. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/0/.zarray +0 -0
  112. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_c1yx.zarr/labels/label/1/.zarray +0 -0
  113. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/.zattrs +0 -0
  114. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/.zgroup +0 -0
  115. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/0/.zarray +0 -0
  116. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/1/.zarray +0 -0
  117. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/.zattrs +0 -0
  118. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/.zgroup +0 -0
  119. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/.zattrs +0 -0
  120. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/.zgroup +0 -0
  121. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/0/.zarray +0 -0
  122. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_cyx.zarr/labels/label/1/.zarray +0 -0
  123. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/.zattrs +0 -0
  124. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/.zgroup +0 -0
  125. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/0/.zarray +0 -0
  126. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/1/.zarray +0 -0
  127. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/.zattrs +0 -0
  128. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/.zgroup +0 -0
  129. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/.zattrs +0 -0
  130. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/.zgroup +0 -0
  131. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/0/.zarray +0 -0
  132. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_czyx.zarr/labels/label/1/.zarray +0 -0
  133. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/.zattrs +0 -0
  134. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/.zgroup +0 -0
  135. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/0/.zarray +0 -0
  136. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/1/.zarray +0 -0
  137. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/.zattrs +0 -0
  138. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/.zgroup +0 -0
  139. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/.zattrs +0 -0
  140. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/.zgroup +0 -0
  141. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/0/.zarray +0 -0
  142. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tcyx.zarr/labels/label/1/.zarray +0 -0
  143. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/.zattrs +0 -0
  144. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/.zgroup +0 -0
  145. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/0/.zarray +0 -0
  146. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/1/.zarray +0 -0
  147. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/.zattrs +0 -0
  148. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/.zgroup +0 -0
  149. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/.zattrs +0 -0
  150. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/.zgroup +0 -0
  151. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/0/.zarray +0 -0
  152. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tczyx.zarr/labels/label/1/.zarray +0 -0
  153. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/.zattrs +0 -0
  154. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/.zgroup +0 -0
  155. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/0/.zarray +0 -0
  156. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/1/.zarray +0 -0
  157. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/.zattrs +0 -0
  158. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/.zgroup +0 -0
  159. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/.zattrs +0 -0
  160. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/.zgroup +0 -0
  161. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/0/.zarray +0 -0
  162. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tyx.zarr/labels/label/1/.zarray +0 -0
  163. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/.zattrs +0 -0
  164. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/.zgroup +0 -0
  165. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/0/.zarray +0 -0
  166. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/1/.zarray +0 -0
  167. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/.zattrs +0 -0
  168. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/.zgroup +0 -0
  169. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/.zattrs +0 -0
  170. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/.zgroup +0 -0
  171. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/0/.zarray +0 -0
  172. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_tzyx.zarr/labels/label/1/.zarray +0 -0
  173. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/.zattrs +0 -0
  174. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/.zgroup +0 -0
  175. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/0/.zarray +0 -0
  176. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/1/.zarray +0 -0
  177. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/.zattrs +0 -0
  178. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/.zgroup +0 -0
  179. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/.zattrs +0 -0
  180. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/.zgroup +0 -0
  181. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/0/.zarray +0 -0
  182. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_yx.zarr/labels/label/1/.zarray +0 -0
  183. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/.zattrs +0 -0
  184. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/.zgroup +0 -0
  185. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/0/.zarray +0 -0
  186. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/1/.zarray +0 -0
  187. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/.zattrs +0 -0
  188. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/.zgroup +0 -0
  189. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/.zattrs +0 -0
  190. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/.zgroup +0 -0
  191. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/0/.zarray +0 -0
  192. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/images/test_image_zyx.zarr/labels/label/1/.zarray +0 -0
  193. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/meta/base_ome_zarr_image_meta.json +0 -0
  194. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/meta/base_ome_zarr_image_meta_wrong_axis_order.json +0 -0
  195. {ngio-0.2.0b3 → ngio-0.2.1}/tests/data/v04/meta/base_ome_zarr_label_meta.json +0 -0
  196. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/common/test_dimensions.py +0 -0
  197. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/common/test_pyramid.py +0 -0
  198. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/images/test_images.py +0 -0
  199. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_backends.py +0 -0
  200. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_table_group.py +0 -0
  201. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/tables/test_validators.py +0 -0
  202. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/test_ome_zarr_meta/test_image_handler.py +0 -0
  203. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/test_ome_zarr_meta/test_unit_ngio_specs.py +0 -0
  204. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/test_ome_zarr_meta/test_unit_v04_utils.py +0 -0
  205. {ngio-0.2.0b3 → ngio-0.2.1}/tests/unit/utils/test_download_datasets.py +0 -0
  206. {ngio-0.2.0b3 → 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.0b3
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'
@@ -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
- - Powefull iterators for processing data using common access patterns
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
- - Validate OME-Zarr files
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,10 +95,9 @@ 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 ome-zarr from fractal |
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 |
98
102
  | Full Documentation | Not started | 2025 | Complete Documentation |
99
103
  | Release 1.0 (Commitment to API) | Not started | 2025 | API is stable; breaking changes will be avoided |
100
-
@@ -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
- - Powefull iterators for processing data using common access patterns
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
- - Validate OME-Zarr files
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,10 +33,9 @@ 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 ome-zarr from fractal |
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 |
40
40
  | Full Documentation | Not started | 2025 | Complete Documentation |
41
41
  | Release 1.0 (Commitment to API) | Not started | 2025 | API is stable; breaking changes will be avoided |
42
-
@@ -1,3 +1,4 @@
1
1
  [default.extend-words]
2
2
  # Don't correct the surname "Teh"
3
- OME = "OME"
3
+ OME = "OME"
4
+ FO = "FO"
@@ -0,0 +1,6 @@
1
+ # ngio.common API documentation
2
+
3
+ !!! warning
4
+ Coming soon, ngio API documentation is not yet available.
5
+ If you have any questions please reach out to us on GitHub or via email.
6
+ We are happy to help you with any questions or issues you may have.
@@ -0,0 +1,6 @@
1
+ # ngio.hcs API documentation
2
+
3
+ !!! warning
4
+ Coming soon, ngio API documentation is not yet available.
5
+ If you have any questions please reach out to us on GitHub or via email.
6
+ We are happy to help you with any questions or issues you may have.
@@ -0,0 +1,6 @@
1
+ # ngio.images API documentation
2
+
3
+ !!! warning
4
+ Coming soon, ngio API documentation is not yet available.
5
+ If you have any questions please reach out to us on GitHub or via email.
6
+ We are happy to help you with any questions or issues you may have.
@@ -0,0 +1,6 @@
1
+ # ngio API documentation
2
+
3
+ !!! warning
4
+ Coming soon, ngio API documentation is not yet available.
5
+ If you have any questions please reach out to us on GitHub or via email.
6
+ We are happy to help you with any questions or issues you may have.
@@ -0,0 +1,6 @@
1
+ # ngio.tables API documentation
2
+
3
+ !!! warning
4
+ Coming soon, ngio API documentation is not yet available.
5
+ If you have any questions please reach out to us on GitHub or via email.
6
+ We are happy to help you with any questions or issues you may have.
@@ -0,0 +1,6 @@
1
+ # ngio.utils
2
+
3
+ !!! warning
4
+ Coming soon, ngio API documentation is not yet available.
5
+ If you have any questions please reach out to us on GitHub or via email.
6
+ We are happy to help you with any questions or issues you may have.
@@ -0,0 +1,2 @@
1
+ !!! warning
2
+ The library is still in the early stages of development, the code of conduct is not yet established.
@@ -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).