Mercurial > repos > imgteam > 2d_auto_threshold
comparison auto_threshold.xml @ 7:e5c8e7e72373 draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit c045f067a57e8308308cf6329060c7ccd3fc372f
author | imgteam |
---|---|
date | Thu, 04 Apr 2024 15:23:18 +0000 |
parents | 8bccb36e055a |
children | 699a5e9146b3 |
comparison
equal
deleted
inserted
replaced
6:8bccb36e055a | 7:e5c8e7e72373 |
---|---|
1 <tool id="ip_threshold" name="Threshold image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> | 1 <tool id="ip_threshold" name="Threshold image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> |
2 <description>with scikit-image</description> | 2 <description>with scikit-image</description> |
3 <macros> | 3 <macros> |
4 <import>creators.xml</import> | |
5 <import>tests.xml</import> | |
4 <token name="@TOOL_VERSION@">0.18.1</token> | 6 <token name="@TOOL_VERSION@">0.18.1</token> |
5 <token name="@VERSION_SUFFIX@">1</token> | 7 <token name="@VERSION_SUFFIX@">2</token> |
8 <xml name="inputs/offset"> | |
9 <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)." /> | |
10 </xml> | |
6 </macros> | 11 </macros> |
12 <creator> | |
13 <expand macro="creators/bmcv"/> | |
14 </creator> | |
7 <edam_operations> | 15 <edam_operations> |
8 <edam_operation>operation_3443</edam_operation> | 16 <edam_operation>operation_3443</edam_operation> |
9 </edam_operations> | 17 </edam_operations> |
10 <xrefs> | 18 <xrefs> |
11 <xref type="bio.tools">scikit-image</xref> | 19 <xref type="bio.tools">scikit-image</xref> |
12 <xref type="biii">scikit-image</xref> | 20 <xref type="biii">scikit-image</xref> |
13 </xrefs> | 21 </xrefs> |
14 <requirements> | 22 <requirements> |
15 <requirement type="package" version="0.18.1">scikit-image</requirement> | 23 <requirement type="package" version="@TOOL_VERSION@">scikit-image</requirement> |
16 <requirement type="package" version="2020.10.1">tifffile</requirement> | 24 <requirement type="package" version="2020.10.1">tifffile</requirement> |
17 </requirements> | 25 </requirements> |
18 <command detect_errors="aggressive"> | 26 <command detect_errors="aggressive"> |
19 <![CDATA[ | 27 <![CDATA[ |
20 python '$__tool_directory__/auto_threshold.py' | 28 python '$__tool_directory__/auto_threshold.py' |
21 '$input' | 29 '$input' |
22 ./out.tif | 30 ./out.tif |
23 '$th_method.method_id' | 31 '$th_method.method_id' |
24 '$th_method.block_size' | 32 '$th_method.block_size' |
33 '$th_method.offset' | |
25 '$th_method.threshold' | 34 '$th_method.threshold' |
26 $invert_output | 35 $invert_output |
27 ]]> | 36 ]]> |
28 </command> | 37 </command> |
29 <inputs> | 38 <inputs> |
40 <option value="loc_mean">Locally adaptive / Mean</option> | 49 <option value="loc_mean">Locally adaptive / Mean</option> |
41 </param> | 50 </param> |
42 <when value="manual"> | 51 <when value="manual"> |
43 <param name="threshold" type="float" value="0" label="Threshold value" /> | 52 <param name="threshold" type="float" value="0" label="Threshold value" /> |
44 <param name="block_size" type="hidden" value="0" /> | 53 <param name="block_size" type="hidden" value="0" /> |
54 <param name="offset" type="hidden" value="0" /> | |
45 </when> | 55 </when> |
46 <when value="otsu"> | 56 <when value="otsu"> |
47 <param name="threshold" type="hidden" value="0" /> | 57 <param name="threshold" type="hidden" value="0" /> |
48 <param name="block_size" type="hidden" value="0" /> | 58 <param name="block_size" type="hidden" value="0" /> |
59 <expand macro="inputs/offset" /> | |
49 </when> | 60 </when> |
50 <when value="li"> | 61 <when value="li"> |
51 <param name="threshold" type="hidden" value="0" /> | 62 <param name="threshold" type="hidden" value="0" /> |
52 <param name="block_size" type="hidden" value="0" /> | 63 <param name="block_size" type="hidden" value="0" /> |
64 <expand macro="inputs/offset" /> | |
53 </when> | 65 </when> |
54 <when value="isodata"> | 66 <when value="isodata"> |
55 <param name="threshold" type="hidden" value="0" /> | 67 <param name="threshold" type="hidden" value="0" /> |
56 <param name="block_size" type="hidden" value="0" /> | 68 <param name="block_size" type="hidden" value="0" /> |
69 <expand macro="inputs/offset" /> | |
57 </when> | 70 </when> |
58 <when value="yen"> | 71 <when value="yen"> |
59 <param name="threshold" type="hidden" value="0" /> | 72 <param name="threshold" type="hidden" value="0" /> |
60 <param name="block_size" type="hidden" value="0" /> | 73 <param name="block_size" type="hidden" value="0" /> |
74 <expand macro="inputs/offset" /> | |
61 </when> | 75 </when> |
62 <when value="loc_gaussian"> | 76 <when value="loc_gaussian"> |
63 <param name="threshold" type="hidden" value="0" /> | 77 <param name="threshold" type="hidden" value="0" /> |
64 <param name="block_size" type="integer" value="5" label="Odd size of pixel neighborhood for determining the threshold" /> | 78 <param name="block_size" type="integer" value="5" label="Odd size of pixel neighborhood for determining the threshold" /> |
79 <expand macro="inputs/offset" /> | |
65 </when> | 80 </when> |
66 <when value="loc_median"> | 81 <when value="loc_median"> |
67 <param name="threshold" type="hidden" value="0" /> | 82 <param name="threshold" type="hidden" value="0" /> |
68 <param name="block_size" type="integer" value="5" label="Odd size of pixel neighborhood for determining the threshold" /> | 83 <param name="block_size" type="integer" value="5" label="Odd size of pixel neighborhood for determining the threshold" /> |
84 <expand macro="inputs/offset" /> | |
69 </when> | 85 </when> |
70 <when value="loc_mean"> | 86 <when value="loc_mean"> |
71 <param name="threshold" type="hidden" value="0" /> | 87 <param name="threshold" type="hidden" value="0" /> |
72 <param name="block_size" type="integer" value="5" label="Odd size of pixel neighborhood for determining the threshold" /> | 88 <param name="block_size" type="integer" value="5" label="Odd size of pixel neighborhood for determining the threshold" /> |
89 <expand macro="inputs/offset" /> | |
73 </when> | 90 </when> |
74 </conditional> | 91 </conditional> |
75 <param name="invert_output" type="boolean" checked="false" truevalue="--invert_output" falsevalue="" label="Invert output labels" help="Pixels are usually assigned the label 0 if the pixel value is below (or equal to) the threshold, and 255 if it is above the threshold. If this option is activated, pixels are assigned the label 255 if the pixel value is below (or equal to) the threshold, and 0 if it is above the threshold." /> | 92 <param name="invert_output" type="boolean" checked="false" truevalue="--invert_output" falsevalue="" label="Invert output labels" help="Pixels are usually assigned the label 0 if the pixel value is below (or equal to) the threshold, and 255 if it is above the threshold. If this option is activated, pixels are assigned the label 255 if the pixel value is below (or equal to) the threshold, and 0 if it is above the threshold." /> |
76 </inputs> | 93 </inputs> |
77 <outputs> | 94 <outputs> |
78 <data format="tiff" name="output" from_work_dir="out.tif" /> | 95 <data format="tiff" name="output" from_work_dir="out.tif" /> |
79 </outputs> | 96 </outputs> |
80 <tests> | 97 <tests> |
98 <!-- Tests for single-channel images --> | |
81 <test> | 99 <test> |
82 <param name="input" value="sample.tif"/> | 100 <param name="input" value="sample.tif"/> |
83 <output name="output" value="out.tif" ftype="tiff" compare="sim_size" delta="10"/> | |
84 <param name="method_id" value="loc_gaussian"/> | 101 <param name="method_id" value="loc_gaussian"/> |
85 <param name="block_size" value="3"/> | 102 <param name="block_size" value="51"/> |
86 <param name="invert_output" value="False"/> | 103 <param name="invert_output" value="False"/> |
104 <expand macro="tests/binary_image_diff" name="output" value="out1.tif" ftype="tiff"/> | |
87 </test> | 105 </test> |
88 <test> | 106 <test> |
89 <param name="input" value="sample.tif"/> | 107 <param name="input" value="sample.tif"/> |
90 <output name="output" value="out2.tif" ftype="tiff" compare="sim_size" delta="10"/> | 108 <param name="method_id" value="loc_gaussian"/> |
91 <param name="method_id" value="otsu"/> | 109 <param name="block_size" value="51"/> |
92 <param name="block_size" value="5"/> | 110 <param name="offset" value="1"/> |
93 <param name="invert_output" value="False"/> | 111 <param name="invert_output" value="False"/> |
112 <expand macro="tests/binary_image_diff" name="output" value="out2.tif" ftype="tiff"/> | |
94 </test> | 113 </test> |
95 <test> | 114 <test> |
96 <param name="input" value="sample.tif"/> | 115 <param name="input" value="sample.tif"/> |
97 <output name="output" value="out3.tif" ftype="tiff" compare="sim_size" delta="10"/> | 116 <param name="method_id" value="otsu"/> |
117 <param name="invert_output" value="False"/> | |
118 <expand macro="tests/binary_image_diff" name="output" value="out3.tif" ftype="tiff"/> | |
119 </test> | |
120 <test> | |
121 <param name="input" value="sample.tif"/> | |
98 <param name="method_id" value="manual"/> | 122 <param name="method_id" value="manual"/> |
99 <param name="threshold" value="64"/> | 123 <param name="threshold" value="64"/> |
100 <param name="invert_output" value="True"/> | 124 <param name="invert_output" value="True"/> |
125 <expand macro="tests/binary_image_diff" name="output" value="out4.tif" ftype="tiff"/> | |
126 </test> | |
127 <!-- Tests for multi-channel images --> | |
128 <test expect_failure="true"> | |
129 <param name="input" value="rgb.png"/> | |
101 </test> | 130 </test> |
102 </tests> | 131 </tests> |
103 <help> | 132 <help> |
104 Applies a standard thresholding algorithm to an image. | 133 |
134 **Applies a standard thresholding algorithm to a 2-D single-channel image. Yields a binary image.** | |
105 | 135 |
106 The thresholding algorithm automatically determines a threshold value (unless manual thresholding is used). | 136 The thresholding algorithm automatically determines a threshold value (unless manual thresholding is used). |
107 The input image is then thresholded, by assigning white (pixel value 255) to image regions above the determined threshold, | 137 The input image is then thresholded, by assigning white (pixel value 255) to image regions above the determined threshold, |
108 and black (pixel value 0) to image regions below or equal to the determined threshold. | 138 and black (pixel value 0) to image regions below or equal to the determined threshold. |
109 | 139 |
110 The assignment of black and white to image regions below and above the threshold is inverted, if the corresponding option is set. | 140 The assignment of black and white to image regions below and above the threshold is inverted, if the corresponding option is set. |
141 | |
111 </help> | 142 </help> |
112 <citations> | 143 <citations> |
113 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> | 144 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> |
114 </citations> | 145 </citations> |
115 </tool> | 146 </tool> |