Mercurial > repos > imgteam > 2d_auto_threshold
comparison auto_threshold.py @ 2:f40e5d11eb47 draft
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit 3d389fdec0db29cf6fbd783c0501455bf624fa90"
author | imgteam |
---|---|
date | Wed, 18 Dec 2019 09:55:34 +0000 |
parents | 7f2962f619e3 |
children | 5224cc463a97 |
comparison
equal
deleted
inserted
replaced
1:7f2962f619e3 | 2:f40e5d11eb47 |
---|---|
26 img_in = np.reshape(img_in, [img_in.shape[0], img_in.shape[1]]) | 26 img_in = np.reshape(img_in, [img_in.shape[0], img_in.shape[1]]) |
27 thresh = threshOptions[args.thresh_type](img_in) | 27 thresh = threshOptions[args.thresh_type](img_in) |
28 | 28 |
29 if args.dark_background: | 29 if args.dark_background: |
30 res = img_in > thresh | 30 res = img_in > thresh |
31 else: | 31 else: |
32 res = img_in <= thresh | 32 res = img_in <= thresh |
33 | 33 |
34 res = skimage.util.img_as_uint(res) | 34 res = skimage.util.img_as_uint(res) |
35 skimage.io.imsave(args.out_file.name, res, plugin="tifffile") | 35 skimage.io.imsave(args.out_file.name, res, plugin="tifffile") |