Mercurial > repos > imgteam > binary2labelimage
changeset 1:37b99b904027 draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/binary2labelimage/ commit b2acc1845a25828181597fe5b6982fe116a7796d
author | imgteam |
---|---|
date | Mon, 22 Jul 2019 04:55:34 -0400 |
parents | 1cde6ba34356 |
children | 938e2358eb80 |
files | binary2label.py binary2label.xml |
diffstat | 2 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/binary2label.py Sat Feb 09 14:13:08 2019 -0500 +++ b/binary2label.py Mon Jul 22 04:55:34 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")
--- a/binary2label.xml Sat Feb 09 14:13:08 2019 -0500 +++ b/binary2label.xml Mon Jul 22 04:55:34 2019 -0400 @@ -1,9 +1,10 @@ -<tool id="ip_binary_to_labelimage" name="Binary 2 Label" version="0.2"> +<tool id="ip_binary_to_labelimage" name="Binary 2 Label" version="0.4"> <description>Converts Binary to Label Image</description> <requirements> - <requirement type="package" version="0.12.3">scikit-image</requirement> + <requirement type="package" version="0.12.3">scikit-image</requirement> + <requirement type="package" version="0.15.1">tifffile</requirement> </requirements> - <command> + <command detect_errors="aggressive"> <![CDATA[ python '$__tool_directory__/binary2label.py' '$input' '$output' ]]> @@ -17,7 +18,7 @@ <tests> <test> <param name="input" value="galaxyIcon_noText.tif" /> - <output name="output" value="label.tif" ftype="tiff" /> + <output name="output" value="label.tif" ftype="tiff" compare="sim_size"/> </test> </tests> <help>