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

bugfixes

parent 21af9f9d
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ class DatasetLocal: ...@@ -16,7 +16,7 @@ class DatasetLocal:
""" """
def __init__(self, dpath: Union[str, PosixPath]): def __init__(self, dpath: Union[str, PosixPath], *args, **kwargs):
self.fpath = Path(dpath) self.fpath = Path(dpath)
assert len(self.get_images()), "No tif files found" assert len(self.get_images()), "No tif files found"
...@@ -94,8 +94,8 @@ class Dataset(Argo): ...@@ -94,8 +94,8 @@ class Dataset(Argo):
def files(self): def files(self):
if self._files is None: if self._files is None:
self._files = { self._files = {
x.GetFilename(): x x.getFileName(): x
for x in self.dataset.ListAnnotations() for x in self.dataset.listAnnotations()
if isinstance(x, omero.gateway.FileAnnotationWrapper) if isinstance(x, omero.gateway.FileAnnotationWrapper)
} }
if not len(self._files): if not len(self._files):
...@@ -107,17 +107,17 @@ class Dataset(Argo): ...@@ -107,17 +107,17 @@ class Dataset(Argo):
if self._tags is None: if self._tags is None:
self._tags = { self._tags = {
x.getname(): x x.getname(): x
for x in self.dataset.ListAnnotations() for x in self.dataset.listAnnotations()
if isinstance(x, omero.gateway.TagAnnotationWrapper) if isinstance(x, omero.gateway.TagAnnotationWrapper)
} }
return self._tags return self._tags
def cache_logs(self, root_dir): def cache_logs(self, root_dir):
for name, annotation in self.files.items(): for name, annotation in self.files.items():
filepath = root_dir / annotation.GetFilename().replace("/", "_") filepath = root_dir / annotation.getFileName().replace("/", "_")
if str(filepath).endswith("txt") and not filepath.exists(): if str(filepath).endswith("txt") and not filepath.exists():
# save only the text files # save only the text files
with open(str(filepath), "wb") as fd: with open(str(filepath), "wb") as fd:
for chunk in annotation.GetFileInChunks(): for chunk in annotation.getFileInChunks():
fd.write(chunk) fd.write(chunk)
return True return True
...@@ -13,7 +13,7 @@ from aliby.io.omero import Argo ...@@ -13,7 +13,7 @@ from aliby.io.omero import Argo
class ImageLocal: class ImageLocal:
def __init__(self, path: str): def __init__(self, path: str, *args, **kwargs):
self.path = path self.path = path
self.image_id = str(path) self.image_id = str(path)
......
...@@ -253,12 +253,8 @@ class Pipeline(ProcessABC): ...@@ -253,12 +253,8 @@ class Pipeline(ProcessABC):
print("Searching OMERO") print("Searching OMERO")
# Do all all initialisations # Do all all initialisations
dataset_wrapper = ( dataset_wrapper = DatasetLocal if isinstance(expt_id, str) else Dataset
lambda x: DatasetLocal(x) with dataset_wrapper(expt_id, **self.general.get("server_info", {})) as conn:
if isinstance(expt_id, str)
else lambda x: Dataset(int(x), **self.general["server_info"])
)
with dataset_wrapper(expt_id) as conn:
image_ids = conn.get_images() image_ids = conn.get_images()
directory = self.store or root_dir / conn.unique_name directory = self.store or root_dir / conn.unique_name
......
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