Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Oct 25, 2024
1 parent fa3f281 commit 5e9327a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/depiction/tools/ometiff_to_hdf5.py
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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)


Expand Down

0 comments on commit 5e9327a

Please sign in to comment.