diff --git a/tools/2d_auto_threshold/auto_threshold.py b/tools/2d_auto_threshold/auto_threshold.py index 0aeaa2f5..71f5fabe 100644 --- a/tools/2d_auto_threshold/auto_threshold.py +++ b/tools/2d_auto_threshold/auto_threshold.py @@ -43,7 +43,7 @@ def do_thresholding(in_fn, out_fn, th_method, block_size=5, threshold=0, invert_ parser.add_argument('th_method', choices=th_methods.keys(), help='Thresholding method') parser.add_argument('block_size', type=int, default=5, help='Odd size of pixel neighborhood for calculating the threshold') parser.add_argument('threshold', type=float, default=0, help='Manual thresholding value') - parser.add_argument('invert_output', default=False, type=bool, help='Values below/above the threshold are labeled with 0/255 if False, and with 255/0 otherwise') + parser.add_argument('--invert_output', default=False, action='store_true', help='Values below/above the threshold are labeled with 0/255 by default, and with 255/0 if this argument is used') args = parser.parse_args() do_thresholding(args.im_in, args.im_out, args.th_method, args.block_size, args.threshold, args.invert_output) diff --git a/tools/2d_auto_threshold/auto_threshold.xml b/tools/2d_auto_threshold/auto_threshold.xml index a8274cfd..cd686e52 100644 --- a/tools/2d_auto_threshold/auto_threshold.xml +++ b/tools/2d_auto_threshold/auto_threshold.xml @@ -2,7 +2,7 @@ with scikit-image 0.18.1 - 0 + 1 operation_3443 @@ -23,7 +23,7 @@ '$th_method.method_id' '$th_method.block_size' '$th_method.threshold' - '$invert_output' + $invert_output ]]> @@ -72,7 +72,7 @@ - + diff --git a/tools/2d_auto_threshold/test-data/out3.tif b/tools/2d_auto_threshold/test-data/out3.tif index e938abd4..3baffa63 100644 Binary files a/tools/2d_auto_threshold/test-data/out3.tif and b/tools/2d_auto_threshold/test-data/out3.tif differ