ngio 0.5.0a3__py3-none-any.whl → 0.5.0b2__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.
- ngio/__init__.py +3 -0
- ngio/hcs/_plate.py +67 -14
- ngio/images/_abstract_image.py +9 -8
- ngio/images/_image.py +9 -1
- ngio/images/_label.py +67 -22
- ngio/images/_ome_zarr_container.py +53 -5
- ngio/ome_zarr_meta/__init__.py +8 -0
- ngio/ome_zarr_meta/_meta_handlers.py +88 -1
- ngio/ome_zarr_meta/ngio_specs/__init__.py +2 -0
- ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py +11 -11
- ngio/ome_zarr_meta/ngio_specs/_ngio_image.py +7 -0
- ngio/ome_zarr_meta/v04/__init__.py +4 -0
- ngio/ome_zarr_meta/v04/_v04_spec.py +34 -3
- ngio/ome_zarr_meta/v05/__init__.py +4 -0
- ngio/ome_zarr_meta/v05/_v05_spec.py +39 -3
- ngio/tables/_tables_container.py +21 -0
- ngio/tables/backends/_anndata.py +1 -0
- ngio/utils/__init__.py +2 -0
- ngio/utils/_zarr_utils.py +22 -19
- {ngio-0.5.0a3.dist-info → ngio-0.5.0b2.dist-info}/METADATA +1 -1
- {ngio-0.5.0a3.dist-info → ngio-0.5.0b2.dist-info}/RECORD +23 -23
- {ngio-0.5.0a3.dist-info → ngio-0.5.0b2.dist-info}/WHEEL +0 -0
- {ngio-0.5.0a3.dist-info → ngio-0.5.0b2.dist-info}/licenses/LICENSE +0 -0
ngio/__init__.py
CHANGED
|
@@ -37,6 +37,7 @@ from ngio.ome_zarr_meta.ngio_specs import (
|
|
|
37
37
|
NgffVersions,
|
|
38
38
|
PixelSize,
|
|
39
39
|
)
|
|
40
|
+
from ngio.utils import NgioSupportedStore, StoreOrGroup
|
|
40
41
|
|
|
41
42
|
__all__ = [
|
|
42
43
|
"AxesSetup",
|
|
@@ -47,12 +48,14 @@ __all__ = [
|
|
|
47
48
|
"ImageInWellPath",
|
|
48
49
|
"Label",
|
|
49
50
|
"NgffVersions",
|
|
51
|
+
"NgioSupportedStore",
|
|
50
52
|
"OmeZarrContainer",
|
|
51
53
|
"OmeZarrPlate",
|
|
52
54
|
"OmeZarrWell",
|
|
53
55
|
"PixelSize",
|
|
54
56
|
"Roi",
|
|
55
57
|
"RoiSlice",
|
|
58
|
+
"StoreOrGroup",
|
|
56
59
|
"create_empty_ome_zarr",
|
|
57
60
|
"create_empty_plate",
|
|
58
61
|
"create_empty_well",
|
ngio/hcs/_plate.py
CHANGED
|
@@ -15,6 +15,7 @@ from ngio.images import (
|
|
|
15
15
|
list_image_tables_async,
|
|
16
16
|
)
|
|
17
17
|
from ngio.ome_zarr_meta import (
|
|
18
|
+
DefaultNgffVersion,
|
|
18
19
|
ImageInWellPath,
|
|
19
20
|
NgffVersions,
|
|
20
21
|
NgioPlateMeta,
|
|
@@ -778,7 +779,8 @@ class OmeZarrPlate:
|
|
|
778
779
|
self,
|
|
779
780
|
store: StoreOrGroup,
|
|
780
781
|
plate_name: str | None = None,
|
|
781
|
-
version: NgffVersions =
|
|
782
|
+
version: NgffVersions | None = None,
|
|
783
|
+
ngff_version: NgffVersions = DefaultNgffVersion,
|
|
782
784
|
keep_acquisitions: bool = False,
|
|
783
785
|
cache: bool = False,
|
|
784
786
|
overwrite: bool = False,
|
|
@@ -788,7 +790,8 @@ class OmeZarrPlate:
|
|
|
788
790
|
Args:
|
|
789
791
|
store (StoreOrGroup): The Zarr store or group that stores the plate.
|
|
790
792
|
plate_name (str | None): The name of the new plate.
|
|
791
|
-
version (NgffVersion):
|
|
793
|
+
version (NgffVersion | None): Deprecated. Please use 'ngff_version' instead.
|
|
794
|
+
ngff_version (NgffVersion): The NGFF version to use for the new plate.
|
|
792
795
|
keep_acquisitions (bool): Whether to keep the acquisitions in the new plate.
|
|
793
796
|
cache (bool): Whether to use a cache for the zarr group metadata.
|
|
794
797
|
overwrite (bool): Whether to overwrite the existing plate.
|
|
@@ -797,6 +800,7 @@ class OmeZarrPlate:
|
|
|
797
800
|
ome_zarr_plate=self,
|
|
798
801
|
store=store,
|
|
799
802
|
plate_name=plate_name,
|
|
803
|
+
ngff_version=ngff_version,
|
|
800
804
|
version=version,
|
|
801
805
|
keep_acquisitions=keep_acquisitions,
|
|
802
806
|
cache=cache,
|
|
@@ -955,6 +959,25 @@ class OmeZarrPlate:
|
|
|
955
959
|
name=name, table=table, backend=backend, overwrite=overwrite
|
|
956
960
|
)
|
|
957
961
|
|
|
962
|
+
def delete_table(self, name: str, missing_ok: bool = False) -> None:
|
|
963
|
+
"""Delete a table from the group.
|
|
964
|
+
|
|
965
|
+
Args:
|
|
966
|
+
name (str): The name of the table to delete.
|
|
967
|
+
missing_ok (bool): If True, do not raise an error if the table does not
|
|
968
|
+
exist.
|
|
969
|
+
|
|
970
|
+
"""
|
|
971
|
+
table_container = self._get_tables_container(create_mode=False)
|
|
972
|
+
if table_container is None and missing_ok:
|
|
973
|
+
return
|
|
974
|
+
if table_container is None:
|
|
975
|
+
raise NgioValueError(
|
|
976
|
+
f"No tables found in the image, cannot delete {name}. "
|
|
977
|
+
"Set missing_ok=True to ignore this error."
|
|
978
|
+
)
|
|
979
|
+
table_container.delete(name=name, missing_ok=missing_ok)
|
|
980
|
+
|
|
958
981
|
def list_image_tables(
|
|
959
982
|
self,
|
|
960
983
|
acquisition: int | None = None,
|
|
@@ -1157,7 +1180,6 @@ def open_ome_zarr_plate(
|
|
|
1157
1180
|
def _create_empty_plate_from_meta(
|
|
1158
1181
|
store: StoreOrGroup,
|
|
1159
1182
|
meta: NgioPlateMeta,
|
|
1160
|
-
version: NgffVersions = "0.4",
|
|
1161
1183
|
overwrite: bool = False,
|
|
1162
1184
|
) -> ZarrGroupHandler:
|
|
1163
1185
|
"""Create an empty OME-Zarr plate from metadata."""
|
|
@@ -1171,7 +1193,8 @@ def create_empty_plate(
|
|
|
1171
1193
|
store: StoreOrGroup,
|
|
1172
1194
|
name: str,
|
|
1173
1195
|
images: list[ImageInWellPath] | None = None,
|
|
1174
|
-
version: NgffVersions =
|
|
1196
|
+
version: NgffVersions | None = None,
|
|
1197
|
+
ngff_version: NgffVersions = DefaultNgffVersion,
|
|
1175
1198
|
cache: bool = False,
|
|
1176
1199
|
overwrite: bool = False,
|
|
1177
1200
|
) -> OmeZarrPlate:
|
|
@@ -1182,18 +1205,26 @@ def create_empty_plate(
|
|
|
1182
1205
|
name (str): The name of the plate.
|
|
1183
1206
|
images (list[ImageInWellPath] | None): A list of images to add to the plate.
|
|
1184
1207
|
If None, no images are added. Defaults to None.
|
|
1185
|
-
version (NgffVersion):
|
|
1208
|
+
version (NgffVersion | None): Deprecated. Please use 'ngff_version' instead.
|
|
1209
|
+
ngff_version (NgffVersion): The NGFF version to use for the new plate.
|
|
1186
1210
|
cache (bool): Whether to use a cache for the zarr group metadata.
|
|
1187
1211
|
overwrite (bool): Whether to overwrite the existing plate.
|
|
1188
1212
|
"""
|
|
1213
|
+
if version is not None:
|
|
1214
|
+
warnings.warn(
|
|
1215
|
+
"The 'version' argument is deprecated, and will be removed in ngio=0.3. "
|
|
1216
|
+
"Please use 'ngff_version' instead.",
|
|
1217
|
+
DeprecationWarning,
|
|
1218
|
+
stacklevel=2,
|
|
1219
|
+
)
|
|
1220
|
+
ngff_version = version
|
|
1189
1221
|
plate_meta = NgioPlateMeta.default_init(
|
|
1190
1222
|
name=name,
|
|
1191
|
-
|
|
1223
|
+
ngff_version=ngff_version,
|
|
1192
1224
|
)
|
|
1193
1225
|
group_handler = _create_empty_plate_from_meta(
|
|
1194
1226
|
store=store,
|
|
1195
1227
|
meta=plate_meta,
|
|
1196
|
-
version=version,
|
|
1197
1228
|
overwrite=overwrite,
|
|
1198
1229
|
)
|
|
1199
1230
|
|
|
@@ -1218,7 +1249,8 @@ def derive_ome_zarr_plate(
|
|
|
1218
1249
|
ome_zarr_plate: OmeZarrPlate,
|
|
1219
1250
|
store: StoreOrGroup,
|
|
1220
1251
|
plate_name: str | None = None,
|
|
1221
|
-
version: NgffVersions =
|
|
1252
|
+
version: NgffVersions | None = None,
|
|
1253
|
+
ngff_version: NgffVersions = DefaultNgffVersion,
|
|
1222
1254
|
keep_acquisitions: bool = False,
|
|
1223
1255
|
cache: bool = False,
|
|
1224
1256
|
overwrite: bool = False,
|
|
@@ -1229,24 +1261,33 @@ def derive_ome_zarr_plate(
|
|
|
1229
1261
|
ome_zarr_plate (OmeZarrPlate): The existing OME-Zarr plate.
|
|
1230
1262
|
store (StoreOrGroup): The Zarr store or group that stores the plate.
|
|
1231
1263
|
plate_name (str | None): The name of the new plate.
|
|
1232
|
-
version (NgffVersion):
|
|
1264
|
+
version (NgffVersion | None): Deprecated. Please use 'ngff_version' instead.
|
|
1265
|
+
ngff_version (NgffVersion): The NGFF version to use for the new plate.
|
|
1233
1266
|
keep_acquisitions (bool): Whether to keep the acquisitions in the new plate.
|
|
1234
1267
|
cache (bool): Whether to use a cache for the zarr group metadata.
|
|
1235
1268
|
overwrite (bool): Whether to overwrite the existing plate.
|
|
1236
1269
|
"""
|
|
1270
|
+
if version is not None:
|
|
1271
|
+
warnings.warn(
|
|
1272
|
+
"The 'version' argument is deprecated, and will be removed in ngio=0.3. "
|
|
1273
|
+
"Please use 'ngff_version' instead.",
|
|
1274
|
+
DeprecationWarning,
|
|
1275
|
+
stacklevel=2,
|
|
1276
|
+
)
|
|
1277
|
+
ngff_version = version
|
|
1278
|
+
|
|
1237
1279
|
if plate_name is None:
|
|
1238
1280
|
plate_name = ome_zarr_plate.meta.plate.name
|
|
1239
1281
|
|
|
1240
1282
|
new_meta = ome_zarr_plate.meta.derive(
|
|
1241
1283
|
name=plate_name,
|
|
1242
|
-
|
|
1284
|
+
ngff_version=ngff_version,
|
|
1243
1285
|
keep_acquisitions=keep_acquisitions,
|
|
1244
1286
|
)
|
|
1245
1287
|
_ = _create_empty_plate_from_meta(
|
|
1246
1288
|
store=store,
|
|
1247
1289
|
meta=new_meta,
|
|
1248
1290
|
overwrite=overwrite,
|
|
1249
|
-
version=version,
|
|
1250
1291
|
)
|
|
1251
1292
|
return open_ome_zarr_plate(
|
|
1252
1293
|
store=store,
|
|
@@ -1277,7 +1318,8 @@ def open_ome_zarr_well(
|
|
|
1277
1318
|
|
|
1278
1319
|
def create_empty_well(
|
|
1279
1320
|
store: StoreOrGroup,
|
|
1280
|
-
version: NgffVersions =
|
|
1321
|
+
version: NgffVersions | None = None,
|
|
1322
|
+
ngff_version: NgffVersions = DefaultNgffVersion,
|
|
1281
1323
|
cache: bool = False,
|
|
1282
1324
|
overwrite: bool = False,
|
|
1283
1325
|
) -> OmeZarrWell:
|
|
@@ -1285,14 +1327,25 @@ def create_empty_well(
|
|
|
1285
1327
|
|
|
1286
1328
|
Args:
|
|
1287
1329
|
store (StoreOrGroup): The Zarr store or group that stores the well.
|
|
1288
|
-
version (NgffVersion):
|
|
1330
|
+
version (NgffVersion | None): Deprecated. Please use 'ngff_version' instead.
|
|
1331
|
+
ngff_version (NgffVersion): The version of the new well.
|
|
1289
1332
|
cache (bool): Whether to use a cache for the zarr group metadata.
|
|
1290
1333
|
overwrite (bool): Whether to overwrite the existing well.
|
|
1291
1334
|
"""
|
|
1335
|
+
if version is not None:
|
|
1336
|
+
warnings.warn(
|
|
1337
|
+
"The 'version' argument is deprecated, and will be removed in ngio=0.3. "
|
|
1338
|
+
"Please use 'ngff_version' instead.",
|
|
1339
|
+
DeprecationWarning,
|
|
1340
|
+
stacklevel=2,
|
|
1341
|
+
)
|
|
1342
|
+
ngff_version = version
|
|
1292
1343
|
group_handler = ZarrGroupHandler(
|
|
1293
1344
|
store=store, cache=True, mode="w" if overwrite else "w-"
|
|
1294
1345
|
)
|
|
1295
|
-
update_ngio_well_meta(
|
|
1346
|
+
update_ngio_well_meta(
|
|
1347
|
+
group_handler, NgioWellMeta.default_init(ngff_version=ngff_version)
|
|
1348
|
+
)
|
|
1296
1349
|
|
|
1297
1350
|
return open_ome_zarr_well(
|
|
1298
1351
|
store=store,
|
ngio/images/_abstract_image.py
CHANGED
|
@@ -681,7 +681,7 @@ def _check_chunks_and_shards_compatibility(
|
|
|
681
681
|
|
|
682
682
|
def _apply_channel_policy(
|
|
683
683
|
ref_image: AbstractImage,
|
|
684
|
-
channels_policy: Literal["squeeze", "same"] | int,
|
|
684
|
+
channels_policy: Literal["squeeze", "same", "singleton"] | int,
|
|
685
685
|
shapes: list[tuple[int, ...]],
|
|
686
686
|
axes: tuple[str, ...],
|
|
687
687
|
chunks: ChunksLike,
|
|
@@ -703,6 +703,10 @@ def _apply_channel_policy(
|
|
|
703
703
|
if channels_policy == "same":
|
|
704
704
|
return shapes, axes, chunks, shards
|
|
705
705
|
|
|
706
|
+
if channels_policy == "singleton":
|
|
707
|
+
# Treat 'singleton' as setting channel size to 1
|
|
708
|
+
channels_policy = 1
|
|
709
|
+
|
|
706
710
|
channel_index = ref_image.axes_handler.get_index("c")
|
|
707
711
|
if channel_index is None:
|
|
708
712
|
if channels_policy == "squeeze":
|
|
@@ -729,11 +733,6 @@ def _apply_channel_policy(
|
|
|
729
733
|
elif isinstance(channels_policy, int):
|
|
730
734
|
new_shapes = []
|
|
731
735
|
for shape in shapes:
|
|
732
|
-
if shape[channel_index] != channels_policy:
|
|
733
|
-
raise NgioValueError(
|
|
734
|
-
f"Cannot apply channel policy {channels_policy=} to an image "
|
|
735
|
-
f"with {shape[channel_index]} channels."
|
|
736
|
-
)
|
|
737
736
|
new_shape = (
|
|
738
737
|
*shape[:channel_index],
|
|
739
738
|
channels_policy,
|
|
@@ -797,7 +796,7 @@ def abstract_derive(
|
|
|
797
796
|
z_spacing: float | None = None,
|
|
798
797
|
time_spacing: float | None = None,
|
|
799
798
|
name: str | None = None,
|
|
800
|
-
channels_policy: Literal["squeeze", "same"] | int = "same",
|
|
799
|
+
channels_policy: Literal["squeeze", "same", "singleton"] | int = "same",
|
|
801
800
|
channels_meta: Sequence[str | Channel] | None = None,
|
|
802
801
|
ngff_version: NgffVersions | None = None,
|
|
803
802
|
# Zarr Array parameters
|
|
@@ -826,9 +825,11 @@ def abstract_derive(
|
|
|
826
825
|
time_spacing (float | None): The time spacing of the new image.
|
|
827
826
|
axes_names (Sequence[str] | None): The axes names of the new image.
|
|
828
827
|
name (str | None): The name of the new image.
|
|
829
|
-
channels_policy (Literal["squeeze", "same"] | int):
|
|
828
|
+
channels_policy (Literal["squeeze", "same", "singleton"] | int):
|
|
829
|
+
Possible policies:
|
|
830
830
|
- If "squeeze", the channels axis will be removed (no matter its size).
|
|
831
831
|
- If "same", the channels axis will be kept as is (if it exists).
|
|
832
|
+
- If "singleton", the channels axis will be set to size 1.
|
|
832
833
|
- If an integer is provided, the channels axis will be changed to have that
|
|
833
834
|
size.
|
|
834
835
|
channels_meta (Sequence[str | Channel] | None): The channels metadata
|
ngio/images/_image.py
CHANGED
|
@@ -765,6 +765,7 @@ def derive_image_container(
|
|
|
765
765
|
z_spacing: float | None = None,
|
|
766
766
|
time_spacing: float | None = None,
|
|
767
767
|
name: str | None = None,
|
|
768
|
+
channels_policy: Literal["same", "squeeze", "singleton"] | int = "same",
|
|
768
769
|
channels_meta: Sequence[str | Channel] | None = None,
|
|
769
770
|
ngff_version: NgffVersions | None = None,
|
|
770
771
|
# Zarr Array parameters
|
|
@@ -793,6 +794,13 @@ def derive_image_container(
|
|
|
793
794
|
z_spacing (float | None): The z spacing of the new image.
|
|
794
795
|
time_spacing (float | None): The time spacing of the new image.
|
|
795
796
|
name (str | None): The name of the new image.
|
|
797
|
+
channels_policy (Literal["squeeze", "same", "singleton"] | int): Possible
|
|
798
|
+
policies:
|
|
799
|
+
- If "squeeze", the channels axis will be removed (no matter its size).
|
|
800
|
+
- If "same", the channels axis will be kept as is (if it exists).
|
|
801
|
+
- If "singleton", the channels axis will be set to size 1.
|
|
802
|
+
- If an integer is provided, the channels axis will be changed to have
|
|
803
|
+
that size.
|
|
796
804
|
channels_meta (Sequence[str | Channel] | None): The channels metadata
|
|
797
805
|
of the new image.
|
|
798
806
|
ngff_version (NgffVersions | None): The NGFF version to use.
|
|
@@ -826,7 +834,7 @@ def derive_image_container(
|
|
|
826
834
|
time_spacing=time_spacing,
|
|
827
835
|
name=name,
|
|
828
836
|
channels_meta=channels_meta,
|
|
829
|
-
channels_policy=
|
|
837
|
+
channels_policy=channels_policy,
|
|
830
838
|
ngff_version=ngff_version,
|
|
831
839
|
chunks=chunks,
|
|
832
840
|
shards=shards,
|
ngio/images/_label.py
CHANGED
|
@@ -11,8 +11,11 @@ from ngio.images._abstract_image import AbstractImage, abstract_derive
|
|
|
11
11
|
from ngio.images._image import Image
|
|
12
12
|
from ngio.ome_zarr_meta import (
|
|
13
13
|
LabelMetaHandler,
|
|
14
|
+
LabelsGroupMetaHandler,
|
|
14
15
|
NgioLabelMeta,
|
|
16
|
+
NgioLabelsGroupMeta,
|
|
15
17
|
PixelSize,
|
|
18
|
+
update_ngio_labels_group_meta,
|
|
16
19
|
)
|
|
17
20
|
from ngio.ome_zarr_meta.ngio_specs import (
|
|
18
21
|
DefaultSpaceUnit,
|
|
@@ -112,29 +115,39 @@ class Label(AbstractImage):
|
|
|
112
115
|
class LabelsContainer:
|
|
113
116
|
"""A class to handle the /labels group in an OME-NGFF file."""
|
|
114
117
|
|
|
115
|
-
def __init__(
|
|
118
|
+
def __init__(
|
|
119
|
+
self,
|
|
120
|
+
group_handler: ZarrGroupHandler,
|
|
121
|
+
ngff_version: NgffVersions | None = None,
|
|
122
|
+
) -> None:
|
|
116
123
|
"""Initialize the LabelGroupHandler."""
|
|
117
124
|
self._group_handler = group_handler
|
|
118
|
-
#
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
f"Found: {attrs}"
|
|
125
|
+
# If the group is empty, initialize the metadata
|
|
126
|
+
try:
|
|
127
|
+
self._meta_handler = LabelsGroupMetaHandler(group_handler)
|
|
128
|
+
except NgioValidationError:
|
|
129
|
+
if ngff_version is None:
|
|
130
|
+
raise NgioValueError(
|
|
131
|
+
"The /labels group is missing metadata. "
|
|
132
|
+
"Please provide the ngff_version to initialize it."
|
|
133
|
+
) from None
|
|
134
|
+
meta = NgioLabelsGroupMeta(labels=[], version=ngff_version)
|
|
135
|
+
update_ngio_labels_group_meta(
|
|
136
|
+
group_handler=group_handler,
|
|
137
|
+
ngio_meta=meta,
|
|
132
138
|
)
|
|
139
|
+
self._group_handler = self._group_handler.reopen_handler()
|
|
140
|
+
self._meta_handler = LabelsGroupMetaHandler(group_handler)
|
|
141
|
+
|
|
142
|
+
@property
|
|
143
|
+
def meta(self) -> NgioLabelsGroupMeta:
|
|
144
|
+
"""Return the metadata."""
|
|
145
|
+
meta = self._meta_handler.get_meta()
|
|
146
|
+
return meta
|
|
133
147
|
|
|
134
148
|
def list(self) -> list[str]:
|
|
135
149
|
"""Create the /labels group if it doesn't exist."""
|
|
136
|
-
|
|
137
|
-
return attrs.get("labels", [])
|
|
150
|
+
return self.meta.labels
|
|
138
151
|
|
|
139
152
|
def get(
|
|
140
153
|
self,
|
|
@@ -169,6 +182,31 @@ class LabelsContainer:
|
|
|
169
182
|
)
|
|
170
183
|
return Label(group_handler, path, label_meta_handler)
|
|
171
184
|
|
|
185
|
+
def delete(self, name: str, missing_ok: bool = False) -> None:
|
|
186
|
+
"""Delete a label from the group.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
name (str): The name of the label to delete.
|
|
190
|
+
missing_ok (bool): If True, do not raise an error if the label does not
|
|
191
|
+
exist.
|
|
192
|
+
|
|
193
|
+
"""
|
|
194
|
+
existing_labels = self.list()
|
|
195
|
+
if name not in existing_labels:
|
|
196
|
+
if missing_ok:
|
|
197
|
+
return
|
|
198
|
+
raise NgioValueError(
|
|
199
|
+
f"Label '{name}' not found in the Labels group. "
|
|
200
|
+
f"Available labels: {existing_labels}"
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
self._group_handler.delete_group(name)
|
|
204
|
+
existing_labels.remove(name)
|
|
205
|
+
update_meta = NgioLabelsGroupMeta(
|
|
206
|
+
labels=existing_labels, version=self.meta.version
|
|
207
|
+
)
|
|
208
|
+
self._meta_handler.update_meta(update_meta)
|
|
209
|
+
|
|
172
210
|
def derive(
|
|
173
211
|
self,
|
|
174
212
|
name: str,
|
|
@@ -178,7 +216,7 @@ class LabelsContainer:
|
|
|
178
216
|
pixelsize: float | tuple[float, float] | None = None,
|
|
179
217
|
z_spacing: float | None = None,
|
|
180
218
|
time_spacing: float | None = None,
|
|
181
|
-
channels_policy: Literal["same", "squeeze"] | int = "squeeze",
|
|
219
|
+
channels_policy: Literal["same", "squeeze", "singleton"] | int = "squeeze",
|
|
182
220
|
ngff_version: NgffVersions | None = None,
|
|
183
221
|
# Zarr Array parameters
|
|
184
222
|
chunks: ChunksLike = "auto",
|
|
@@ -210,9 +248,11 @@ class LabelsContainer:
|
|
|
210
248
|
name (str | None): The name of the new image.
|
|
211
249
|
channels_meta (Sequence[str | Channel] | None): The channels metadata
|
|
212
250
|
of the new image.
|
|
213
|
-
channels_policy (Literal["squeeze", "same"] | int):
|
|
251
|
+
channels_policy (Literal["squeeze", "same", "singleton"] | int):
|
|
252
|
+
Possible policies:
|
|
214
253
|
- If "squeeze", the channels axis will be removed (no matter its size).
|
|
215
254
|
- If "same", the channels axis will be kept as is (if it exists).
|
|
255
|
+
- If "singleton", the channels axis will be set to size 1.
|
|
216
256
|
- If an integer is provided, the channels axis will be changed to have
|
|
217
257
|
that size.
|
|
218
258
|
ngff_version (NgffVersions | None): The NGFF version to use.
|
|
@@ -267,8 +307,11 @@ class LabelsContainer:
|
|
|
267
307
|
|
|
268
308
|
if name not in existing_labels:
|
|
269
309
|
existing_labels.append(name)
|
|
270
|
-
self._group_handler.write_attrs({"labels": existing_labels})
|
|
271
310
|
|
|
311
|
+
update_meta = NgioLabelsGroupMeta(
|
|
312
|
+
labels=existing_labels, version=self.meta.version
|
|
313
|
+
)
|
|
314
|
+
self._meta_handler.update_meta(update_meta)
|
|
272
315
|
return self.get(name)
|
|
273
316
|
|
|
274
317
|
|
|
@@ -282,7 +325,7 @@ def derive_label(
|
|
|
282
325
|
z_spacing: float | None = None,
|
|
283
326
|
time_spacing: float | None = None,
|
|
284
327
|
name: str | None = None,
|
|
285
|
-
channels_policy: Literal["same", "squeeze"] | int = "squeeze",
|
|
328
|
+
channels_policy: Literal["same", "squeeze", "singleton"] | int = "squeeze",
|
|
286
329
|
ngff_version: NgffVersions | None = None,
|
|
287
330
|
# Zarr Array parameters
|
|
288
331
|
chunks: ChunksLike = "auto",
|
|
@@ -308,9 +351,11 @@ def derive_label(
|
|
|
308
351
|
z_spacing (float | None): The z spacing of the new label.
|
|
309
352
|
time_spacing (float | None): The time spacing of the new label.
|
|
310
353
|
name (str | None): The name of the new label.
|
|
311
|
-
channels_policy (Literal["squeeze", "same"] | int): Possible
|
|
354
|
+
channels_policy (Literal["squeeze", "same", "singleton"] | int): Possible
|
|
355
|
+
policies:
|
|
312
356
|
- If "squeeze", the channels axis will be removed (no matter its size).
|
|
313
357
|
- If "same", the channels axis will be kept as is (if it exists).
|
|
358
|
+
- If "singleton", the channels axis will be set to size 1.
|
|
314
359
|
- If an integer is provided, the channels axis will be changed to have that
|
|
315
360
|
size.
|
|
316
361
|
ngff_version (NgffVersions | None): The NGFF version to use.
|
|
@@ -61,13 +61,13 @@ def _try_get_table_container(
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
def _try_get_label_container(
|
|
64
|
-
handler: ZarrGroupHandler, create_mode: bool = True
|
|
64
|
+
handler: ZarrGroupHandler, ngff_version: NgffVersions, create_mode: bool = True
|
|
65
65
|
) -> LabelsContainer | None:
|
|
66
66
|
"""Return a default label container."""
|
|
67
67
|
try:
|
|
68
68
|
label_handler = handler.get_handler("labels", create_mode=create_mode)
|
|
69
|
-
return LabelsContainer(label_handler)
|
|
70
|
-
except
|
|
69
|
+
return LabelsContainer(label_handler, ngff_version=ngff_version)
|
|
70
|
+
except FileNotFoundError:
|
|
71
71
|
return None
|
|
72
72
|
|
|
73
73
|
|
|
@@ -149,7 +149,9 @@ class OmeZarrContainer:
|
|
|
149
149
|
return self._labels_container
|
|
150
150
|
|
|
151
151
|
_labels_container = _try_get_label_container(
|
|
152
|
-
self._group_handler,
|
|
152
|
+
self._group_handler,
|
|
153
|
+
create_mode=create_mode,
|
|
154
|
+
ngff_version=self.image_meta.version,
|
|
153
155
|
)
|
|
154
156
|
self._labels_container = _labels_container
|
|
155
157
|
return self._labels_container
|
|
@@ -428,6 +430,7 @@ class OmeZarrContainer:
|
|
|
428
430
|
z_spacing: float | None = None,
|
|
429
431
|
time_spacing: float | None = None,
|
|
430
432
|
name: str | None = None,
|
|
433
|
+
channels_policy: Literal["squeeze", "same", "singleton"] | int = "same",
|
|
431
434
|
channels_meta: Sequence[str | Channel] | None = None,
|
|
432
435
|
ngff_version: NgffVersions | None = None,
|
|
433
436
|
# Zarr Array parameters
|
|
@@ -459,6 +462,12 @@ class OmeZarrContainer:
|
|
|
459
462
|
z_spacing (float | None): The z spacing of the new image.
|
|
460
463
|
time_spacing (float | None): The time spacing of the new image.
|
|
461
464
|
name (str | None): The name of the new image.
|
|
465
|
+
channels_policy (Literal["squeeze", "same"] | int): Possible policies:
|
|
466
|
+
- If "squeeze", the channels axis will be removed (no matter its size).
|
|
467
|
+
- If "same", the channels axis will be kept as is (if it exists).
|
|
468
|
+
- If "singleton", the channels axis will be set to size 1.
|
|
469
|
+
- If an integer is provided, the channels axis will be changed to have
|
|
470
|
+
that size.
|
|
462
471
|
channels_meta (Sequence[str | Channel] | None): The channels metadata
|
|
463
472
|
of the new image.
|
|
464
473
|
ngff_version (NgffVersions | None): The NGFF version to use.
|
|
@@ -665,6 +674,25 @@ class OmeZarrContainer:
|
|
|
665
674
|
name=name, table=table, backend=backend, overwrite=overwrite
|
|
666
675
|
)
|
|
667
676
|
|
|
677
|
+
def delete_table(self, name: str, missing_ok: bool = False) -> None:
|
|
678
|
+
"""Delete a table from the group.
|
|
679
|
+
|
|
680
|
+
Args:
|
|
681
|
+
name (str): The name of the table to delete.
|
|
682
|
+
missing_ok (bool): If True, do not raise an error if the table does not
|
|
683
|
+
exist.
|
|
684
|
+
|
|
685
|
+
"""
|
|
686
|
+
table_container = self._get_tables_container(create_mode=False)
|
|
687
|
+
if table_container is None and missing_ok:
|
|
688
|
+
return
|
|
689
|
+
if table_container is None:
|
|
690
|
+
raise NgioValueError(
|
|
691
|
+
f"No tables found in the image, cannot delete {name}. "
|
|
692
|
+
"Set missing_ok=True to ignore this error."
|
|
693
|
+
)
|
|
694
|
+
table_container.delete(name=name, missing_ok=missing_ok)
|
|
695
|
+
|
|
668
696
|
def list_labels(self) -> list[str]:
|
|
669
697
|
"""List all labels in the image."""
|
|
670
698
|
label_container = self._get_labels_container(create_mode=False)
|
|
@@ -730,6 +758,25 @@ class OmeZarrContainer:
|
|
|
730
758
|
masking_roi_table=masking_table,
|
|
731
759
|
)
|
|
732
760
|
|
|
761
|
+
def delete_label(self, name: str, missing_ok: bool = False) -> None:
|
|
762
|
+
"""Delete a label from the group.
|
|
763
|
+
|
|
764
|
+
Args:
|
|
765
|
+
name (str): The name of the label to delete.
|
|
766
|
+
missing_ok (bool): If True, do not raise an error if the label does not
|
|
767
|
+
exist.
|
|
768
|
+
|
|
769
|
+
"""
|
|
770
|
+
label_container = self._get_labels_container(create_mode=False)
|
|
771
|
+
if label_container is None and missing_ok:
|
|
772
|
+
return
|
|
773
|
+
if label_container is None:
|
|
774
|
+
raise NgioValueError(
|
|
775
|
+
f"No labels found in the image, cannot delete {name}. "
|
|
776
|
+
"Set missing_ok=True to ignore this error."
|
|
777
|
+
)
|
|
778
|
+
label_container.delete(name=name, missing_ok=missing_ok)
|
|
779
|
+
|
|
733
780
|
def derive_label(
|
|
734
781
|
self,
|
|
735
782
|
name: str,
|
|
@@ -739,7 +786,7 @@ class OmeZarrContainer:
|
|
|
739
786
|
pixelsize: float | tuple[float, float] | None = None,
|
|
740
787
|
z_spacing: float | None = None,
|
|
741
788
|
time_spacing: float | None = None,
|
|
742
|
-
channels_policy: Literal["same", "squeeze"] | int = "squeeze",
|
|
789
|
+
channels_policy: Literal["same", "squeeze", "singleton"] | int = "squeeze",
|
|
743
790
|
ngff_version: NgffVersions | None = None,
|
|
744
791
|
# Zarr Array parameters
|
|
745
792
|
chunks: ChunksLike = "auto",
|
|
@@ -769,6 +816,7 @@ class OmeZarrContainer:
|
|
|
769
816
|
channels_policy (Literal["same", "squeeze"] | int): Possible policies:
|
|
770
817
|
- If "squeeze", the channels axis will be removed (no matter its size).
|
|
771
818
|
- If "same", the channels axis will be kept as is (if it exists).
|
|
819
|
+
- If "singleton", the channels axis will be set to size 1.
|
|
772
820
|
- If an integer is provided, the channels axis will be changed to have
|
|
773
821
|
that size.
|
|
774
822
|
Defaults to "squeeze".
|
ngio/ome_zarr_meta/__init__.py
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
from ngio.ome_zarr_meta._meta_handlers import (
|
|
4
4
|
ImageMetaHandler,
|
|
5
5
|
LabelMetaHandler,
|
|
6
|
+
LabelsGroupMetaHandler,
|
|
6
7
|
PlateMetaHandler,
|
|
7
8
|
WellMetaHandler,
|
|
8
9
|
update_ngio_image_meta,
|
|
9
10
|
update_ngio_label_meta,
|
|
11
|
+
update_ngio_labels_group_meta,
|
|
10
12
|
update_ngio_meta,
|
|
11
13
|
update_ngio_plate_meta,
|
|
12
14
|
update_ngio_well_meta,
|
|
@@ -14,10 +16,12 @@ from ngio.ome_zarr_meta._meta_handlers import (
|
|
|
14
16
|
from ngio.ome_zarr_meta.ngio_specs import (
|
|
15
17
|
AxesHandler,
|
|
16
18
|
Dataset,
|
|
19
|
+
DefaultNgffVersion,
|
|
17
20
|
ImageInWellPath,
|
|
18
21
|
NgffVersions,
|
|
19
22
|
NgioImageMeta,
|
|
20
23
|
NgioLabelMeta,
|
|
24
|
+
NgioLabelsGroupMeta,
|
|
21
25
|
NgioPlateMeta,
|
|
22
26
|
NgioWellMeta,
|
|
23
27
|
PixelSize,
|
|
@@ -28,13 +32,16 @@ from ngio.ome_zarr_meta.ngio_specs import (
|
|
|
28
32
|
__all__ = [
|
|
29
33
|
"AxesHandler",
|
|
30
34
|
"Dataset",
|
|
35
|
+
"DefaultNgffVersion",
|
|
31
36
|
"ImageInWellPath",
|
|
32
37
|
"ImageMetaHandler",
|
|
33
38
|
"LabelMetaHandler",
|
|
39
|
+
"LabelsGroupMetaHandler",
|
|
34
40
|
"NgffVersions",
|
|
35
41
|
"NgffVersions",
|
|
36
42
|
"NgioImageMeta",
|
|
37
43
|
"NgioLabelMeta",
|
|
44
|
+
"NgioLabelsGroupMeta",
|
|
38
45
|
"NgioPlateMeta",
|
|
39
46
|
"NgioWellMeta",
|
|
40
47
|
"PixelSize",
|
|
@@ -45,6 +52,7 @@ __all__ = [
|
|
|
45
52
|
"path_in_well_validation",
|
|
46
53
|
"update_ngio_image_meta",
|
|
47
54
|
"update_ngio_label_meta",
|
|
55
|
+
"update_ngio_labels_group_meta",
|
|
48
56
|
"update_ngio_meta",
|
|
49
57
|
"update_ngio_plate_meta",
|
|
50
58
|
"update_ngio_well_meta",
|
|
@@ -7,26 +7,32 @@ from ngio.ome_zarr_meta.ngio_specs import (
|
|
|
7
7
|
AxesSetup,
|
|
8
8
|
NgioImageMeta,
|
|
9
9
|
NgioLabelMeta,
|
|
10
|
+
NgioLabelsGroupMeta,
|
|
10
11
|
NgioPlateMeta,
|
|
11
12
|
NgioWellMeta,
|
|
12
13
|
)
|
|
14
|
+
from ngio.ome_zarr_meta.ngio_specs._ngio_image import NgffVersions
|
|
13
15
|
from ngio.ome_zarr_meta.v04 import (
|
|
14
16
|
ngio_to_v04_image_meta,
|
|
15
17
|
ngio_to_v04_label_meta,
|
|
18
|
+
ngio_to_v04_labels_group_meta,
|
|
16
19
|
ngio_to_v04_plate_meta,
|
|
17
20
|
ngio_to_v04_well_meta,
|
|
18
21
|
v04_to_ngio_image_meta,
|
|
19
22
|
v04_to_ngio_label_meta,
|
|
23
|
+
v04_to_ngio_labels_group_meta,
|
|
20
24
|
v04_to_ngio_plate_meta,
|
|
21
25
|
v04_to_ngio_well_meta,
|
|
22
26
|
)
|
|
23
27
|
from ngio.ome_zarr_meta.v05 import (
|
|
24
28
|
ngio_to_v05_image_meta,
|
|
25
29
|
ngio_to_v05_label_meta,
|
|
30
|
+
ngio_to_v05_labels_group_meta,
|
|
26
31
|
ngio_to_v05_plate_meta,
|
|
27
32
|
ngio_to_v05_well_meta,
|
|
28
33
|
v05_to_ngio_image_meta,
|
|
29
34
|
v05_to_ngio_label_meta,
|
|
35
|
+
v05_to_ngio_labels_group_meta,
|
|
30
36
|
v05_to_ngio_plate_meta,
|
|
31
37
|
v05_to_ngio_well_meta,
|
|
32
38
|
)
|
|
@@ -45,9 +51,22 @@ _plate_encoder_registry = {"0.4": ngio_to_v04_plate_meta, "0.5": ngio_to_v05_pla
|
|
|
45
51
|
_plate_decoder_registry = {"0.4": v04_to_ngio_plate_meta, "0.5": v05_to_ngio_plate_meta}
|
|
46
52
|
_well_encoder_registry = {"0.4": ngio_to_v04_well_meta, "0.5": ngio_to_v05_well_meta}
|
|
47
53
|
_well_decoder_registry = {"0.4": v04_to_ngio_well_meta, "0.5": v05_to_ngio_well_meta}
|
|
54
|
+
_labels_group_encoder_registry = {
|
|
55
|
+
"0.4": ngio_to_v04_labels_group_meta,
|
|
56
|
+
"0.5": ngio_to_v05_labels_group_meta,
|
|
57
|
+
}
|
|
58
|
+
_labels_group_decoder_registry = {
|
|
59
|
+
"0.4": v04_to_ngio_labels_group_meta,
|
|
60
|
+
"0.5": v05_to_ngio_labels_group_meta,
|
|
61
|
+
}
|
|
48
62
|
|
|
49
63
|
_meta_type = TypeVar(
|
|
50
|
-
"_meta_type",
|
|
64
|
+
"_meta_type",
|
|
65
|
+
NgioImageMeta,
|
|
66
|
+
NgioLabelMeta,
|
|
67
|
+
NgioLabelsGroupMeta,
|
|
68
|
+
NgioPlateMeta,
|
|
69
|
+
NgioWellMeta,
|
|
51
70
|
)
|
|
52
71
|
|
|
53
72
|
|
|
@@ -62,6 +81,8 @@ def _find_encoder_registry(
|
|
|
62
81
|
return _plate_encoder_registry
|
|
63
82
|
elif isinstance(ngio_meta, NgioWellMeta):
|
|
64
83
|
return _well_encoder_registry
|
|
84
|
+
elif isinstance(ngio_meta, NgioLabelsGroupMeta):
|
|
85
|
+
return _labels_group_encoder_registry
|
|
65
86
|
else:
|
|
66
87
|
raise NgioValueError(f"Unsupported NGIO metadata type: {type(ngio_meta)}")
|
|
67
88
|
|
|
@@ -97,6 +118,8 @@ def _find_decoder_registry(
|
|
|
97
118
|
return _plate_decoder_registry
|
|
98
119
|
elif meta_type is NgioWellMeta:
|
|
99
120
|
return _well_decoder_registry
|
|
121
|
+
elif meta_type is NgioLabelsGroupMeta:
|
|
122
|
+
return _labels_group_decoder_registry
|
|
100
123
|
else:
|
|
101
124
|
raise NgioValueError(f"Unsupported NGIO metadata type: {meta_type}")
|
|
102
125
|
|
|
@@ -447,3 +470,67 @@ class WellMetaHandler:
|
|
|
447
470
|
group_handler=self._group_handler,
|
|
448
471
|
ngio_meta=ngio_meta,
|
|
449
472
|
)
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
def get_ngio_labels_group_meta(
|
|
476
|
+
group_handler: ZarrGroupHandler,
|
|
477
|
+
version: str | None = None,
|
|
478
|
+
) -> NgioLabelsGroupMeta:
|
|
479
|
+
"""Retrieve the NGIO labels group metadata from the Zarr group.
|
|
480
|
+
|
|
481
|
+
Args:
|
|
482
|
+
group_handler (ZarrGroupHandler): The Zarr group handler.
|
|
483
|
+
version (str | None): Optional NGFF version to use for decoding.
|
|
484
|
+
|
|
485
|
+
Returns:
|
|
486
|
+
NgioLabelsGroupMeta: The NGIO labels group metadata.
|
|
487
|
+
"""
|
|
488
|
+
return get_ngio_meta(
|
|
489
|
+
group_handler=group_handler,
|
|
490
|
+
meta_type=NgioLabelsGroupMeta,
|
|
491
|
+
version=version,
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
def update_ngio_labels_group_meta(
|
|
496
|
+
group_handler: ZarrGroupHandler,
|
|
497
|
+
ngio_meta: NgioLabelsGroupMeta,
|
|
498
|
+
) -> None:
|
|
499
|
+
"""Update the NGIO labels group metadata in the Zarr group.
|
|
500
|
+
|
|
501
|
+
Args:
|
|
502
|
+
group_handler (ZarrGroupHandler): The Zarr group handler.
|
|
503
|
+
ngio_meta (NgioLabelsGroupMeta): The new NGIO labels group metadata.
|
|
504
|
+
|
|
505
|
+
"""
|
|
506
|
+
update_ngio_meta(
|
|
507
|
+
group_handler=group_handler,
|
|
508
|
+
ngio_meta=ngio_meta,
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
class LabelsGroupMetaHandler:
|
|
513
|
+
def __init__(
|
|
514
|
+
self,
|
|
515
|
+
group_handler: ZarrGroupHandler,
|
|
516
|
+
version: NgffVersions | None = None,
|
|
517
|
+
):
|
|
518
|
+
self._group_handler = group_handler
|
|
519
|
+
self._version = version
|
|
520
|
+
|
|
521
|
+
meta = self.get_meta()
|
|
522
|
+
self._version = meta.version
|
|
523
|
+
|
|
524
|
+
def get_meta(self) -> NgioLabelsGroupMeta:
|
|
525
|
+
"""Retrieve the NGIO labels group metadata."""
|
|
526
|
+
return get_ngio_labels_group_meta(
|
|
527
|
+
group_handler=self._group_handler,
|
|
528
|
+
version=self._version,
|
|
529
|
+
)
|
|
530
|
+
|
|
531
|
+
def update_meta(self, ngio_meta: NgioLabelsGroupMeta) -> None:
|
|
532
|
+
"""Update the NGIO labels group metadata."""
|
|
533
|
+
update_ngio_labels_group_meta(
|
|
534
|
+
group_handler=self._group_handler,
|
|
535
|
+
ngio_meta=ngio_meta,
|
|
536
|
+
)
|
|
@@ -40,6 +40,7 @@ from ngio.ome_zarr_meta.ngio_specs._ngio_image import (
|
|
|
40
40
|
NgioImageLabelMeta,
|
|
41
41
|
NgioImageMeta,
|
|
42
42
|
NgioLabelMeta,
|
|
43
|
+
NgioLabelsGroupMeta,
|
|
43
44
|
)
|
|
44
45
|
from ngio.ome_zarr_meta.ngio_specs._pixel_size import PixelSize
|
|
45
46
|
|
|
@@ -62,6 +63,7 @@ __all__ = [
|
|
|
62
63
|
"NgioImageLabelMeta",
|
|
63
64
|
"NgioImageMeta",
|
|
64
65
|
"NgioLabelMeta",
|
|
66
|
+
"NgioLabelsGroupMeta",
|
|
65
67
|
"NgioPlateMeta",
|
|
66
68
|
"NgioWellMeta",
|
|
67
69
|
"PixelSize",
|
|
@@ -62,9 +62,9 @@ class NgioWellMeta(BaseModel):
|
|
|
62
62
|
@classmethod
|
|
63
63
|
def default_init(
|
|
64
64
|
cls,
|
|
65
|
-
|
|
65
|
+
ngff_version: NgffVersions = DefaultNgffVersion,
|
|
66
66
|
) -> "NgioWellMeta":
|
|
67
|
-
well = cls(images=[], version=
|
|
67
|
+
well = cls(images=[], version=ngff_version)
|
|
68
68
|
return well
|
|
69
69
|
|
|
70
70
|
@property
|
|
@@ -217,7 +217,7 @@ class NgioPlateMeta(BaseModel):
|
|
|
217
217
|
cls,
|
|
218
218
|
images: list[ImageInWellPath] | None = None,
|
|
219
219
|
name: str | None = None,
|
|
220
|
-
|
|
220
|
+
ngff_version: NgffVersions = DefaultNgffVersion,
|
|
221
221
|
) -> "NgioPlateMeta":
|
|
222
222
|
plate = cls(
|
|
223
223
|
plate=PlateWithVersion(
|
|
@@ -227,9 +227,9 @@ class NgioPlateMeta(BaseModel):
|
|
|
227
227
|
wells=[],
|
|
228
228
|
field_count=None,
|
|
229
229
|
name=name,
|
|
230
|
-
version=
|
|
230
|
+
version=ngff_version,
|
|
231
231
|
),
|
|
232
|
-
version=
|
|
232
|
+
version=ngff_version,
|
|
233
233
|
)
|
|
234
234
|
|
|
235
235
|
if images is None:
|
|
@@ -503,14 +503,14 @@ class NgioPlateMeta(BaseModel):
|
|
|
503
503
|
def derive(
|
|
504
504
|
self,
|
|
505
505
|
name: str | None = None,
|
|
506
|
-
|
|
506
|
+
ngff_version: NgffVersions | None = None,
|
|
507
507
|
keep_acquisitions: bool = False,
|
|
508
508
|
) -> "NgioPlateMeta":
|
|
509
509
|
"""Derive the plate metadata.
|
|
510
510
|
|
|
511
511
|
Args:
|
|
512
512
|
name (str): The name of the derived plate.
|
|
513
|
-
|
|
513
|
+
ngff_version (NgffVersion | None): The version of the derived plate.
|
|
514
514
|
If None, use the version of the original plate.
|
|
515
515
|
keep_acquisitions (bool): If True, keep the acquisitions in the plate.
|
|
516
516
|
"""
|
|
@@ -522,8 +522,8 @@ class NgioPlateMeta(BaseModel):
|
|
|
522
522
|
else:
|
|
523
523
|
acquisitions = None
|
|
524
524
|
|
|
525
|
-
if
|
|
526
|
-
|
|
525
|
+
if ngff_version is None:
|
|
526
|
+
ngff_version = self.version
|
|
527
527
|
|
|
528
528
|
return NgioPlateMeta(
|
|
529
529
|
plate=PlateWithVersion(
|
|
@@ -533,7 +533,7 @@ class NgioPlateMeta(BaseModel):
|
|
|
533
533
|
wells=[],
|
|
534
534
|
field_count=self.plate.field_count,
|
|
535
535
|
name=name,
|
|
536
|
-
version=
|
|
536
|
+
version=ngff_version,
|
|
537
537
|
),
|
|
538
|
-
version=
|
|
538
|
+
version=ngff_version,
|
|
539
539
|
)
|
|
@@ -41,6 +41,13 @@ class ImageLabelSource(BaseModel):
|
|
|
41
41
|
return cls(version=version, source={"image": "../../"})
|
|
42
42
|
|
|
43
43
|
|
|
44
|
+
class NgioLabelsGroupMeta(BaseModel):
|
|
45
|
+
"""Metadata model for the /labels group in OME-NGFF."""
|
|
46
|
+
|
|
47
|
+
version: NgffVersions
|
|
48
|
+
labels: list[str]
|
|
49
|
+
|
|
50
|
+
|
|
44
51
|
class AbstractNgioImageMeta:
|
|
45
52
|
"""Base class for ImageMeta and LabelMeta."""
|
|
46
53
|
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
from ngio.ome_zarr_meta.v04._v04_spec import (
|
|
4
4
|
ngio_to_v04_image_meta,
|
|
5
5
|
ngio_to_v04_label_meta,
|
|
6
|
+
ngio_to_v04_labels_group_meta,
|
|
6
7
|
ngio_to_v04_plate_meta,
|
|
7
8
|
ngio_to_v04_well_meta,
|
|
8
9
|
v04_to_ngio_image_meta,
|
|
9
10
|
v04_to_ngio_label_meta,
|
|
11
|
+
v04_to_ngio_labels_group_meta,
|
|
10
12
|
v04_to_ngio_plate_meta,
|
|
11
13
|
v04_to_ngio_well_meta,
|
|
12
14
|
)
|
|
@@ -14,10 +16,12 @@ from ngio.ome_zarr_meta.v04._v04_spec import (
|
|
|
14
16
|
__all__ = [
|
|
15
17
|
"ngio_to_v04_image_meta",
|
|
16
18
|
"ngio_to_v04_label_meta",
|
|
19
|
+
"ngio_to_v04_labels_group_meta",
|
|
17
20
|
"ngio_to_v04_plate_meta",
|
|
18
21
|
"ngio_to_v04_well_meta",
|
|
19
22
|
"v04_to_ngio_image_meta",
|
|
20
23
|
"v04_to_ngio_label_meta",
|
|
24
|
+
"v04_to_ngio_labels_group_meta",
|
|
21
25
|
"v04_to_ngio_plate_meta",
|
|
22
26
|
"v04_to_ngio_well_meta",
|
|
23
27
|
]
|
|
@@ -16,7 +16,8 @@ from ome_zarr_models.v04.coordinate_transformations import (
|
|
|
16
16
|
)
|
|
17
17
|
from ome_zarr_models.v04.hcs import HCSAttrs as HCSAttrsV04
|
|
18
18
|
from ome_zarr_models.v04.image import ImageAttrs as ImageAttrsV04
|
|
19
|
-
from ome_zarr_models.v04.image_label import ImageLabelAttrs as
|
|
19
|
+
from ome_zarr_models.v04.image_label import ImageLabelAttrs as ImageLabelAttrsV04
|
|
20
|
+
from ome_zarr_models.v04.labels import LabelsAttrs as LabelsAttrsV04
|
|
20
21
|
from ome_zarr_models.v04.multiscales import Dataset as DatasetV04
|
|
21
22
|
from ome_zarr_models.v04.multiscales import Multiscale as MultiscaleV04
|
|
22
23
|
from ome_zarr_models.v04.multiscales import ValidTransform as ValidTransformV04
|
|
@@ -36,6 +37,7 @@ from ngio.ome_zarr_meta.ngio_specs import (
|
|
|
36
37
|
ImageLabelSource,
|
|
37
38
|
NgioImageMeta,
|
|
38
39
|
NgioLabelMeta,
|
|
40
|
+
NgioLabelsGroupMeta,
|
|
39
41
|
NgioPlateMeta,
|
|
40
42
|
NgioWellMeta,
|
|
41
43
|
default_channel_name,
|
|
@@ -231,7 +233,7 @@ def v04_to_ngio_label_meta(
|
|
|
231
233
|
Returns:
|
|
232
234
|
NgioImageMeta: The ngio image metadata.
|
|
233
235
|
"""
|
|
234
|
-
v04_label =
|
|
236
|
+
v04_label = ImageLabelAttrsV04(**metadata)
|
|
235
237
|
|
|
236
238
|
if len(v04_label.multiscales) > 1:
|
|
237
239
|
raise NotImplementedError(
|
|
@@ -381,10 +383,26 @@ def ngio_to_v04_label_meta(metadata: NgioLabelMeta) -> dict:
|
|
|
381
383
|
"multiscales": [v04_muliscale],
|
|
382
384
|
"image-label": metadata.image_label.model_dump(),
|
|
383
385
|
}
|
|
384
|
-
v04_label =
|
|
386
|
+
v04_label = ImageLabelAttrsV04(**labels_meta)
|
|
385
387
|
return v04_label.model_dump(exclude_none=True, by_alias=True)
|
|
386
388
|
|
|
387
389
|
|
|
390
|
+
def v04_to_ngio_labels_group_meta(
|
|
391
|
+
metadata: dict,
|
|
392
|
+
) -> NgioLabelsGroupMeta:
|
|
393
|
+
"""Convert a v04 label group metadata to a ngio label group metadata.
|
|
394
|
+
|
|
395
|
+
Args:
|
|
396
|
+
metadata (dict): The v04 label group metadata.
|
|
397
|
+
|
|
398
|
+
Returns:
|
|
399
|
+
NgioLabelGroupMeta: The ngio label group metadata.
|
|
400
|
+
"""
|
|
401
|
+
v04_label_group = LabelsAttrsV04(**metadata).model_dump()
|
|
402
|
+
labels = v04_label_group.get("labels", [])
|
|
403
|
+
return NgioLabelsGroupMeta(labels=labels, version="0.4")
|
|
404
|
+
|
|
405
|
+
|
|
388
406
|
def v04_to_ngio_well_meta(
|
|
389
407
|
metadata: dict,
|
|
390
408
|
) -> NgioWellMeta:
|
|
@@ -440,3 +458,16 @@ def ngio_to_v04_plate_meta(metadata: NgioPlateMeta) -> dict:
|
|
|
440
458
|
"""
|
|
441
459
|
v04_plate = HCSAttrsV04(**metadata.model_dump())
|
|
442
460
|
return v04_plate.model_dump(exclude_none=True, by_alias=True)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def ngio_to_v04_labels_group_meta(metadata: NgioLabelsGroupMeta) -> dict:
|
|
464
|
+
"""Convert a ngio label group metadata to a v04 label group metadata.
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
metadata (NgioLabelsGroupMeta): The ngio label group metadata.
|
|
468
|
+
|
|
469
|
+
Returns:
|
|
470
|
+
dict: The v04 label group metadata.
|
|
471
|
+
"""
|
|
472
|
+
v04_label_group = LabelsAttrsV04(labels=metadata.labels)
|
|
473
|
+
return v04_label_group.model_dump(exclude_none=True, by_alias=True)
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
from ngio.ome_zarr_meta.v05._v05_spec import (
|
|
4
4
|
ngio_to_v05_image_meta,
|
|
5
5
|
ngio_to_v05_label_meta,
|
|
6
|
+
ngio_to_v05_labels_group_meta,
|
|
6
7
|
ngio_to_v05_plate_meta,
|
|
7
8
|
ngio_to_v05_well_meta,
|
|
8
9
|
v05_to_ngio_image_meta,
|
|
9
10
|
v05_to_ngio_label_meta,
|
|
11
|
+
v05_to_ngio_labels_group_meta,
|
|
10
12
|
v05_to_ngio_plate_meta,
|
|
11
13
|
v05_to_ngio_well_meta,
|
|
12
14
|
)
|
|
@@ -14,10 +16,12 @@ from ngio.ome_zarr_meta.v05._v05_spec import (
|
|
|
14
16
|
__all__ = [
|
|
15
17
|
"ngio_to_v05_image_meta",
|
|
16
18
|
"ngio_to_v05_label_meta",
|
|
19
|
+
"ngio_to_v05_labels_group_meta",
|
|
17
20
|
"ngio_to_v05_plate_meta",
|
|
18
21
|
"ngio_to_v05_well_meta",
|
|
19
22
|
"v05_to_ngio_image_meta",
|
|
20
23
|
"v05_to_ngio_label_meta",
|
|
24
|
+
"v05_to_ngio_labels_group_meta",
|
|
21
25
|
"v05_to_ngio_plate_meta",
|
|
22
26
|
"v05_to_ngio_well_meta",
|
|
23
27
|
]
|
|
@@ -19,7 +19,9 @@ from ome_zarr_models.v05.coordinate_transformations import (
|
|
|
19
19
|
)
|
|
20
20
|
from ome_zarr_models.v05.hcs import HCSAttrs as HCSAttrsV05
|
|
21
21
|
from ome_zarr_models.v05.image import ImageAttrs as ImageAttrsV05
|
|
22
|
-
from ome_zarr_models.v05.image_label import ImageLabelAttrs as
|
|
22
|
+
from ome_zarr_models.v05.image_label import ImageLabelAttrs as ImageLabelAttrsV05
|
|
23
|
+
from ome_zarr_models.v05.labels import Labels as Labels
|
|
24
|
+
from ome_zarr_models.v05.labels import LabelsAttrs as LabelsAttrsV05
|
|
23
25
|
from ome_zarr_models.v05.multiscales import Dataset as DatasetV05
|
|
24
26
|
from ome_zarr_models.v05.multiscales import Multiscale as MultiscaleV05
|
|
25
27
|
from ome_zarr_models.v05.multiscales import ValidTransform as ValidTransformV05
|
|
@@ -37,6 +39,7 @@ from ngio.ome_zarr_meta.ngio_specs import (
|
|
|
37
39
|
ImageLabelSource,
|
|
38
40
|
NgioImageMeta,
|
|
39
41
|
NgioLabelMeta,
|
|
42
|
+
NgioLabelsGroupMeta,
|
|
40
43
|
NgioPlateMeta,
|
|
41
44
|
NgioWellMeta,
|
|
42
45
|
default_channel_name,
|
|
@@ -53,7 +56,7 @@ class ImageV05WithOmero(BaseModel):
|
|
|
53
56
|
|
|
54
57
|
|
|
55
58
|
class ImageLabelV05(BaseModel):
|
|
56
|
-
ome:
|
|
59
|
+
ome: ImageLabelAttrsV05
|
|
57
60
|
|
|
58
61
|
|
|
59
62
|
def _v05_omero_to_channels(v05_omero: OmeroV05 | None) -> ChannelsMeta | None:
|
|
@@ -401,7 +404,7 @@ def ngio_to_v05_label_meta(metadata: NgioLabelMeta) -> dict:
|
|
|
401
404
|
"multiscales": [v05_muliscale],
|
|
402
405
|
"image-label": metadata.image_label.model_dump(),
|
|
403
406
|
}
|
|
404
|
-
v05_label =
|
|
407
|
+
v05_label = ImageLabelAttrsV05(**labels_meta, version="0.5")
|
|
405
408
|
v05_label = ImageLabelV05(
|
|
406
409
|
ome=v05_label,
|
|
407
410
|
)
|
|
@@ -473,3 +476,36 @@ def ngio_to_v05_plate_meta(metadata: NgioPlateMeta) -> dict:
|
|
|
473
476
|
v05_plate = HCSAttrsV05(**metadata.model_dump())
|
|
474
477
|
v05_plate = HCSV05(ome=v05_plate)
|
|
475
478
|
return v05_plate.model_dump(exclude_none=True, by_alias=True)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
class LabelsV05(BaseModel):
|
|
482
|
+
ome: LabelsAttrsV05
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
def v05_to_ngio_labels_group_meta(
|
|
486
|
+
metadata: dict,
|
|
487
|
+
) -> NgioLabelsGroupMeta:
|
|
488
|
+
"""Convert a v04 label group metadata to a ngio label group metadata.
|
|
489
|
+
|
|
490
|
+
Args:
|
|
491
|
+
metadata (dict): The v04 label group metadata.
|
|
492
|
+
|
|
493
|
+
Returns:
|
|
494
|
+
NgioLabelGroupMeta: The ngio label group metadata.
|
|
495
|
+
"""
|
|
496
|
+
v05_label_group = LabelsV05(**metadata)
|
|
497
|
+
return NgioLabelsGroupMeta(labels=v05_label_group.ome.labels, version="0.5")
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
def ngio_to_v05_labels_group_meta(metadata: NgioLabelsGroupMeta) -> dict:
|
|
501
|
+
"""Convert a ngio label group metadata to a v05 label group metadata.
|
|
502
|
+
|
|
503
|
+
Args:
|
|
504
|
+
metadata (NgioLabelsGroupMeta): The ngio label group metadata.
|
|
505
|
+
|
|
506
|
+
Returns:
|
|
507
|
+
dict: The v05 label group metadata.
|
|
508
|
+
"""
|
|
509
|
+
v05_labels_attrs = LabelsAttrsV05(labels=metadata.labels, version="0.5")
|
|
510
|
+
v05_labels_group = LabelsV05(ome=v05_labels_attrs)
|
|
511
|
+
return v05_labels_group.model_dump(exclude_none=True, by_alias=True)
|
ngio/tables/_tables_container.py
CHANGED
|
@@ -311,6 +311,27 @@ class TablesContainer:
|
|
|
311
311
|
backend=backend,
|
|
312
312
|
) # type: ignore[return-value]
|
|
313
313
|
|
|
314
|
+
def delete(self, name: str, missing_ok: bool = False) -> None:
|
|
315
|
+
"""Delete a table from the group.
|
|
316
|
+
|
|
317
|
+
Args:
|
|
318
|
+
name (str): The name of the table to delete.
|
|
319
|
+
missing_ok (bool): If True, do not raise an error if
|
|
320
|
+
the table does not exist.
|
|
321
|
+
"""
|
|
322
|
+
existing_tables = self._get_tables_list()
|
|
323
|
+
if name not in existing_tables:
|
|
324
|
+
if missing_ok:
|
|
325
|
+
return
|
|
326
|
+
raise NgioValueError(
|
|
327
|
+
f"Table '{name}' not found in the Tables group. "
|
|
328
|
+
f"Available tables: {existing_tables}"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
self._group_handler.delete_group(name)
|
|
332
|
+
existing_tables.remove(name)
|
|
333
|
+
self._group_handler.write_attrs({"tables": existing_tables})
|
|
334
|
+
|
|
314
335
|
def add(
|
|
315
336
|
self,
|
|
316
337
|
name: str,
|
ngio/tables/backends/_anndata.py
CHANGED
ngio/utils/__init__.py
CHANGED
|
@@ -17,6 +17,7 @@ from ngio.utils._fractal_fsspec_store import fractal_fsspec_store
|
|
|
17
17
|
from ngio.utils._zarr_utils import (
|
|
18
18
|
AccessModeLiteral,
|
|
19
19
|
NgioCache,
|
|
20
|
+
NgioSupportedStore,
|
|
20
21
|
StoreOrGroup,
|
|
21
22
|
ZarrGroupHandler,
|
|
22
23
|
copy_group,
|
|
@@ -29,6 +30,7 @@ __all__ = [
|
|
|
29
30
|
"NgioError",
|
|
30
31
|
"NgioFileExistsError",
|
|
31
32
|
"NgioFileNotFoundError",
|
|
33
|
+
"NgioSupportedStore",
|
|
32
34
|
"NgioTableValidationError",
|
|
33
35
|
"NgioValidationError",
|
|
34
36
|
"NgioValueError",
|
ngio/utils/_zarr_utils.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import json
|
|
4
4
|
import warnings
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Literal
|
|
6
|
+
from typing import Literal, TypeAlias
|
|
7
7
|
|
|
8
8
|
import dask.array as da
|
|
9
9
|
import fsspec
|
|
@@ -26,17 +26,11 @@ AccessModeLiteral = Literal["r", "r+", "w", "w-", "a"]
|
|
|
26
26
|
# StoreLike is more restrictive than it could be
|
|
27
27
|
# but to make sure we can handle the store correctly
|
|
28
28
|
# we need to be more restrictive
|
|
29
|
-
NgioSupportedStore = (
|
|
30
|
-
str
|
|
31
|
-
| Path
|
|
32
|
-
| fsspec.mapping.FSMap
|
|
33
|
-
| FsspecStore
|
|
34
|
-
| MemoryStore
|
|
35
|
-
| LocalStore
|
|
36
|
-
| ZipStore
|
|
29
|
+
NgioSupportedStore: TypeAlias = (
|
|
30
|
+
str | Path | fsspec.mapping.FSMap | FsspecStore | MemoryStore | dict | LocalStore
|
|
37
31
|
)
|
|
38
|
-
GenericStore =
|
|
39
|
-
StoreOrGroup =
|
|
32
|
+
GenericStore: TypeAlias = NgioSupportedStore | Store
|
|
33
|
+
StoreOrGroup: TypeAlias = NgioSupportedStore | zarr.Group
|
|
40
34
|
|
|
41
35
|
|
|
42
36
|
def _check_store(store) -> NgioSupportedStore:
|
|
@@ -398,6 +392,12 @@ class ZarrGroupHandler:
|
|
|
398
392
|
self._group_cache._cache.pop(path, None)
|
|
399
393
|
self._handlers_cache._cache.pop(path, None)
|
|
400
394
|
|
|
395
|
+
def delete_self(self) -> None:
|
|
396
|
+
"""Delete the current group."""
|
|
397
|
+
if self.group.read_only:
|
|
398
|
+
raise NgioValueError("Cannot delete a group in read only mode.")
|
|
399
|
+
self.group.__delitem__("/")
|
|
400
|
+
|
|
401
401
|
def copy_group(self, dest_group: zarr.Group):
|
|
402
402
|
"""Copy the group to a new store."""
|
|
403
403
|
copy_group(self.group, dest_group)
|
|
@@ -504,7 +504,9 @@ def _zarr_python_copy(src_group: zarr.Group, dest_group: zarr.Group):
|
|
|
504
504
|
_zarr_python_copy(subgroup, dest_subgroup)
|
|
505
505
|
|
|
506
506
|
|
|
507
|
-
def copy_group(
|
|
507
|
+
def copy_group(
|
|
508
|
+
src_group: zarr.Group, dest_group: zarr.Group, suppress_warnings: bool = False
|
|
509
|
+
):
|
|
508
510
|
if src_group.metadata.zarr_format != dest_group.metadata.zarr_format:
|
|
509
511
|
raise NgioValueError(
|
|
510
512
|
"Different Zarr format versions between source and destination, "
|
|
@@ -521,11 +523,12 @@ def copy_group(src_group: zarr.Group, dest_group: zarr.Group):
|
|
|
521
523
|
):
|
|
522
524
|
_fsspec_copy(src_group.store, src_group.path, dest_group.store, dest_group.path)
|
|
523
525
|
return
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
526
|
+
if not suppress_warnings:
|
|
527
|
+
warnings.warn(
|
|
528
|
+
"Fsspec copy not possible, falling back to Zarr Python API for the copy. "
|
|
529
|
+
"This will preserve some tabular data non-zarr native (parquet, and csv), "
|
|
530
|
+
"and it will be slower for large datasets.",
|
|
531
|
+
UserWarning,
|
|
532
|
+
stacklevel=2,
|
|
533
|
+
)
|
|
531
534
|
_zarr_python_copy(src_group, dest_group)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ngio/__init__.py,sha256=
|
|
1
|
+
ngio/__init__.py,sha256=kyInohhWrBs4qkbMYFIQeAiy1CDpvbSOtXB4buFocbw,1535
|
|
2
2
|
ngio/common/__init__.py,sha256=F3zAHQIhwig1xUA-SpmFVRtMeOrEj926-nHWhj-wS6c,684
|
|
3
3
|
ngio/common/_dimensions.py,sha256=w8PYgyWxA8hgJETjFbw5CXf7WrasCL5FbzgfL1in86M,11361
|
|
4
4
|
ngio/common/_masking_roi.py,sha256=YSEZ5nv3-TqMrQ04cI70U9NGx3LSy7Z1_cbw_NE-78k,4831
|
|
@@ -15,15 +15,15 @@ ngio/experimental/iterators/_mappers.py,sha256=VVVsjems57wJUnWeufUFcgqa23k7VPeFL
|
|
|
15
15
|
ngio/experimental/iterators/_rois_utils.py,sha256=5foGjt3qrACNrO29LlvSUbJ4yfI0z6MhU2oVCzEU214,4363
|
|
16
16
|
ngio/experimental/iterators/_segmentation.py,sha256=xzotGvTn04HPeMeXZ_URnQqWco6d2lH6Ng6vkCUh9NM,9153
|
|
17
17
|
ngio/hcs/__init__.py,sha256=G8j9vD-liLeB_UeGtKYIgshWvJnUA6ks9GwjvWBLdHs,357
|
|
18
|
-
ngio/hcs/_plate.py,sha256
|
|
18
|
+
ngio/hcs/_plate.py,sha256=l2a2ZMniutxRzZ88HOYwajug-svr6OanREG5mTy39x0,45773
|
|
19
19
|
ngio/images/__init__.py,sha256=9Whvt7GTiCgT_vXaEEqGnDaY1-UsRk3dhLTv091F_g4,1211
|
|
20
|
-
ngio/images/_abstract_image.py,sha256=
|
|
20
|
+
ngio/images/_abstract_image.py,sha256=PyginvViqjKNsnUBF8yX7pUI2fHDJq4QthjeQzJWzDU,31906
|
|
21
21
|
ngio/images/_create_synt_container.py,sha256=Cvg_J0KSxK0PH8IBzlKLIcCwH2vRTuBj-nZo5uOKXXk,5182
|
|
22
22
|
ngio/images/_create_utils.py,sha256=hXVbFM8D_0mZTfBAhcZiuGX2lLXSJCep8THuxpH4d4E,14374
|
|
23
|
-
ngio/images/_image.py,sha256=
|
|
24
|
-
ngio/images/_label.py,sha256=
|
|
23
|
+
ngio/images/_image.py,sha256=TiKQXnzm0Mhxx6zmS4CVThcIJLV_guwjbVx7ZOd_0IU,34197
|
|
24
|
+
ngio/images/_label.py,sha256=MYmYIikKyf2nDqrFd8xZ3nYR-JKe-JneUNuE1jEPHdA,15682
|
|
25
25
|
ngio/images/_masked_image.py,sha256=YhbBzgPZMav6rX0WYue1BaxAzEIsfaQrxUIOK6ZWZcw,18848
|
|
26
|
-
ngio/images/_ome_zarr_container.py,sha256=
|
|
26
|
+
ngio/images/_ome_zarr_container.py,sha256=aa8l8wfZ8p0YpsdBd8ixvrdgVcdZs6RnSOpUWPE1ixU,48247
|
|
27
27
|
ngio/images/_table_ops.py,sha256=jFv_AMqoB4JBpoWsMtZppZVW7dAOC_u-JpfNm8b33kY,15292
|
|
28
28
|
ngio/io_pipes/__init__.py,sha256=arW_7GWzZs82kPNKdm_6B1sIDFV0lWwp-ZaORr9Q1FQ,2412
|
|
29
29
|
ngio/io_pipes/_io_pipes.py,sha256=l85mmjj1l0uYU3qzsSHg9l8cMIEevInm_MTD-8MlXgw,10603
|
|
@@ -36,21 +36,21 @@ ngio/io_pipes/_ops_slices.py,sha256=hHMIOQ_niUSK9uFl8P2-10dP_K4GX3Do6vivN4fGRE0,
|
|
|
36
36
|
ngio/io_pipes/_ops_slices_utils.py,sha256=mps_I0eTI4gdBVM9MCKsd8rCyefdo9bIK9fEmqwr23E,6633
|
|
37
37
|
ngio/io_pipes/_ops_transforms.py,sha256=uITs6v6sZ7DQ_Hpw3JdX8MuPOzir-bihvGzY84Qn4wY,2934
|
|
38
38
|
ngio/io_pipes/_zoom_transform.py,sha256=WBY1tO6_Qhf8FaDujfTdipuuqFf7PSi204wx5VKKs88,6884
|
|
39
|
-
ngio/ome_zarr_meta/__init__.py,sha256=
|
|
40
|
-
ngio/ome_zarr_meta/_meta_handlers.py,sha256=
|
|
41
|
-
ngio/ome_zarr_meta/ngio_specs/__init__.py,sha256=
|
|
39
|
+
ngio/ome_zarr_meta/__init__.py,sha256=0VVB0r5CTjVqOsC8pa_Jf9H8ctPzTLRmC6LJqWWAs7Q,1371
|
|
40
|
+
ngio/ome_zarr_meta/_meta_handlers.py,sha256=M8bHeWUjSgPCg-JTvnbwoL5sTPyGrWb2j8d-3r0Ua6Q,16172
|
|
41
|
+
ngio/ome_zarr_meta/ngio_specs/__init__.py,sha256=sYGlV2-0-z-a1gDFlk_pCjgcdRsgbwBf72vM2ZAVTtQ,1750
|
|
42
42
|
ngio/ome_zarr_meta/ngio_specs/_axes.py,sha256=CY63mWf7_ALoi7o_1QDVK1lAG56xN0gvgwfcuNRmMIg,16446
|
|
43
43
|
ngio/ome_zarr_meta/ngio_specs/_channels.py,sha256=TDxIy-yVc2YaWPIFJRYnYwZbA8O5Ee_OiWppHYrEdpU,16647
|
|
44
44
|
ngio/ome_zarr_meta/ngio_specs/_dataset.py,sha256=5YdAplk90koX3vjoIJimms-CJYxt095rJ9YagZSQg88,2872
|
|
45
|
-
ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py,sha256
|
|
46
|
-
ngio/ome_zarr_meta/ngio_specs/_ngio_image.py,sha256=
|
|
45
|
+
ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py,sha256=-YOC39YXDk5ojFkpvj8Vup6A3tAtHotV9e8QNZ0l_Cs,16999
|
|
46
|
+
ngio/ome_zarr_meta/ngio_specs/_ngio_image.py,sha256=g32ytm4jxDR5duHyO6_kU0MrcE2NzI8V4EWCYanuIrI,14591
|
|
47
47
|
ngio/ome_zarr_meta/ngio_specs/_pixel_size.py,sha256=4VF1djY9T5tp6GCJXppFrUJwALI1XgIm0imoM5rNvdE,3876
|
|
48
|
-
ngio/ome_zarr_meta/v04/__init__.py,sha256=
|
|
48
|
+
ngio/ome_zarr_meta/v04/__init__.py,sha256=tRt3zGelL948EoLfy_gW-LKvJcBbSkbT9kwIgU0hQV8,721
|
|
49
49
|
ngio/ome_zarr_meta/v04/_custom_models.py,sha256=5GxiDERvLuvq4QvApcA6EiKLS6hLFX1R0R_9rSaa85A,530
|
|
50
|
-
ngio/ome_zarr_meta/v04/_v04_spec.py,sha256=
|
|
51
|
-
ngio/ome_zarr_meta/v05/__init__.py,sha256=
|
|
50
|
+
ngio/ome_zarr_meta/v04/_v04_spec.py,sha256=PRkxNeIDCCxG4J5HD3hQPrV-iPW_KAs4HyjyrT4i_NI,15362
|
|
51
|
+
ngio/ome_zarr_meta/v05/__init__.py,sha256=B6VIUkrm5W4lcrvy4R7c7NZ6dEx-0a1AhqhZ7snCnCo,721
|
|
52
52
|
ngio/ome_zarr_meta/v05/_custom_models.py,sha256=ZN3bE9nwx4y3tElhsYafI4S2zp_WzdkQKcyuuBiaXXo,530
|
|
53
|
-
ngio/ome_zarr_meta/v05/_v05_spec.py,sha256=
|
|
53
|
+
ngio/ome_zarr_meta/v05/_v05_spec.py,sha256=qjSRSkz20jQwd47tzHjeX5ECYBbZoU6q8lnALFeAZts,16285
|
|
54
54
|
ngio/resources/__init__.py,sha256=4E4TXTNYEgRHt26C1XcC4pPobJJsmZRYm1Ml4uAuAkE,1664
|
|
55
55
|
ngio/resources/resource_model.py,sha256=eE1m0dyk-2psPC4X8Ifyan524QHUOd52TEQdvoU0m8I,861
|
|
56
56
|
ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/mask.png,sha256=g3QmxQdmeciAtBe5cTCRfR6yw3keG9cBYfjizMo6EGo,11890
|
|
@@ -58,10 +58,10 @@ ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/nuclei.png,sha
|
|
|
58
58
|
ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/raw.jpg,sha256=82lejQAIokj5w9g-qqhysDTWpHtNvJTkdURG_BjqIxQ,37743
|
|
59
59
|
ngio/tables/__init__.py,sha256=_BV3sclNMLITu_J8_3DkkUrCB6Kro0HzeWLDCD1ivKM,877
|
|
60
60
|
ngio/tables/_abstract_table.py,sha256=rwGa47TzbFmosucBWVfFq6JEXtgGvOdUVtU9DIelV88,8204
|
|
61
|
-
ngio/tables/_tables_container.py,sha256=
|
|
61
|
+
ngio/tables/_tables_container.py,sha256=1HXIfofOtwJr6XQ_ILM8-rr7Cxq1XmV4BzL5Q2g2tLk,13097
|
|
62
62
|
ngio/tables/backends/__init__.py,sha256=MwSRXNF1rWQBFOTDA_vT3oGoNZpviVgytsL5Txnu08I,1619
|
|
63
63
|
ngio/tables/backends/_abstract_backend.py,sha256=M1ogsBpWBiQMV65YweZhA845PAtkzG2BsZCPN_7Xp8U,7613
|
|
64
|
-
ngio/tables/backends/_anndata.py,sha256=
|
|
64
|
+
ngio/tables/backends/_anndata.py,sha256=T67N-SPNO4eqe7-VGAUfgtwaSy_o2DqCvZgE2yRH5jE,4582
|
|
65
65
|
ngio/tables/backends/_anndata_utils.py,sha256=PoHiLkGeDhBgPsEMJi9QH-NejHmfrfILcwj1CYubyCM,3095
|
|
66
66
|
ngio/tables/backends/_csv.py,sha256=iZJNLHOXYysV_2iq6Lmekq0XXYsVE7OYrKz2HP2TU9w,479
|
|
67
67
|
ngio/tables/backends/_json.py,sha256=A4iaKOIc5Q_XKDOm321QNqAN4DAOuA-dEinnfTlk1Fk,3091
|
|
@@ -76,13 +76,13 @@ ngio/tables/v1/_generic_table.py,sha256=1ktJHeuv7U1g5Z8PFUuTkCjOzcYMQd8xegKHKUed
|
|
|
76
76
|
ngio/tables/v1/_roi_table.py,sha256=DuKJlDmtQtLOfL0g4CSdncfm4hBsKWG6F6fkMUpt4Nk,17821
|
|
77
77
|
ngio/transforms/__init__.py,sha256=JA0-Ui7skbXkm9ofN-AEhU1FTLutkMkwTdVD-310frQ,113
|
|
78
78
|
ngio/transforms/_zoom.py,sha256=otyE-vxFnywUJ8U4mHjat-bNG_7_jv62ckTpqDMxyVQ,550
|
|
79
|
-
ngio/utils/__init__.py,sha256=
|
|
79
|
+
ngio/utils/__init__.py,sha256=d2OHQGMFPpf8-_ipuqquxtqCNGJpX5yXt34A65nScUU,1037
|
|
80
80
|
ngio/utils/_cache.py,sha256=Ey9fgc_BTdMyqg6c80C0CuGDhOafln8-3e_1MQ0MFzw,1283
|
|
81
81
|
ngio/utils/_datasets.py,sha256=6GtxfPkjutNaeg5BHuJDBP0GudvQXHLU6mmHp_o0bGA,5650
|
|
82
82
|
ngio/utils/_errors.py,sha256=pKQ12LUjQLYE1nUawemA5h7HsgznjaSvV1n2PQU33N0,759
|
|
83
83
|
ngio/utils/_fractal_fsspec_store.py,sha256=RdcCFOgHexRKX9zZvJV5RI-5OPc7VOPS6q_IeRxm24I,1548
|
|
84
|
-
ngio/utils/_zarr_utils.py,sha256=
|
|
85
|
-
ngio-0.5.
|
|
86
|
-
ngio-0.5.
|
|
87
|
-
ngio-0.5.
|
|
88
|
-
ngio-0.5.
|
|
84
|
+
ngio/utils/_zarr_utils.py,sha256=MVbW-a0S3iuzMaknqkliJa_lp8i6mEO4Q2YN2XxmeDw,18158
|
|
85
|
+
ngio-0.5.0b2.dist-info/METADATA,sha256=r1un40xipjI7Kctjt0Gj9-B28PjO5pBSPWxOyoQjXCc,6294
|
|
86
|
+
ngio-0.5.0b2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
87
|
+
ngio-0.5.0b2.dist-info/licenses/LICENSE,sha256=UgN_a1QCeNh9rZWfz-wORQFxE3elQzLWPQaoK6N6fxQ,1502
|
|
88
|
+
ngio-0.5.0b2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|