Skip to content
Snippets Groups Projects
Commit 01d698a9 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

feat(image): add from_h5 builder

parent 89dcb065
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ from pathlib import Path, PosixPath ...@@ -6,6 +6,7 @@ from pathlib import Path, PosixPath
import dask.array as da import dask.array as da
import xmltodict import xmltodict
from agora.io.writer import load_attributes
from dask.array.image import imread from dask.array.image import imread
from tifffile import TiffFile from tifffile import TiffFile
...@@ -209,6 +210,30 @@ class Image(Argo): ...@@ -209,6 +210,30 @@ class Image(Argo):
# images from OMERO # images from OMERO
self._image_wrap = None self._image_wrap = None
@classmethod
def from_h5(
cls,
filepath: t.Union[str, PosixPath],
):
"""Instatiate Image from a hdf5 file.
Parameters
----------
cls : Image
Image class
filepath : t.Union[str, PosixPath]
Location of hdf5 file.
Examples
--------
FIXME: Add docs.
"""
metadata = load_attributes(filepath)
image_id = metadata["image_id"]
server_info = metadata["parameters"]["general"].get("server_info", {})
return cls(image_id, **server_info)
@property @property
def image_wrap(self): def image_wrap(self):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment