From 5e9327ab269640d8bee10f887a2ee4eb3e904a68 Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Fri, 25 Oct 2024 14:09:56 +0200 Subject: [PATCH] simplify --- src/depiction/tools/ometiff_to_hdf5.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/depiction/tools/ometiff_to_hdf5.py b/src/depiction/tools/ometiff_to_hdf5.py index 31c4c21..5406706 100644 --- a/src/depiction/tools/ometiff_to_hdf5.py +++ b/src/depiction/tools/ometiff_to_hdf5.py @@ -1,7 +1,6 @@ +import cyclopts from pathlib import Path -import cyclopts -from depiction.image.multi_channel_image import MultiChannelImage from depiction.persistence.image.ome_tiff import OmeTiff app = cyclopts.App() @@ -13,12 +12,7 @@ def ometiff_to_hdf5( output_hdf5: Path, ) -> None: """Writes input_ometiff to output_hdf5 using our MultiChannelImage representation.""" - data = OmeTiff.read(input_ometiff) - if "pixel_size" in data.attrs: - # TODO this is quite broken and should be fixed in the future, but currently the pixel size cannot - # be persisted - del data.attrs["pixel_size"] - image = MultiChannelImage(data) + image = OmeTiff.read_image(input_ometiff, bg_value=0.0) image.write_hdf5(output_hdf5)