Mercurial > repos > imgteam > 2d_auto_threshold
changeset 8:699a5e9146b3 draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit c86a1b93cb7732f7331a981d13465653cc1a2790
author | imgteam |
---|---|
date | Wed, 24 Apr 2024 08:11:33 +0000 |
parents | e5c8e7e72373 |
children | |
files | auto_threshold.py auto_threshold.xml test-data/out5.tif test-data/sample2.tif |
diffstat | 4 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/auto_threshold.py Thu Apr 04 15:23:18 2024 +0000 +++ b/auto_threshold.py Wed Apr 24 08:11:33 2024 +0000 @@ -7,12 +7,13 @@ import argparse +import giatools.io import numpy as np import skimage.filters -import skimage.io import skimage.util import tifffile + th_methods = { 'manual': lambda thres, **kwargs: thres, @@ -28,7 +29,7 @@ def do_thresholding(in_fn, out_fn, th_method, block_size, offset, threshold, invert_output=False): - img = skimage.io.imread(in_fn) + img = giatools.io.imread(in_fn) img = np.squeeze(img) assert img.ndim == 2
--- a/auto_threshold.xml Thu Apr 04 15:23:18 2024 +0000 +++ b/auto_threshold.xml Wed Apr 24 08:11:33 2024 +0000 @@ -4,7 +4,7 @@ <import>creators.xml</import> <import>tests.xml</import> <token name="@TOOL_VERSION@">0.18.1</token> - <token name="@VERSION_SUFFIX@">2</token> + <token name="@VERSION_SUFFIX@">3</token> <xml name="inputs/offset"> <param name="offset" type="float" value="0" label="Offset" help="Offset to be added to the automatically determined threshold value. Positive values will increase the threshold (and thus reduce the amount of values above the threshold)." /> </xml> @@ -22,6 +22,7 @@ <requirements> <requirement type="package" version="@TOOL_VERSION@">scikit-image</requirement> <requirement type="package" version="2020.10.1">tifffile</requirement> + <requirement type="package" version="0.1">giatools</requirement> </requirements> <command detect_errors="aggressive"> <![CDATA[ @@ -124,6 +125,13 @@ <param name="invert_output" value="True"/> <expand macro="tests/binary_image_diff" name="output" value="out4.tif" ftype="tiff"/> </test> + <!-- Tests for irregular files --> + <test> + <param name="input" value="sample2.tif"/> + <param name="method_id" value="otsu"/> + <param name="invert_output" value="False"/> + <expand macro="tests/binary_image_diff" name="output" value="out5.tif" ftype="tiff"/> + </test> <!-- Tests for multi-channel images --> <test expect_failure="true"> <param name="input" value="rgb.png"/>