comparison voronoi_tessellation.py @ 2:412d7478ec92 draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/voronoi_tesselation commit c86a1b93cb7732f7331a981d13465653cc1a2790
author imgteam
date Wed, 24 Apr 2024 08:13:41 +0000
parents 8b74843c136e
children
comparison
equal deleted inserted replaced
1:e7fdea8385f0 2:412d7478ec92
1 import argparse 1 import argparse
2 2
3 import giatools.io
3 import numpy as np 4 import numpy as np
4 import scipy.ndimage as ndi 5 import scipy.ndimage as ndi
5 import skimage.io 6 import skimage.io
6 from skimage.segmentation import watershed 7 from skimage.segmentation import watershed
7 8
11 parser = argparse.ArgumentParser() 12 parser = argparse.ArgumentParser()
12 parser.add_argument('input') 13 parser.add_argument('input')
13 parser.add_argument('output') 14 parser.add_argument('output')
14 args = parser.parse_args() 15 args = parser.parse_args()
15 16
16 im = skimage.io.imread(args.input) 17 im = giatools.io.imread(args.input)
17 im = im.squeeze() 18 im = im.squeeze()
18 assert im.ndim == 2 19 assert im.ndim == 2
19 20
20 distances = np.full(im.shape, np.inf) 21 distances = np.full(im.shape, np.inf)
21 for label in np.unique(im): 22 for label in np.unique(im):