comparison imagej2_adjust_threshold_binary.xml @ 3:2b007b1e6c1b draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
author imgteam
date Wed, 25 Sep 2024 16:06:33 +0000
parents da29019170f1
children
comparison
equal deleted inserted replaced
2:da29019170f1 3:2b007b1e6c1b
1 <tool id="imagej2_adjust_threshold_binary" name="Adjust threshold" version="@WRAPPER_VERSION@.1"> 1 <tool id="imagej2_adjust_threshold_binary" name="Adjust threshold" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
2 <description>with ImageJ2</description> 2 <description>with ImageJ2</description>
3 <macros> 3 <macros>
4 <import>imagej2_macros.xml</import> 4 <import>imagej2_macros.xml</import>
5 </macros> 5 </macros>
6 <edam_operations> 6 <edam_operations>
11 <xref type="biii">imagej2</xref> 11 <xref type="biii">imagej2</xref>
12 </xrefs> 12 </xrefs>
13 <expand macro="fiji_requirements"/> 13 <expand macro="fiji_requirements"/>
14 <command detect_errors="exit_code"><![CDATA[ 14 <command detect_errors="exit_code"><![CDATA[
15 #import os 15 #import os
16 #set error_log = 'output_log.txt'
17 #set input_sans_ext = $os.path.splitext($os.path.basename($input.file_name))[0] 16 #set input_sans_ext = $os.path.splitext($os.path.basename($input.file_name))[0]
18 #set input_with_ext = '.'.join([input_sans_ext, $input.ext]) 17 #set input_with_ext = './' + '.'.join([input_sans_ext, $input.ext])
19 ln -s '$input.file_name' '$input_with_ext' && 18 ln -s '$input.file_name' '$input_with_ext' &&
20 #set output_filename = '.'.join(['output', $input.ext]) 19 #set output_filename = '.'.join(['output', $input.ext])
21 touch '$output_filename' && 20 touch '$output_filename' &&
22 touch '$error_log' &&
23 ImageJ --ij2 --headless --debug 21 ImageJ --ij2 --headless --debug
24 --jython '$__tool_directory__/imagej2_adjust_threshold_binary_jython_script.py' 22 --jython '$__tool_directory__/imagej2_adjust_threshold_binary_jython_script.py'
25 '$error_log'
26 '$input_with_ext' 23 '$input_with_ext'
27 $threshold_min 24 $method_cond.threshold_min
28 $threshold_max 25 $method_cond.threshold_max
29 '$method' 26 '$method_cond.method'
30 '$display' 27 '$display'
31 '$black_background' 28 '$method_cond.black_background'
32 '$stack_histogram'
33 '$output_filename' 29 '$output_filename'
34 '$input.ext' 30 '$input.ext'
35 &>'$error_log'; 31 && mv '$output_filename' '$output';
36 if [[ $? -ne 0 ]]; then
37 cat '$error_log' >&2;
38 else
39 mv '$output_filename' '$output';
40 fi
41 ]]></command> 32 ]]></command>
42 <inputs> 33 <inputs>
43 <expand macro="param_input"/> 34 <expand macro="param_input"/>
44 <param name="threshold_min" type="float" value="0" min="0" max="255" label="Minimum threshold value"/> 35 <conditional name="method_cond">
45 <param name="threshold_max" type="float" value="0" min="0" max="255" label="Maximum threshold value"/> 36 <param name="auto_method" type="select" label="Use autothreshold or manual">
46 <param name="method" type="select" label="Method" help="The Default method is the modified IsoData algorithm."> 37 <option value="Auto" selected="true">Autothreshold</option>
47 <option value="Default" selected="True">Default</option> 38 <option value="Manual" selected="true">Manual (set min max values)</option>
48 <option value="Huang">Huang</option> 39 </param>
49 <option value="Intermodes">Intermodes</option> 40 <when value="Auto">
50 <option value="IsoData">IsoData</option> 41 <param name="method" type="select" label="Method" help="The Default method is the modified IsoData algorithm.">
51 <option value="IJ_IsoData">IJ_IsoData</option> 42 <option value="Default" selected="True">Default</option>
52 <option value="Li">Li</option> 43 <option value="Huang">Huang</option>
53 <option value="MaxEntropy">MaxEntropy</option> 44 <option value="Huang2">Huang2</option>
54 <option value="Mean">Mean</option> 45 <option value="Intermodes">Intermodes</option>
55 <option value="MinError">MinError</option> 46 <option value="IsoData">IsoData</option>
56 <option value="Minimum">Minimum</option> 47 <option value="Li">Li</option>
57 <option value="Moments">Moments</option> 48 <option value="MaxEntropy">MaxEntropy</option>
58 <option value="Otsu">Otsu</option> 49 <option value="Mean">Mean</option>
59 <option value="RenyiEntropy">RenyiEntropy</option> 50 <option value="MinError(I)">MinError(I)</option>
60 <option value="Shanbhag">Shanbhag</option> 51 <option value="Minimum">Minimum</option>
61 <option value="Triangle">Triangle</option> 52 <option value="Moments">Moments</option>
62 <option value="Yen">Yen</option> 53 <option value="Otsu">Otsu</option>
63 </param> 54 <option value="Percentile">Percentile</option>
55 <option value="RenyiEntropy">RenyiEntropy</option>
56 <option value="Shanbhag">Shanbhag</option>
57 <option value="Triangle">Triangle</option>
58 <option value="Yen">Yen</option>
59 </param>
60 <expand macro="black_background_param"/>
61 <param type="hidden" name="threshold_min" value="0.0"/>
62 <param type="hidden" name="threshold_max" value="255.0"/>
63 </when>
64 <when value="Manual">
65 <param type="hidden" name="method" value="Manual"/>
66 <param type="hidden" name="black_background" value="yes"/>
67 <param name="threshold_min" type="float" value="0" min="0" max="255" label="Minimum threshold value"/>
68 <param name="threshold_max" type="float" value="0" min="0" max="255" label="Maximum threshold value"/>
69 </when>
70 </conditional>
64 <param name="display" type="select" label="Display"> 71 <param name="display" type="select" label="Display">
65 <option value="red" selected="True">Red</option> 72 <option value="red" selected="True">Red</option>
66 <option value="bw">Black and White</option> 73 <option value="bw">Black and White</option>
67 <option value="over_under">Over/Under</option> 74 <option value="over_under">Over/Under</option>
68 </param>
69 <param name="black_background" type="select" label="Black background" help="Select yes if features are lighter than the background.">
70 <option value="no" selected="True">No</option>
71 <option value="yes">Yes</option>
72 </param>
73 <param name="stack_histogram" type="select" label="Stack histogram" help="Select yes to first compute the histogram of the whole stack (or hyperstack) and then compute the threshold based on that histogram.">
74 <option value="no" selected="True">No</option>
75 <option value="yes">Yes</option>
76 </param> 75 </param>
77 </inputs> 76 </inputs>
78 <outputs> 77 <outputs>
79 <data name="output" format_source="input"/> 78 <data name="output" format_source="input"/>
80 </outputs> 79 </outputs>
81 <tests> 80 <tests>
82 <test> 81 <test>
83 <param name="input" value="blobs.gif"/> 82 <param name="input" value="blobs.gif"/>
84 <param name="output_datatype" value="gif"/> 83 <conditional name="method_cond">
85 <param name="threshold_min" value="0.0"/> 84 <param name="method" value="Default"/>
86 <param name="threshold_max" value="129.0"/> 85 <param name="black_background" value="no"/>
87 <param name="method" value="Default"/> 86 </conditional>
88 <param name="display" value="red"/> 87 <param name="display" value="red"/>
89 <param name="black_background" value="no"/> 88 <output name="output" file="blobs_threshold_default.gif" compare="image_diff" metric="iou"/>
90 <param name="stack_histogram" value="no"/>
91 <output name="output" file="blobs_threshold_default.gif" compare="sim_size"/>
92 </test> 89 </test>
93 <test> 90 <test>
94 <param name="input" value="blobs.gif"/> 91 <param name="input" value="blobs.gif"/>
95 <param name="output_datatype" value="gif"/> 92 <conditional name="method_cond">
96 <param name="threshold_min" value="118.0"/> 93 <param name="method" value="Percentile"/>
97 <param name="threshold_max" value="255.0"/> 94 <param name="black_background" value="no"/>
98 <param name="method" value="IJ_IsoData"/> 95 </conditional>
99 <param name="display" value="over_under"/> 96 <param name="display" value="over_under"/>
100 <param name="black_background" value="no"/> 97 <output name="output" file="blobs_threshold_percentile.gif" compare="image_diff" metric="iou"/>
101 <param name="stack_histogram" value="no"/>
102 <output name="output" file="blobs_threshold_ijiso.gif" compare="sim_size"/>
103 </test> 98 </test>
104 <test> 99 <test>
105 <param name="input" value="blobs.gif"/> 100 <param name="input" value="blobs.gif"/>
106 <param name="output_datatype" value="gif"/> 101 <conditional name="method_cond">
107 <param name="threshold_min" value="72.0"/> 102 <param name="method" value="Huang"/>
108 <param name="threshold_max" value="255.0"/> 103 <param name="black_background" value="yes"/>
109 <param name="method" value="Huang"/> 104 </conditional>
110 <param name="display" value="bw"/> 105 <param name="display" value="bw"/>
111 <param name="black_background" value="yes"/> 106 <output name="output" file="blobs_threshold_huang_dark.gif" compare="image_diff" metric="iou"/>
112 <param name="stack_histogram" value="no"/> 107 </test>
113 <output name="output" file="blobs_threshold_huang_dark.gif" compare="sim_size"/> 108 <test>
109 <param name="input" value="blobs.gif"/>
110 <conditional name="method_cond">
111 <param name="auto_method" value="Manual"/>
112 <param name="threshold_min" value="8"/>
113 <param name="threshold_max" value="255"/>
114 </conditional>
115 <param name="display" value="bw"/>
116 <output name="output" file="blobs_threshold_8-255.gif" compare="image_diff" metric="iou"/>
117 </test>
118 <test>
119 <param name="input" value="blobs.gif"/>
120 <conditional name="method_cond">
121 <param name="auto_method" value="Manual"/>
122 <param name="threshold_min" value="0"/>
123 <param name="threshold_max" value="8"/>
124 </conditional>
125 <param name="display" value="bw"/>
126 <output name="output" file="blobs_threshold_0-8.gif" compare="image_diff" metric="iou"/>
127 </test>
128 <test>
129 <param name="input" value="confocal-series-first-channel.tif"/>
130 <conditional name="method_cond">
131 <param name="method" value="Default"/>
132 <param name="black_background" value="yes"/>
133 </conditional>
134 <param name="display" value="bw"/>
135 <output name="output" file="confocal-series-first-channel_threshold_default.tiff" compare="sim_size"/>
114 </test> 136 </test>
115 </tests> 137 </tests>
116 <help> 138 <help>
117 139
118 @requires_binary_input@ 140 @requires_binary_input@
122 <![CDATA[ 144 <![CDATA[
123 Sets lower and upper threshold values, segmenting grayscale images into features of interest and background 145 Sets lower and upper threshold values, segmenting grayscale images into features of interest and background
124 146
125 - **Minimum threshold value** - Adjusts the minimum threshold value. 147 - **Minimum threshold value** - Adjusts the minimum threshold value.
126 - **Maximum threshold value** - Adjusts the maximum threshold value. 148 - **Maximum threshold value** - Adjusts the maximum threshold value.
127 - **Method** - Allows any of the 16 different automatic thresholding methods to be selected. These are global thresholding methods that typically cannot deal with unevenly illuminated images (such as in brightfield microscopy)." 149 - **Method** - Allows any of the 17 different automatic thresholding methods to be selected. These are global thresholding methods that typically cannot deal with unevenly illuminated images (such as in brightfield microscopy)."
128 - **Display** - Selects one of three display mode: **Red** displays the thresholded values in red, **Black and White** features are displayed in black and background in white, **Over/Under** displays pixels below the lower threshold value in blue, thresholded pixels in grayscale, and pixels above the upper threshold value in green. 150 - **Display** - Selects one of three display mode: **Red** displays the thresholded values in red, **Black and White** features are displayed in black and background in white, **Over/Under** displays pixels below the lower threshold value in blue, thresholded pixels in grayscale, and pixels above the upper threshold value in green.
129 - **Black background** - Select **yes** when features are lighter than the background. 151 - **Black background** - Select **yes** when features are lighter than the background.
130 - **Stack histogram**  Select **yes** to first compute the histogram of the whole stack (or hyperstack) and then compute the threshold based on that histogram. As such, all slices are binarized using the single computed value. If unchecked, the threshold of each slice is computed separately.
131 ]]> 152 ]]>
132 153
133 </help> 154 </help>
134 <expand macro="fiji_headless_citations"/> 155 <expand macro="fiji_headless_citations"/>
135 </tool> 156 </tool>