# HG changeset patch # User imgteam # Date 1563786095 14400 # Node ID 6c92ac9ce8686b395db4f2838eeb3158f1f16b3d # Parent b97a362ff3213cd2237c97b1bf9dad0493f4e797 planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/binary2labelimage/ commit b2acc1845a25828181597fe5b6982fe116a7796d diff -r b97a362ff321 -r 6c92ac9ce868 binary2label.py --- a/binary2label.py Sat Feb 09 14:30:31 2019 -0500 +++ b/binary2label.py Mon Jul 22 05:01:35 2019 -0400 @@ -5,14 +5,16 @@ import numpy as np import warnings from PIL import Image +import skimage.util parser = argparse.ArgumentParser() parser.add_argument('input_file', type=argparse.FileType('r'), default=sys.stdin, help='input file') parser.add_argument('out_file', type=argparse.FileType('w'), default=sys.stdin, help='out file (TIFF)') args = parser.parse_args() - + img_in = skimage.io.imread(args.input_file.name) > 0 -res = label(img_in).astype(np.int32) +res = label(img_in) +res = skimage.util.img_as_uint(res) res = Image.fromarray(res) -res.save(args.out_file.name, "tiff") \ No newline at end of file +res.save(args.out_file.name, "tiff") diff -r b97a362ff321 -r 6c92ac9ce868 binary2label.xml --- a/binary2label.xml Sat Feb 09 14:30:31 2019 -0500 +++ b/binary2label.xml Mon Jul 22 05:01:35 2019 -0400 @@ -1,9 +1,10 @@ - + Converts Binary to Label Image - scikit-image + scikit-image + tifffile - + @@ -17,7 +18,7 @@ - +