comparison auto_local_threshold.py @ 2:497dcd834bb3 draft

"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_local_threshold/ commit 3d389fdec0db29cf6fbd783c0501455bf624fa90"
author imgteam
date Wed, 18 Dec 2019 05:00:26 -0500
parents c90b91f4a07b
children be2d3ce89c0f
comparison
equal deleted inserted replaced
1:c90b91f4a07b 2:497dcd834bb3
22 22
23 img_in = skimage.io.imread(args.input_file.name) 23 img_in = skimage.io.imread(args.input_file.name)
24 img_in = np.reshape(img_in, [img_in.shape[0], img_in.shape[1]]) 24 img_in = np.reshape(img_in, [img_in.shape[0], img_in.shape[1]])
25 thresh = threshOptions[args.thresh_type](img_in, args.block_size) 25 thresh = threshOptions[args.thresh_type](img_in, args.block_size)
26 26
27 if args.dark_background: 27 if args.dark_background:
28 res = img_in > thresh 28 res = img_in > thresh
29 else: 29 else:
30 res = img_in <= thresh 30 res = img_in <= thresh
31 31
32 res = skimage.util.img_as_uint(res) 32 res = skimage.util.img_as_uint(res)