Skip to content

Commit 63c9b7b

Browse files
committed
Improve handling of copying tables in 2d to 3d task
1 parent 16f25c3 commit 63c9b7b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,26 @@ def convert_2D_segmentation_to_3D(
186186
if table.type() == "roi_table" or table.type() == "masking_roi_table":
187187
for roi in table.rois():
188188
roi.z_length = z_extent
189-
else:
189+
ome_zarr_container_3d.add_table(
190+
name=new_table_names[i],
191+
table=table,
192+
overwrite=overwrite,
193+
)
194+
elif table.type() == "feature_table":
190195
# For some reason, I need to load the table explicitly before
191196
# I can write it again
192-
# FIXME: Check with Lorenzo why this is
197+
# FIXME
193198
table.dataframe # noqa #B018
194-
ome_zarr_container_3d.add_table(
195-
name=new_table_names[i], table=table, overwrite=False
196-
)
199+
ome_zarr_container_3d.add_table(
200+
name=new_table_names[i],
201+
table=table,
202+
overwrite=overwrite,
203+
)
204+
else:
205+
logger.warning(
206+
f"Table {table_name} was not copied over. Tables of type "
207+
f"{table.type()} are not supported by this task so far."
208+
)
197209

198210
logger.info("Finished 2D to 3D conversion")
199211

0 commit comments

Comments
 (0)