Mercurial > repos > imgteam > binary2labelimage
comparison binary2label.py @ 2:6e65fd971e13 draft
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/binary2labelimage/ commit 3d389fdec0db29cf6fbd783c0501455bf624fa90"
author | imgteam |
---|---|
date | Wed, 18 Dec 2019 05:01:27 -0500 |
parents | 6c92ac9ce868 |
children | 9bb446db4a1e |
comparison
equal
deleted
inserted
replaced
1:6c92ac9ce868 | 2:6e65fd971e13 |
---|---|
7 from PIL import Image | 7 from PIL import Image |
8 import skimage.util | 8 import skimage.util |
9 | 9 |
10 parser = argparse.ArgumentParser() | 10 parser = argparse.ArgumentParser() |
11 parser.add_argument('input_file', type=argparse.FileType('r'), default=sys.stdin, help='input file') | 11 parser.add_argument('input_file', type=argparse.FileType('r'), default=sys.stdin, help='input file') |
12 parser.add_argument('out_file', type=argparse.FileType('w'), default=sys.stdin, help='out file (TIFF)') | 12 parser.add_argument('out_file', type=argparse.FileType('w'), default=sys.stdin, help='out file (TIFF)') |
13 args = parser.parse_args() | 13 args = parser.parse_args() |
14 | 14 |
15 img_in = skimage.io.imread(args.input_file.name) > 0 | 15 img_in = skimage.io.imread(args.input_file.name) > 0 |
16 res = label(img_in) | 16 res = label(img_in) |
17 res = skimage.util.img_as_uint(res) | 17 res = skimage.util.img_as_uint(res) |