changeset 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
files coordinates_of_roi.py test-data/table.tsv test-data/table2.tsv
diffstat 3 files changed, 18 insertions(+), 16 deletions(-) [+]
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
--- a/test-data/table.tsv	Sat Feb 09 14:33:43 2019 -0500
+++ b/test-data/table.tsv	Fri Feb 22 17:11:28 2019 -0500
@@ -1,7 +1,7 @@
 x	y
-4	5
-5	5
-6	5
-7	5
-8	5
-9	5
+4	4
+5	4
+6	4
+7	4
+8	4
+9	4
--- a/test-data/table2.tsv	Sat Feb 09 14:33:43 2019 -0500
+++ b/test-data/table2.tsv	Fri Feb 22 17:11:28 2019 -0500
@@ -1,7 +1,7 @@
 x	y
-5	7
-6	7
-7	7
-8	7
-9	7
-10	7
+5	6
+6	6
+7	6
+8	6
+9	6
+10	6