From 0cb25380ad30891c3762ba81874a7627d102c5b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Al=C3=A1n=20Mu=C3=B1oz?= <amuoz@ed.ac.uk>
Date: Tue, 16 Aug 2022 16:56:29 +0100
Subject: [PATCH] feat(image): add UnsafeImage

---
 aliby/io/image.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/aliby/io/image.py b/aliby/io/image.py
index 2e2adec4..99a4f04c 100644
--- a/aliby/io/image.py
+++ b/aliby/io/image.py
@@ -267,3 +267,25 @@ class Image(Argo):
         meta["channels"] = self.image_wrap.getChannelLabels()
         meta["name"] = self.image_wrap.getName()
         return meta
+
+
+class UnsafeImage(Image):
+    """
+    Loads images from OMERO and gives access to the data and metadata.
+    This does not require context management to work, making it possible
+    to leave hanging sessions and freeze an Omero server.
+    """
+
+    def __init__(self, image_id, **server_info):
+        """
+        Establishes the connection to the OMERO server via the Argo
+        base class.
+
+        Parameters
+        ----------
+        image_id: integer
+        server_info: dictionary
+            Specifies the host, username, and password as strings
+        """
+        super().__init__(image_id, **server_info)
+        self.create_gate()
-- 
GitLab