Skip to content

Commit e5b193d

Browse files
committed
Test for label renaming
1 parent 472351e commit e5b193d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
"""Test copy 2D to 3D segmentation."""
22

33
import dask.array as da
4+
import pytest
45
import zarr
56

67
from fractal_helper_tasks.convert_2D_segmentation_to_3D import (
78
convert_2D_segmentation_to_3D,
89
)
910

1011

11-
def test_2d_to_3d(tmp_zenodo_zarr: list[str]):
12+
@pytest.mark.parametrize("new_label_name", [None, "nuclei_new"])
13+
def test_2d_to_3d(tmp_zenodo_zarr: list[str], new_label_name):
1214
zarr_url = f"{tmp_zenodo_zarr[1]}/B/03/0"
1315
label_name = "nuclei"
1416

1517
convert_2D_segmentation_to_3D(
1618
zarr_url=zarr_url,
1719
label_name=label_name,
20+
new_label_name=new_label_name,
1821
)
19-
zarr_3D_label_url = f"{tmp_zenodo_zarr[0]}/B/03/0/labels/{label_name}"
22+
23+
if not new_label_name:
24+
new_label_name = label_name
25+
26+
zarr_3D_label_url = f"{tmp_zenodo_zarr[0]}/B/03/0/labels/{new_label_name}"
2027
# Check that the label has been copied correctly
2128
with zarr.open(zarr_3D_label_url, mode="rw+") as zarr_img:
2229
zarr_3D = da.from_zarr(zarr_img[0])
@@ -25,7 +32,9 @@ def test_2d_to_3d(tmp_zenodo_zarr: list[str]):
2532

2633
# TODO: Add custom ROI tables to be copied to 3D
2734

28-
# TODO: Add test with new label name, new table names
35+
# TODO: Add a feature table & have it copied over
36+
37+
# TODO: Add test with new table names
2938

3039
# TODO: Create a version of the test data where image suffixes need to be
3140
# changed, run tests on those

0 commit comments

Comments
 (0)