comparison coordinates_of_roi.py @ 2:24d9bd16c953 draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/coordinates_of_roi/ commit bfae746780819634a014388ea4671a49fc5c178d
author imgteam
date Wed, 20 Mar 2019 09:18:06 -0400
parents ee045a6bbdef
children 02a686fc1654
comparison
equal deleted inserted replaced
1:ee045a6bbdef 2:24d9bd16c953
14 img_width = data.shape[1] 14 img_width = data.shape[1]
15 for j in range(img_width): 15 for j in range(img_width):
16 for i in range(img_height): 16 for i in range(img_height):
17 if white_obj == False: 17 if white_obj == False:
18 if data[i,j] <= threshold: 18 if data[i,j] <= threshold:
19 x.append(j + offset[0]) 19 x.append(i + offset[0])
20 y.append(img_height-(i+1) + offset[1]) 20 y.append(j + offset[1])
21 elif data[i,j] >= threshold: 21 elif data[i,j] >= threshold:
22 x.append(j + offset[0]) 22 x.append(i + offset[0])
23 y.append(img_height-(i+1) + offset[1]) 23 y.append(j + offset[1])
24 24
25 df = pd.DataFrame() 25 df = pd.DataFrame()
26 df['x'] = x 26 df['x'] = x
27 df['y'] = y 27 df['y'] = y
28 df.to_csv(pixel_table, sep="\t", index = False) 28 df.to_csv(pixel_table, sep="\t", index = False)