diff qupath_roi_splitter.py @ 1:064b53fd3131 draft

planemo upload for repository hhttps://github.com/npinter/ROIsplitter commit e08a178a7c35c0673f6bfc163614a8fc730ffc6c
author galaxyp
date Wed, 14 Jun 2023 16:37:01 +0000
parents b5e9cebb27e3
children 7bee859bbd11
line wrap: on
line diff
--- a/qupath_roi_splitter.py	Tue Apr 25 09:30:06 2023 +0000
+++ b/qupath_roi_splitter.py	Wed Jun 14 16:37:01 2023 +0000
@@ -22,11 +22,11 @@
     tma_name = qupath_roi["name"]
     cell_types = [ct.rsplit(" - ", 1)[-1] for ct in qupath_roi["featureNames"]]
 
-    # create numpy array with white background
-    img = np.zeros((dim_plt[1], dim_plt[0], 3), dtype="uint8")
-    img.fill(255)
+    for cell_type in cell_types:
+        # create numpy array with white background
+        img = np.zeros((dim_plt[1], dim_plt[0], 3), dtype="uint8")
+        img.fill(255)
 
-    for cell_type in cell_types:
         for i, roi in enumerate(qupath_roi["features"]):
             if roi["properties"]["classification"]["name"] == cell_type:
                 if len(roi["geometry"]["coordinates"]) == 1: