comparison auto_threshold.py @ 2:81f0cbca04a7 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 05:00:41 -0500
parents 4853fc2b50bf
children 0c777d708acc
comparison
equal deleted inserted replaced
1:4853fc2b50bf 2:81f0cbca04a7
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")