ngio 0.4.0a1__py3-none-any.whl → 0.4.0a2__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/common/_array_io_pipes.py +11 -6
- ngio/common/_roi.py +12 -0
- ngio/experimental/iterators/_segmentation.py +4 -0
- ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/mask.png +0 -0
- {ngio-0.4.0a1.dist-info → ngio-0.4.0a2.dist-info}/METADATA +1 -1
- {ngio-0.4.0a1.dist-info → ngio-0.4.0a2.dist-info}/RECORD +8 -8
- {ngio-0.4.0a1.dist-info → ngio-0.4.0a2.dist-info}/WHEEL +0 -0
- {ngio-0.4.0a1.dist-info → ngio-0.4.0a2.dist-info}/licenses/LICENSE +0 -0
ngio/common/_array_io_pipes.py
CHANGED
|
@@ -87,6 +87,7 @@ def build_numpy_getter(
|
|
|
87
87
|
slicing_dict=slicing_dict,
|
|
88
88
|
remove_channel_selection=remove_channel_selection,
|
|
89
89
|
)
|
|
90
|
+
|
|
90
91
|
return lambda: _numpy_get_pipe(
|
|
91
92
|
zarr_array=zarr_array,
|
|
92
93
|
slicing_ops=slicing_ops,
|
|
@@ -285,6 +286,7 @@ def build_masked_numpy_getter(
|
|
|
285
286
|
label_slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
286
287
|
fill_value: int | float = 0,
|
|
287
288
|
allow_scaling: bool = True,
|
|
289
|
+
remove_channel_selection: bool = False,
|
|
288
290
|
) -> Callable[[], np.ndarray]:
|
|
289
291
|
"""Get a numpy array from the zarr array with the given slice kwargs."""
|
|
290
292
|
slicing_dict = slicing_dict or {}
|
|
@@ -296,7 +298,7 @@ def build_masked_numpy_getter(
|
|
|
296
298
|
axes_order=axes_order,
|
|
297
299
|
transforms=transforms,
|
|
298
300
|
slicing_dict=slicing_dict,
|
|
299
|
-
remove_channel_selection=
|
|
301
|
+
remove_channel_selection=remove_channel_selection,
|
|
300
302
|
)
|
|
301
303
|
|
|
302
304
|
label_data_getter = build_numpy_getter(
|
|
@@ -379,6 +381,7 @@ def build_masked_dask_getter(
|
|
|
379
381
|
label_slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
380
382
|
fill_value: int | float = 0,
|
|
381
383
|
allow_scaling: bool = True,
|
|
384
|
+
remove_channel_selection: bool = False,
|
|
382
385
|
) -> Callable[[], DaskArray]:
|
|
383
386
|
"""Get a dask array from the zarr array with the given slice kwargs."""
|
|
384
387
|
slicing_dict = slicing_dict or {}
|
|
@@ -390,7 +393,7 @@ def build_masked_dask_getter(
|
|
|
390
393
|
axes_order=axes_order,
|
|
391
394
|
transforms=transforms,
|
|
392
395
|
slicing_dict=slicing_dict,
|
|
393
|
-
remove_channel_selection=
|
|
396
|
+
remove_channel_selection=remove_channel_selection,
|
|
394
397
|
)
|
|
395
398
|
|
|
396
399
|
label_data_getter = build_dask_getter(
|
|
@@ -433,6 +436,7 @@ def build_masked_numpy_setter(
|
|
|
433
436
|
data_getter: Callable[[], np.ndarray] | None = None,
|
|
434
437
|
label_data_getter: Callable[[], np.ndarray] | None = None,
|
|
435
438
|
allow_scaling: bool = True,
|
|
439
|
+
remove_channel_selection: bool = False,
|
|
436
440
|
) -> Callable[[np.ndarray], None]:
|
|
437
441
|
"""Set a numpy array to the zarr array with the given slice kwargs."""
|
|
438
442
|
slicing_dict = slicing_dict or {}
|
|
@@ -445,7 +449,7 @@ def build_masked_numpy_setter(
|
|
|
445
449
|
axes_order=axes_order,
|
|
446
450
|
transforms=transforms,
|
|
447
451
|
slicing_dict=slicing_dict,
|
|
448
|
-
remove_channel_selection=
|
|
452
|
+
remove_channel_selection=remove_channel_selection,
|
|
449
453
|
)
|
|
450
454
|
|
|
451
455
|
if label_data_getter is None:
|
|
@@ -464,7 +468,7 @@ def build_masked_numpy_setter(
|
|
|
464
468
|
axes_order=axes_order,
|
|
465
469
|
transforms=transforms,
|
|
466
470
|
slicing_dict=slicing_dict,
|
|
467
|
-
remove_channel_selection=
|
|
471
|
+
remove_channel_selection=remove_channel_selection,
|
|
468
472
|
)
|
|
469
473
|
|
|
470
474
|
def set_patch_masked_as_numpy(patch: np.ndarray) -> None:
|
|
@@ -498,6 +502,7 @@ def build_masked_dask_setter(
|
|
|
498
502
|
data_getter: Callable[[], DaskArray] | None = None,
|
|
499
503
|
label_data_getter: Callable[[], DaskArray] | None = None,
|
|
500
504
|
allow_scaling: bool = True,
|
|
505
|
+
remove_channel_selection: bool = False,
|
|
501
506
|
) -> Callable[[DaskArray], None]:
|
|
502
507
|
"""Set a dask array to the zarr array with the given slice kwargs."""
|
|
503
508
|
slicing_dict = slicing_dict or {}
|
|
@@ -510,7 +515,7 @@ def build_masked_dask_setter(
|
|
|
510
515
|
axes_order=axes_order,
|
|
511
516
|
transforms=transforms,
|
|
512
517
|
slicing_dict=slicing_dict,
|
|
513
|
-
remove_channel_selection=
|
|
518
|
+
remove_channel_selection=remove_channel_selection,
|
|
514
519
|
)
|
|
515
520
|
|
|
516
521
|
if label_data_getter is None:
|
|
@@ -529,7 +534,7 @@ def build_masked_dask_setter(
|
|
|
529
534
|
axes_order=axes_order,
|
|
530
535
|
transforms=transforms,
|
|
531
536
|
slicing_dict=slicing_dict,
|
|
532
|
-
remove_channel_selection=
|
|
537
|
+
remove_channel_selection=remove_channel_selection,
|
|
533
538
|
)
|
|
534
539
|
|
|
535
540
|
def set_patch_masked_as_dask(patch: DaskArray) -> None:
|
ngio/common/_roi.py
CHANGED
|
@@ -412,6 +412,7 @@ def build_roi_numpy_setter(
|
|
|
412
412
|
axes_order: Sequence[str] | None = None,
|
|
413
413
|
transforms: Sequence[TransformProtocol] | None = None,
|
|
414
414
|
slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
415
|
+
remove_channel_selection: bool = False,
|
|
415
416
|
) -> Callable[[np.ndarray], None]:
|
|
416
417
|
"""Prepare slice kwargs for setting an array."""
|
|
417
418
|
input_slice_kwargs = roi_to_slicing_dict(
|
|
@@ -426,6 +427,7 @@ def build_roi_numpy_setter(
|
|
|
426
427
|
axes_order=axes_order,
|
|
427
428
|
transforms=transforms,
|
|
428
429
|
slicing_dict=input_slice_kwargs,
|
|
430
|
+
remove_channel_selection=remove_channel_selection,
|
|
429
431
|
)
|
|
430
432
|
|
|
431
433
|
|
|
@@ -464,6 +466,7 @@ def build_roi_dask_setter(
|
|
|
464
466
|
axes_order: Sequence[str] | None = None,
|
|
465
467
|
transforms: Sequence[TransformProtocol] | None = None,
|
|
466
468
|
slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
469
|
+
remove_channel_selection: bool = False,
|
|
467
470
|
) -> Callable[[da.Array], None]:
|
|
468
471
|
"""Prepare slice kwargs for setting an array."""
|
|
469
472
|
input_slice_kwargs = roi_to_slicing_dict(
|
|
@@ -478,6 +481,7 @@ def build_roi_dask_setter(
|
|
|
478
481
|
axes_order=axes_order,
|
|
479
482
|
transforms=transforms,
|
|
480
483
|
slicing_dict=input_slice_kwargs,
|
|
484
|
+
remove_channel_selection=remove_channel_selection,
|
|
481
485
|
)
|
|
482
486
|
|
|
483
487
|
|
|
@@ -504,6 +508,7 @@ def build_roi_masked_numpy_getter(
|
|
|
504
508
|
label_slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
505
509
|
fill_value: int | float = 0,
|
|
506
510
|
allow_scaling: bool = True,
|
|
511
|
+
remove_channel_selection: bool = False,
|
|
507
512
|
) -> Callable[[], np.ndarray]:
|
|
508
513
|
"""Prepare slice kwargs for getting a masked array."""
|
|
509
514
|
input_slice_kwargs = roi_to_slicing_dict(
|
|
@@ -531,6 +536,7 @@ def build_roi_masked_numpy_getter(
|
|
|
531
536
|
label_slicing_dict=label_slice_kwargs,
|
|
532
537
|
fill_value=fill_value,
|
|
533
538
|
allow_scaling=allow_scaling,
|
|
539
|
+
remove_channel_selection=remove_channel_selection,
|
|
534
540
|
)
|
|
535
541
|
|
|
536
542
|
|
|
@@ -549,6 +555,7 @@ def build_roi_masked_numpy_setter(
|
|
|
549
555
|
slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
550
556
|
label_slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
551
557
|
allow_scaling: bool = True,
|
|
558
|
+
remove_channel_selection: bool = False,
|
|
552
559
|
) -> Callable[[np.ndarray], None]:
|
|
553
560
|
"""Prepare slice kwargs for setting a masked array."""
|
|
554
561
|
input_slice_kwargs = roi_to_slicing_dict(
|
|
@@ -575,6 +582,7 @@ def build_roi_masked_numpy_setter(
|
|
|
575
582
|
slicing_dict=input_slice_kwargs,
|
|
576
583
|
label_slicing_dict=label_slice_kwargs,
|
|
577
584
|
allow_scaling=allow_scaling,
|
|
585
|
+
remove_channel_selection=remove_channel_selection,
|
|
578
586
|
)
|
|
579
587
|
|
|
580
588
|
|
|
@@ -593,6 +601,7 @@ def build_roi_masked_dask_getter(
|
|
|
593
601
|
slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
594
602
|
label_slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
595
603
|
allow_scaling: bool = True,
|
|
604
|
+
remove_channel_selection: bool = False,
|
|
596
605
|
) -> Callable[[], da.Array]:
|
|
597
606
|
"""Prepare slice kwargs for getting a masked array."""
|
|
598
607
|
input_slice_kwargs = roi_to_slicing_dict(
|
|
@@ -619,6 +628,7 @@ def build_roi_masked_dask_getter(
|
|
|
619
628
|
slicing_dict=input_slice_kwargs,
|
|
620
629
|
label_slicing_dict=label_slice_kwargs,
|
|
621
630
|
allow_scaling=allow_scaling,
|
|
631
|
+
remove_channel_selection=remove_channel_selection,
|
|
622
632
|
)
|
|
623
633
|
|
|
624
634
|
|
|
@@ -637,6 +647,7 @@ def build_roi_masked_dask_setter(
|
|
|
637
647
|
slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
638
648
|
label_slicing_dict: dict[str, SlicingInputType] | None = None,
|
|
639
649
|
allow_scaling: bool = True,
|
|
650
|
+
remove_channel_selection: bool = False,
|
|
640
651
|
) -> Callable[[da.Array], None]:
|
|
641
652
|
"""Prepare slice kwargs for setting a masked array."""
|
|
642
653
|
input_slice_kwargs = roi_to_slicing_dict(
|
|
@@ -663,4 +674,5 @@ def build_roi_masked_dask_setter(
|
|
|
663
674
|
slicing_dict=input_slice_kwargs,
|
|
664
675
|
label_slicing_dict=label_slice_kwargs,
|
|
665
676
|
allow_scaling=allow_scaling,
|
|
677
|
+
remove_channel_selection=remove_channel_selection,
|
|
666
678
|
)
|
|
@@ -103,6 +103,7 @@ class SegmentationIterator(AbstractIteratorBuilder):
|
|
|
103
103
|
transforms=self._output_transforms,
|
|
104
104
|
pixel_size=self._output.pixel_size,
|
|
105
105
|
roi=roi,
|
|
106
|
+
remove_channel_selection=True,
|
|
106
107
|
)
|
|
107
108
|
|
|
108
109
|
def build_dask_getter(self, roi: Roi):
|
|
@@ -124,6 +125,7 @@ class SegmentationIterator(AbstractIteratorBuilder):
|
|
|
124
125
|
transforms=self._output_transforms,
|
|
125
126
|
pixel_size=self._output.pixel_size,
|
|
126
127
|
roi=roi,
|
|
128
|
+
remove_channel_selection=True,
|
|
127
129
|
)
|
|
128
130
|
|
|
129
131
|
def post_consolidate(self):
|
|
@@ -245,6 +247,7 @@ class MaskedSegmentationIterator(SegmentationIterator):
|
|
|
245
247
|
axes_order=self._axes_order,
|
|
246
248
|
transforms=self._output_transforms,
|
|
247
249
|
pixel_size=self._output.pixel_size,
|
|
250
|
+
remove_channel_selection=True,
|
|
248
251
|
)
|
|
249
252
|
|
|
250
253
|
def build_dask_getter(self, roi: Roi):
|
|
@@ -272,6 +275,7 @@ class MaskedSegmentationIterator(SegmentationIterator):
|
|
|
272
275
|
axes_order=self._axes_order,
|
|
273
276
|
transforms=self._output_transforms,
|
|
274
277
|
pixel_size=self._output.pixel_size,
|
|
278
|
+
remove_channel_selection=True,
|
|
275
279
|
)
|
|
276
280
|
|
|
277
281
|
def post_consolidate(self):
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
ngio/__init__.py,sha256=clqwRwmkalSwXvmNLGwtI-385gwvBTnJjohEk3Xp5cE,1463
|
|
2
2
|
ngio/common/__init__.py,sha256=t5FUH7kSTqTT1jHmL_qYiEUCHHwMEKNfcZ6EbrkcpNg,1958
|
|
3
|
-
ngio/common/_array_io_pipes.py,sha256=
|
|
3
|
+
ngio/common/_array_io_pipes.py,sha256=zxZIVRtPjWUQ8J09_s5RcwoTgCOHDGmYYrkdPQbOPlM,18221
|
|
4
4
|
ngio/common/_array_io_utils.py,sha256=LktLM2_2LkjYkwzyJXHZ0LyuwrQN4GYTqgpByBxNmlg,16303
|
|
5
5
|
ngio/common/_dimensions.py,sha256=ubBSmnQmZOmen1jUn3LWZlNXCjUuV9FTjZWzUYidOwk,4852
|
|
6
6
|
ngio/common/_masking_roi.py,sha256=ZZTXordEZoq_ADk0OzADvq-5dPOwUBSuNobzFR8fpTw,5697
|
|
7
7
|
ngio/common/_pyramid.py,sha256=ElY_nBcchN3eeD9obLZ31IIo42HVlDn8R-legQpNxzQ,7503
|
|
8
|
-
ngio/common/_roi.py,sha256=
|
|
8
|
+
ngio/common/_roi.py,sha256=SJ_YJx5hR35T_OIx7ev9Y-rXInu7B4VEh8VKgcsdkcg,21166
|
|
9
9
|
ngio/common/_synt_images_utils.py,sha256=B6uYOW1NyrM06YMR-csca3_YnAAkPRTbvnbLdy9tk9E,3188
|
|
10
10
|
ngio/common/_zoom.py,sha256=p_trkLLrNM6hYvchJQJOHfYpzSlzzdDJmcyTx6K5J1M,6030
|
|
11
11
|
ngio/common/transforms/__init__.py,sha256=Dn8SpMw_e_bg9kx4ZVPrGHJIu_yOK1FkIlePlN_C7FQ,120
|
|
@@ -17,7 +17,7 @@ ngio/experimental/iterators/_abstract_iterator.py,sha256=p8ZxQuoqPGLZCp79FprhgV-
|
|
|
17
17
|
ngio/experimental/iterators/_feature.py,sha256=6uONbB527SS2NLlpiFtL3AVOazH-QpGhETLEt8pykgU,5987
|
|
18
18
|
ngio/experimental/iterators/_image_processing.py,sha256=4U2FCS5pyDes9VJAGbQn7_e8YMs2TU0ocVr2m1QZhYA,6639
|
|
19
19
|
ngio/experimental/iterators/_rois_utils.py,sha256=LfBKk2XEY-UuomT_9uOg-0b0_GUo6IX5h0OJmrbMs4g,4375
|
|
20
|
-
ngio/experimental/iterators/_segmentation.py,sha256=
|
|
20
|
+
ngio/experimental/iterators/_segmentation.py,sha256=pCR2eR5LUMV5nouw6vRDjIyIabnvfxp7cE6sukW4GZc,11220
|
|
21
21
|
ngio/hcs/__init__.py,sha256=G8j9vD-liLeB_UeGtKYIgshWvJnUA6ks9GwjvWBLdHs,357
|
|
22
22
|
ngio/hcs/_plate.py,sha256=qfRwbCKaoz_AWTi8RDFFwOxy5geSknfJrPcqFVno9zI,44288
|
|
23
23
|
ngio/images/__init__.py,sha256=9Whvt7GTiCgT_vXaEEqGnDaY1-UsRk3dhLTv091F_g4,1211
|
|
@@ -43,7 +43,7 @@ ngio/ome_zarr_meta/v04/_custom_models.py,sha256=5GxiDERvLuvq4QvApcA6EiKLS6hLFX1R
|
|
|
43
43
|
ngio/ome_zarr_meta/v04/_v04_spec_utils.py,sha256=YKBVVWb3mnuE-5L5k1i85WpHmcrbKl9k5KU2jNqt5yg,15868
|
|
44
44
|
ngio/resources/__init__.py,sha256=Hry2odzDaC471_qgVfAQVnWDMK0Io9F8m9_JBNNm4e0,1633
|
|
45
45
|
ngio/resources/resource_model.py,sha256=0Egs0QAJ5PNknqECHuBd_-ZTdi8EDNirt5VyuPdbg30,835
|
|
46
|
-
ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/mask.png,sha256=
|
|
46
|
+
ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/mask.png,sha256=g3QmxQdmeciAtBe5cTCRfR6yw3keG9cBYfjizMo6EGo,11890
|
|
47
47
|
ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/nuclei.png,sha256=QhZ4XiFX7r-8-fbX8wSeUymktX85Ap3Nw1MqeOfRrF8,21649
|
|
48
48
|
ngio/resources/20200812-CardiomyocyteDifferentiation14-Cycle1_B03/raw.jpg,sha256=82lejQAIokj5w9g-qqhysDTWpHtNvJTkdURG_BjqIxQ,37743
|
|
49
49
|
ngio/tables/__init__.py,sha256=_BV3sclNMLITu_J8_3DkkUrCB6Kro0HzeWLDCD1ivKM,877
|
|
@@ -70,7 +70,7 @@ ngio/utils/_errors.py,sha256=pKQ12LUjQLYE1nUawemA5h7HsgznjaSvV1n2PQU33N0,759
|
|
|
70
70
|
ngio/utils/_fractal_fsspec_store.py,sha256=RdcCFOgHexRKX9zZvJV5RI-5OPc7VOPS6q_IeRxm24I,1548
|
|
71
71
|
ngio/utils/_logger.py,sha256=N5W0a_xwze4blS1MolidBkTMbjTbg8GPguJZNun3mAE,1392
|
|
72
72
|
ngio/utils/_zarr_utils.py,sha256=aYHhjHWGy5Jx7IkPb4nt9N0-HgyvJnyvK9GGqnccZkE,13606
|
|
73
|
-
ngio-0.4.
|
|
74
|
-
ngio-0.4.
|
|
75
|
-
ngio-0.4.
|
|
76
|
-
ngio-0.4.
|
|
73
|
+
ngio-0.4.0a2.dist-info/METADATA,sha256=Wd5zLtu8OLbjEbgV9Lb5FDlBP9dFT9QU4S8h2358jKc,5868
|
|
74
|
+
ngio-0.4.0a2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
75
|
+
ngio-0.4.0a2.dist-info/licenses/LICENSE,sha256=UgN_a1QCeNh9rZWfz-wORQFxE3elQzLWPQaoK6N6fxQ,1502
|
|
76
|
+
ngio-0.4.0a2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|