# HG changeset patch # User imgteam # Date 1550873488 18000 # Node ID ee045a6bbdeff11fa52dbb496893bb40d3228ae6 # Parent 0d30ffea8874a3f8bd8802ea461e0581f35755fa planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/coordinates_of_roi/ commit 4efef27bbe105490fc125e3586024ebb51fa929f diff -r 0d30ffea8874 -r ee045a6bbdef coordinates_of_roi.py --- 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 diff -r 0d30ffea8874 -r ee045a6bbdef test-data/table.tsv --- 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 diff -r 0d30ffea8874 -r ee045a6bbdef test-data/table2.tsv --- 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