ngio 0.3.5__py3-none-any.whl → 0.4.0__py3-none-any.whl

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 (73) hide show
  1. ngio/__init__.py +7 -2
  2. ngio/common/__init__.py +5 -52
  3. ngio/common/_dimensions.py +270 -55
  4. ngio/common/_masking_roi.py +38 -10
  5. ngio/common/_pyramid.py +51 -30
  6. ngio/common/_roi.py +269 -82
  7. ngio/common/_synt_images_utils.py +101 -0
  8. ngio/common/_zoom.py +49 -19
  9. ngio/experimental/__init__.py +5 -0
  10. ngio/experimental/iterators/__init__.py +15 -0
  11. ngio/experimental/iterators/_abstract_iterator.py +390 -0
  12. ngio/experimental/iterators/_feature.py +189 -0
  13. ngio/experimental/iterators/_image_processing.py +130 -0
  14. ngio/experimental/iterators/_mappers.py +48 -0
  15. ngio/experimental/iterators/_rois_utils.py +127 -0
  16. ngio/experimental/iterators/_segmentation.py +235 -0
  17. ngio/hcs/_plate.py +41 -36
  18. ngio/images/__init__.py +22 -1
  19. ngio/images/_abstract_image.py +403 -176
  20. ngio/images/_create.py +31 -15
  21. ngio/images/_create_synt_container.py +138 -0
  22. ngio/images/_image.py +452 -63
  23. ngio/images/_label.py +56 -30
  24. ngio/images/_masked_image.py +387 -129
  25. ngio/images/_ome_zarr_container.py +237 -67
  26. ngio/{common → images}/_table_ops.py +41 -41
  27. ngio/io_pipes/__init__.py +75 -0
  28. ngio/io_pipes/_io_pipes.py +361 -0
  29. ngio/io_pipes/_io_pipes_masked.py +488 -0
  30. ngio/io_pipes/_io_pipes_roi.py +152 -0
  31. ngio/io_pipes/_io_pipes_types.py +56 -0
  32. ngio/io_pipes/_match_shape.py +376 -0
  33. ngio/io_pipes/_ops_axes.py +344 -0
  34. ngio/io_pipes/_ops_slices.py +446 -0
  35. ngio/io_pipes/_ops_slices_utils.py +196 -0
  36. ngio/io_pipes/_ops_transforms.py +104 -0
  37. ngio/io_pipes/_zoom_transform.py +175 -0
  38. ngio/ome_zarr_meta/__init__.py +4 -2
  39. ngio/ome_zarr_meta/ngio_specs/__init__.py +4 -10
  40. ngio/ome_zarr_meta/ngio_specs/_axes.py +186 -175
  41. ngio/ome_zarr_meta/ngio_specs/_channels.py +55 -18
  42. ngio/ome_zarr_meta/ngio_specs/_dataset.py +48 -122
  43. ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +3 -3
  44. ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +38 -87
  45. ngio/ome_zarr_meta/ngio_specs/_pixel_size.py +17 -1
  46. ngio/ome_zarr_meta/v04/_v04_spec_utils.py +34 -31
  47. ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/mask.png +0 -0
  48. ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/nuclei.png +0 -0
  49. ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/raw.jpg +0 -0
  50. ngio/resources/__init__.py +55 -0
  51. ngio/resources/resource_model.py +36 -0
  52. ngio/tables/backends/_abstract_backend.py +5 -6
  53. ngio/tables/backends/_anndata.py +1 -1
  54. ngio/tables/backends/_anndata_utils.py +3 -3
  55. ngio/tables/backends/_non_zarr_backends.py +1 -1
  56. ngio/tables/backends/_table_backends.py +0 -1
  57. ngio/tables/backends/_utils.py +3 -3
  58. ngio/tables/v1/_roi_table.py +165 -70
  59. ngio/transforms/__init__.py +5 -0
  60. ngio/transforms/_zoom.py +19 -0
  61. ngio/utils/__init__.py +2 -3
  62. ngio/utils/_datasets.py +5 -0
  63. ngio/utils/_logger.py +19 -0
  64. ngio/utils/_zarr_utils.py +6 -6
  65. {ngio-0.3.5.dist-info → ngio-0.4.0.dist-info}/METADATA +16 -14
  66. ngio-0.4.0.dist-info/RECORD +85 -0
  67. ngio/common/_array_pipe.py +0 -288
  68. ngio/common/_axes_transforms.py +0 -64
  69. ngio/common/_common_types.py +0 -5
  70. ngio/common/_slicer.py +0 -96
  71. ngio-0.3.5.dist-info/RECORD +0 -61
  72. {ngio-0.3.5.dist-info → ngio-0.4.0.dist-info}/WHEEL +0 -0
  73. {ngio-0.3.5.dist-info → ngio-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,235 @@
1
+ from collections.abc import Sequence
2
+
3
+ import dask.array as da
4
+ import numpy as np
5
+
6
+ from ngio.common import Roi
7
+ from ngio.experimental.iterators._abstract_iterator import AbstractIteratorBuilder
8
+ from ngio.images import Image, Label
9
+ from ngio.images._image import (
10
+ ChannelSlicingInputType,
11
+ add_channel_selection_to_slicing_dict,
12
+ )
13
+ from ngio.images._masked_image import MaskedImage
14
+ from ngio.io_pipes import (
15
+ DaskGetterMasked,
16
+ DaskRoiGetter,
17
+ DaskRoiSetter,
18
+ DaskSetterMasked,
19
+ NumpyGetterMasked,
20
+ NumpyRoiGetter,
21
+ NumpyRoiSetter,
22
+ NumpySetterMasked,
23
+ TransformProtocol,
24
+ )
25
+ from ngio.io_pipes._io_pipes_types import DataGetterProtocol, DataSetterProtocol
26
+
27
+
28
+ class SegmentationIterator(AbstractIteratorBuilder[np.ndarray, da.Array]):
29
+ """Base class for iterators over ROIs."""
30
+
31
+ def __init__(
32
+ self,
33
+ input_image: Image,
34
+ output_label: Label,
35
+ channel_selection: ChannelSlicingInputType = None,
36
+ axes_order: Sequence[str] | None = None,
37
+ input_transforms: Sequence[TransformProtocol] | None = None,
38
+ output_transforms: Sequence[TransformProtocol] | None = None,
39
+ ) -> None:
40
+ """Initialize the iterator with a ROI table and input/output images.
41
+
42
+ Args:
43
+ input_image (Image): The input image to be used as input for the
44
+ segmentation.
45
+ output_label (Label): The label image where the ROIs will be written.
46
+ channel_selection (ChannelSlicingInputType): Optional
47
+ selection of channels to use for the segmentation.
48
+ axes_order (Sequence[str] | None): Optional axes order for the
49
+ segmentation.
50
+ input_transforms (Sequence[TransformProtocol] | None): Optional
51
+ transforms to apply to the input image.
52
+ output_transforms (Sequence[TransformProtocol] | None): Optional
53
+ transforms to apply to the output label.
54
+ """
55
+ self._input = input_image
56
+ self._output = output_label
57
+ self._ref_image = input_image
58
+ self._rois = input_image.build_image_roi_table(name=None).rois()
59
+
60
+ # Set iteration parameters
61
+ self._input_slicing_kwargs = add_channel_selection_to_slicing_dict(
62
+ image=self._input, channel_selection=channel_selection, slicing_dict={}
63
+ )
64
+ self._channel_selection = channel_selection
65
+ self._axes_order = axes_order
66
+ self._input_transforms = input_transforms
67
+ self._output_transforms = output_transforms
68
+
69
+ self._input.require_dimensions_match(self._output, allow_singleton=False)
70
+
71
+ def get_init_kwargs(self) -> dict:
72
+ """Return the initialization arguments for the iterator."""
73
+ return {
74
+ "input_image": self._input,
75
+ "output_label": self._output,
76
+ "channel_selection": self._channel_selection,
77
+ "axes_order": self._axes_order,
78
+ "input_transforms": self._input_transforms,
79
+ "output_transforms": self._output_transforms,
80
+ }
81
+
82
+ def build_numpy_getter(self, roi: Roi) -> DataGetterProtocol[np.ndarray]:
83
+ return NumpyRoiGetter(
84
+ zarr_array=self._input.zarr_array,
85
+ dimensions=self._input.dimensions,
86
+ roi=roi,
87
+ axes_order=self._axes_order,
88
+ transforms=self._input_transforms,
89
+ slicing_dict=self._input_slicing_kwargs,
90
+ )
91
+
92
+ def build_numpy_setter(self, roi: Roi) -> DataSetterProtocol[np.ndarray]:
93
+ return NumpyRoiSetter(
94
+ zarr_array=self._output.zarr_array,
95
+ dimensions=self._output.dimensions,
96
+ roi=roi,
97
+ axes_order=self._axes_order,
98
+ transforms=self._output_transforms,
99
+ remove_channel_selection=True,
100
+ )
101
+
102
+ def build_dask_getter(self, roi: Roi) -> DataGetterProtocol[da.Array]:
103
+ return DaskRoiGetter(
104
+ zarr_array=self._input.zarr_array,
105
+ dimensions=self._input.dimensions,
106
+ roi=roi,
107
+ axes_order=self._axes_order,
108
+ transforms=self._input_transforms,
109
+ slicing_dict=self._input_slicing_kwargs,
110
+ )
111
+
112
+ def build_dask_setter(self, roi: Roi) -> DataSetterProtocol[da.Array]:
113
+ return DaskRoiSetter(
114
+ zarr_array=self._output.zarr_array,
115
+ dimensions=self._output.dimensions,
116
+ roi=roi,
117
+ axes_order=self._axes_order,
118
+ transforms=self._output_transforms,
119
+ remove_channel_selection=True,
120
+ )
121
+
122
+ def post_consolidate(self):
123
+ self._output.consolidate()
124
+
125
+
126
+ class MaskedSegmentationIterator(SegmentationIterator):
127
+ """Base class for iterators over ROIs."""
128
+
129
+ def __init__(
130
+ self,
131
+ input_image: MaskedImage,
132
+ output_label: Label,
133
+ channel_selection: ChannelSlicingInputType = None,
134
+ axes_order: Sequence[str] | None = None,
135
+ input_transforms: Sequence[TransformProtocol] | None = None,
136
+ output_transforms: Sequence[TransformProtocol] | None = None,
137
+ ) -> None:
138
+ """Initialize the iterator with a ROI table and input/output images.
139
+
140
+ Args:
141
+ input_image (MaskedImage): The input image to be used as input for the
142
+ segmentation.
143
+ output_label (Label): The label image where the ROIs will be written.
144
+ channel_selection (ChannelSlicingInputType): Optional
145
+ selection of channels to use for the segmentation.
146
+ axes_order (Sequence[str] | None): Optional axes order for the
147
+ segmentation.
148
+ input_transforms (Sequence[TransformProtocol] | None): Optional
149
+ transforms to apply to the input image.
150
+ output_transforms (Sequence[TransformProtocol] | None): Optional
151
+ transforms to apply to the output label.
152
+ """
153
+ self._input = input_image
154
+ self._output = output_label
155
+
156
+ self._ref_image = input_image
157
+ self._set_rois(input_image._masking_roi_table.rois())
158
+
159
+ # Set iteration parameters
160
+ self._input_slicing_kwargs = add_channel_selection_to_slicing_dict(
161
+ image=self._input, channel_selection=channel_selection, slicing_dict={}
162
+ )
163
+ self._channel_selection = channel_selection
164
+ self._axes_order = axes_order
165
+ self._input_transforms = input_transforms
166
+ self._output_transforms = output_transforms
167
+
168
+ # Check compatibility between input and output images
169
+ # if not self._input.dimensions.is_compatible_with(self._output.dimensions):
170
+ # raise NgioValidationError(
171
+ # "Input image and output label have incompatible dimensions. "
172
+ # f"Input: {self._input.dimensions}, Output: {self._output.dimensions}."
173
+ # )
174
+
175
+ def get_init_kwargs(self) -> dict:
176
+ """Return the initialization arguments for the iterator."""
177
+ return {
178
+ "input_image": self._input,
179
+ "output_label": self._output,
180
+ "channel_selection": self._channel_selection,
181
+ "axes_order": self._axes_order,
182
+ "input_transforms": self._input_transforms,
183
+ "output_transforms": self._output_transforms,
184
+ }
185
+
186
+ def build_numpy_getter(self, roi: Roi):
187
+ return NumpyGetterMasked(
188
+ zarr_array=self._input.zarr_array,
189
+ dimensions=self._input.dimensions,
190
+ roi=roi,
191
+ label_zarr_array=self._input._label.zarr_array,
192
+ label_dimensions=self._input._label.dimensions,
193
+ axes_order=self._axes_order,
194
+ transforms=self._input_transforms,
195
+ slicing_dict=self._input_slicing_kwargs,
196
+ )
197
+
198
+ def build_numpy_setter(self, roi: Roi):
199
+ return NumpySetterMasked(
200
+ roi=roi,
201
+ zarr_array=self._output.zarr_array,
202
+ dimensions=self._output.dimensions,
203
+ label_zarr_array=self._input._label.zarr_array,
204
+ label_dimensions=self._input._label.dimensions,
205
+ axes_order=self._axes_order,
206
+ transforms=self._output_transforms,
207
+ remove_channel_selection=True,
208
+ )
209
+
210
+ def build_dask_getter(self, roi: Roi):
211
+ return DaskGetterMasked(
212
+ roi=roi,
213
+ zarr_array=self._input.zarr_array,
214
+ dimensions=self._input.dimensions,
215
+ label_zarr_array=self._input._label.zarr_array,
216
+ label_dimensions=self._input._label.dimensions,
217
+ axes_order=self._axes_order,
218
+ transforms=self._input_transforms,
219
+ slicing_dict=self._input_slicing_kwargs,
220
+ )
221
+
222
+ def build_dask_setter(self, roi: Roi):
223
+ return DaskSetterMasked(
224
+ roi=roi,
225
+ zarr_array=self._output.zarr_array,
226
+ dimensions=self._output.dimensions,
227
+ label_zarr_array=self._input._label.zarr_array,
228
+ label_dimensions=self._input._label.dimensions,
229
+ axes_order=self._axes_order,
230
+ transforms=self._output_transforms,
231
+ remove_channel_selection=True,
232
+ )
233
+
234
+ def post_consolidate(self):
235
+ self._output.consolidate()
ngio/hcs/_plate.py CHANGED
@@ -1,11 +1,12 @@
1
- """A module for handling the Plate Collection in an OME-Zarr file."""
1
+ """A module for handling the Plate Sequence in an OME-Zarr file."""
2
2
 
3
3
  import asyncio
4
4
  import warnings
5
- from collections.abc import Collection
5
+ from collections.abc import Sequence
6
6
  from typing import Literal
7
7
 
8
- from ngio.common import (
8
+ from ngio.images import (
9
+ OmeZarrContainer,
9
10
  concatenate_image_tables,
10
11
  concatenate_image_tables_as,
11
12
  concatenate_image_tables_as_async,
@@ -13,7 +14,6 @@ from ngio.common import (
13
14
  list_image_tables,
14
15
  list_image_tables_async,
15
16
  )
16
- from ngio.images import OmeZarrContainer
17
17
  from ngio.ome_zarr_meta import (
18
18
  ImageInWellPath,
19
19
  NgffVersions,
@@ -67,7 +67,7 @@ class MockLock:
67
67
 
68
68
 
69
69
  class OmeZarrWell:
70
- """A class to handle the Well Collection in an OME-Zarr file."""
70
+ """A class to handle the Well Sequence in an OME-Zarr file."""
71
71
 
72
72
  def __init__(self, group_handler: ZarrGroupHandler) -> None:
73
73
  """Initialize the LabelGroupHandler.
@@ -190,7 +190,7 @@ class OmeZarrWell:
190
190
  acquisition_id (int | None): The acquisition id to filter the images.
191
191
  strict (bool): Whether to check if the acquisition id is already exists
192
192
  in the well. Defaults to True. If False this might lead to
193
- acquision in a well that does not exist at the plate level.
193
+ acquisition in a well that does not exist at the plate level.
194
194
  """
195
195
  return self._add_image(
196
196
  image_path=image_path,
@@ -200,11 +200,11 @@ class OmeZarrWell:
200
200
  )
201
201
 
202
202
 
203
- def _build_extras(paths: Collection[str]) -> list[dict[str, str]]:
203
+ def _build_extras(paths: Sequence[str]) -> list[dict[str, str]]:
204
204
  """Build the extras for the images.
205
205
 
206
206
  Args:
207
- paths (Collection[str]): The paths of the images.
207
+ paths (Sequence[str]): The paths of the images.
208
208
 
209
209
  Returns:
210
210
  list[dict[str, str]]: The extras for the images.
@@ -223,7 +223,7 @@ def _build_extras(paths: Collection[str]) -> list[dict[str, str]]:
223
223
 
224
224
 
225
225
  class OmeZarrPlate:
226
- """A class to handle the Plate Collection in an OME-Zarr file."""
226
+ """A class to handle the Plate Sequence in an OME-Zarr file."""
227
227
 
228
228
  def __init__(
229
229
  self,
@@ -382,7 +382,8 @@ class OmeZarrPlate:
382
382
  """
383
383
  wells = self._group_handler.get_from_cache("wells")
384
384
  if wells is not None:
385
- return wells # type: ignore[return-value]
385
+ assert isinstance(wells, dict)
386
+ return wells
386
387
 
387
388
  def process_well(well_path):
388
389
  group_handler = self._group_handler.derive_handler(well_path)
@@ -410,7 +411,8 @@ class OmeZarrPlate:
410
411
  """
411
412
  wells = self._group_handler.get_from_cache("wells")
412
413
  if wells is not None:
413
- return wells # type: ignore[return-value]
414
+ assert isinstance(wells, dict)
415
+ return wells
414
416
 
415
417
  def process_well(well_path):
416
418
  group_handler = self._group_handler.derive_handler(well_path)
@@ -442,7 +444,8 @@ class OmeZarrPlate:
442
444
  """
443
445
  images = self._group_handler.get_from_cache("images")
444
446
  if images is not None:
445
- return images # type: ignore[return-value]
447
+ assert isinstance(images, dict)
448
+ return images
446
449
 
447
450
  paths = await self.images_paths_async(acquisition=acquisition)
448
451
 
@@ -473,7 +476,8 @@ class OmeZarrPlate:
473
476
  """
474
477
  images = self._group_handler.get_from_cache("images")
475
478
  if images is not None:
476
- return images # type: ignore[return-value]
479
+ assert isinstance(images, dict)
480
+ return images
477
481
  paths = self.images_paths(acquisition=acquisition)
478
482
 
479
483
  def process_image(image_path):
@@ -969,9 +973,9 @@ class OmeZarrPlate:
969
973
  If 'common', return only common tables between all images.
970
974
  If 'all', return all tables. Defaults to 'common'.
971
975
  """
972
- images = self.get_images(acquisition=acquisition)
976
+ images = tuple(self.get_images(acquisition=acquisition).values())
973
977
  return list_image_tables(
974
- images=images.values(),
978
+ images=images,
975
979
  filter_types=filter_types,
976
980
  mode=mode,
977
981
  )
@@ -993,15 +997,16 @@ class OmeZarrPlate:
993
997
  If 'all', return all tables. Defaults to 'common'.
994
998
  """
995
999
  images = await self.get_images_async(acquisition=acquisition)
1000
+ images = tuple(images.values())
996
1001
  return await list_image_tables_async(
997
- images=images.values(),
1002
+ images=images,
998
1003
  filter_types=filter_types,
999
1004
  mode=mode,
1000
1005
  )
1001
1006
 
1002
1007
  def concatenate_image_tables(
1003
1008
  self,
1004
- table_name: str,
1009
+ name: str,
1005
1010
  acquisition: int | None = None,
1006
1011
  strict: bool = True,
1007
1012
  index_key: str | None = None,
@@ -1010,7 +1015,7 @@ class OmeZarrPlate:
1010
1015
  """Concatenate tables from all images in the plate.
1011
1016
 
1012
1017
  Args:
1013
- table_name: The name of the table to concatenate.
1018
+ name: The name of the table to concatenate.
1014
1019
  index_key: The key to use for the index of the concatenated table.
1015
1020
  acquisition: The acquisition id to filter the images.
1016
1021
  strict: If True, raise an error if the table is not found in the image.
@@ -1021,11 +1026,11 @@ class OmeZarrPlate:
1021
1026
  if 'lazy', the table will be loaded as a lazy frame.
1022
1027
  """
1023
1028
  images = self.get_images(acquisition=acquisition)
1024
- extras = _build_extras(images.keys())
1029
+ extras = _build_extras(tuple(images.keys()))
1025
1030
  return concatenate_image_tables(
1026
- images=images.values(),
1031
+ images=tuple(images.values()),
1027
1032
  extras=extras,
1028
- table_name=table_name,
1033
+ name=name,
1029
1034
  index_key=index_key,
1030
1035
  strict=strict,
1031
1036
  mode=mode,
@@ -1033,7 +1038,7 @@ class OmeZarrPlate:
1033
1038
 
1034
1039
  def concatenate_image_tables_as(
1035
1040
  self,
1036
- table_name: str,
1041
+ name: str,
1037
1042
  table_cls: type[TableType],
1038
1043
  acquisition: int | None = None,
1039
1044
  index_key: str | None = None,
@@ -1043,7 +1048,7 @@ class OmeZarrPlate:
1043
1048
  """Concatenate tables from all images in the plate as a specific type.
1044
1049
 
1045
1050
  Args:
1046
- table_name: The name of the table to concatenate.
1051
+ name: The name of the table to concatenate.
1047
1052
  table_cls: The type of the table to concatenate.
1048
1053
  index_key: The key to use for the index of the concatenated table.
1049
1054
  acquisition: The acquisition id to filter the images.
@@ -1055,11 +1060,11 @@ class OmeZarrPlate:
1055
1060
  if 'lazy', the table will be loaded as a lazy frame.
1056
1061
  """
1057
1062
  images = self.get_images(acquisition=acquisition)
1058
- extras = _build_extras(images.keys())
1063
+ extras = _build_extras(tuple(images.keys()))
1059
1064
  return concatenate_image_tables_as(
1060
- images=images.values(),
1065
+ images=tuple(images.values()),
1061
1066
  extras=extras,
1062
- table_name=table_name,
1067
+ name=name,
1063
1068
  table_cls=table_cls,
1064
1069
  index_key=index_key,
1065
1070
  strict=strict,
@@ -1068,7 +1073,7 @@ class OmeZarrPlate:
1068
1073
 
1069
1074
  async def concatenate_image_tables_async(
1070
1075
  self,
1071
- table_name: str,
1076
+ name: str,
1072
1077
  acquisition: int | None = None,
1073
1078
  index_key: str | None = None,
1074
1079
  strict: bool = True,
@@ -1077,7 +1082,7 @@ class OmeZarrPlate:
1077
1082
  """Concatenate tables from all images in the plate asynchronously.
1078
1083
 
1079
1084
  Args:
1080
- table_name: The name of the table to concatenate.
1085
+ name: The name of the table to concatenate.
1081
1086
  index_key: The key to use for the index of the concatenated table.
1082
1087
  acquisition: The acquisition id to filter the images.
1083
1088
  index_key: If a string is provided, a new index column will be created
@@ -1088,11 +1093,11 @@ class OmeZarrPlate:
1088
1093
  if 'lazy', the table will be loaded as a lazy frame.
1089
1094
  """
1090
1095
  images = await self.get_images_async(acquisition=acquisition)
1091
- extras = _build_extras(images.keys())
1096
+ extras = _build_extras(tuple(images.keys()))
1092
1097
  return await concatenate_image_tables_async(
1093
- images=images.values(),
1098
+ images=tuple(images.values()),
1094
1099
  extras=extras,
1095
- table_name=table_name,
1100
+ name=name,
1096
1101
  index_key=index_key,
1097
1102
  strict=strict,
1098
1103
  mode=mode,
@@ -1100,7 +1105,7 @@ class OmeZarrPlate:
1100
1105
 
1101
1106
  async def concatenate_image_tables_as_async(
1102
1107
  self,
1103
- table_name: str,
1108
+ name: str,
1104
1109
  table_cls: type[TableType],
1105
1110
  acquisition: int | None = None,
1106
1111
  index_key: str | None = None,
@@ -1110,7 +1115,7 @@ class OmeZarrPlate:
1110
1115
  """Concatenate tables from all images in the plate as a specific type.
1111
1116
 
1112
1117
  Args:
1113
- table_name: The name of the table to concatenate.
1118
+ name: The name of the table to concatenate.
1114
1119
  table_cls: The type of the table to concatenate.
1115
1120
  index_key: The key to use for the index of the concatenated table.
1116
1121
  acquisition: The acquisition id to filter the images.
@@ -1122,11 +1127,11 @@ class OmeZarrPlate:
1122
1127
  if 'lazy', the table will be loaded as a lazy frame.
1123
1128
  """
1124
1129
  images = await self.get_images_async(acquisition=acquisition)
1125
- extras = _build_extras(images.keys())
1130
+ extras = _build_extras(tuple(images.keys()))
1126
1131
  return await concatenate_image_tables_as_async(
1127
- images=images.values(),
1132
+ images=tuple(images.values()),
1128
1133
  extras=extras,
1129
- table_name=table_name,
1134
+ name=name,
1130
1135
  table_cls=table_cls,
1131
1136
  index_key=index_key,
1132
1137
  strict=strict,
ngio/images/__init__.py CHANGED
@@ -1,23 +1,44 @@
1
1
  """OME-Zarr object models."""
2
2
 
3
- from ngio.images._image import Image, ImagesContainer
3
+ from ngio.images._create_synt_container import create_synthetic_ome_zarr
4
+ from ngio.images._image import ChannelSelectionModel, Image, ImagesContainer
4
5
  from ngio.images._label import Label, LabelsContainer
5
6
  from ngio.images._ome_zarr_container import (
6
7
  OmeZarrContainer,
7
8
  create_empty_ome_zarr,
8
9
  create_ome_zarr_from_array,
9
10
  open_image,
11
+ open_label,
10
12
  open_ome_zarr_container,
11
13
  )
14
+ from ngio.images._table_ops import (
15
+ concatenate_image_tables,
16
+ concatenate_image_tables_as,
17
+ concatenate_image_tables_as_async,
18
+ concatenate_image_tables_async,
19
+ conctatenate_tables,
20
+ list_image_tables,
21
+ list_image_tables_async,
22
+ )
12
23
 
13
24
  __all__ = [
25
+ "ChannelSelectionModel",
14
26
  "Image",
15
27
  "ImagesContainer",
16
28
  "Label",
17
29
  "LabelsContainer",
18
30
  "OmeZarrContainer",
31
+ "concatenate_image_tables",
32
+ "concatenate_image_tables_as",
33
+ "concatenate_image_tables_as_async",
34
+ "concatenate_image_tables_async",
35
+ "conctatenate_tables",
19
36
  "create_empty_ome_zarr",
20
37
  "create_ome_zarr_from_array",
38
+ "create_synthetic_ome_zarr",
39
+ "list_image_tables",
40
+ "list_image_tables_async",
21
41
  "open_image",
42
+ "open_label",
22
43
  "open_ome_zarr_container",
23
44
  ]