diff coordinates_of_roi.py @ 1:ee045a6bbdef draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/coordinates_of_roi/ commit 4efef27bbe105490fc125e3586024ebb51fa929f
author imgteam
date Fri, 22 Feb 2019 17:11:28 -0500
parents 0d30ffea8874
children 24d9bd16c953
line wrap: on
line diff
--- a/coordinates_of_roi.py	Sat Feb 09 14:33:43 2019 -0500
+++ b/coordinates_of_roi.py	Fri Feb 22 17:11:28 2019 -0500
@@ -10,15 +10,17 @@
         data = skimage.color.rgb2grey(data)
     x = []
     y = []
-    for i in range(data.shape[0]):
-        for j in range(data.shape[1]):
+    img_height = data.shape[0]
+    img_width = data.shape[1]
+    for j in range(img_width):
+        for i in range(img_height):
             if white_obj == False:
                 if data[i,j] <= threshold:
                     x.append(j + offset[0])
-                    y.append(i + offset[1])
+                    y.append(img_height-(i+1) + offset[1])
             elif data[i,j] >= threshold:
                     x.append(j + offset[0])
-                    y.append(i + offset[1])
+                    y.append(img_height-(i+1) + offset[1])
                     
     df = pd.DataFrame()
     df['x'] = x