comparison imagej2_noise.xml @ 0:3f6599ec7d30 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
author imgteam
date Tue, 17 Sep 2019 16:58:28 -0400
parents
children 7a44772cc89f
comparison
equal deleted inserted replaced
-1:000000000000 0:3f6599ec7d30
1 <?xml version='1.0' encoding='UTF-8'?>
2 <tool id="imagej2_noise" name="Add or remove noise" version="@WRAPPER_VERSION@.0">
3 <description></description>
4 <macros>
5 <import>imagej2_macros.xml</import>
6 <xml name="insertion_select">
7 <param name="insertion" type="select" label="Insertion">
8 <option value="additive" selected="True">Additive</option>
9 <option value="multiplicative">Multiplicative</option>
10 </param>
11 </xml>
12 </macros>
13 <expand macro="fiji_requirements" />
14 <command>
15 <![CDATA[
16 python $__tool_directory__/imagej2_noise.py
17 --input "$input"
18 --input_datatype $input.ext
19 --noise $noise_cond.noise
20 #if $noise_cond.noise == 'add_specified_noise':
21 --standard_deviation $noise_cond.standard_deviation
22 #else if $noise_cond.noise == 'remove_outliers':
23 --radius $noise_cond.radius
24 --threshold $noise_cond.threshold
25 --which_outliers $noise_cond.which_outliers
26 #else if $noise_cond.noise == 'randomj':
27 --randomj $noise_cond.randomj_cond.randomj
28 #if $noise_cond.randomj_cond.randomj == 'randomj_binomial':
29 --trials $noise_cond.randomj_cond.trials
30 --probability $noise_cond.randomj_cond.probability
31 #else if $noise_cond.randomj_cond.randomj == 'randomj_exponential':
32 --lammbda $noise_cond.randomj_cond.lammbda
33 #else if $noise_cond.randomj_cond.randomj == 'randomj_gamma':
34 --order $noise_cond.randomj_cond.order
35 #else if $noise_cond.randomj_cond.randomj == 'randomj_gaussian':
36 --mean $noise_cond.randomj_cond.mean
37 --sigma $noise_cond.randomj_cond.sigma
38 #else if $noise_cond.randomj_cond.randomj == 'randomj_poisson':
39 --mean $noise_cond.randomj_cond.mean
40 #else if $noise_cond.randomj_cond.randomj == 'randomj_uniform':
41 --min $noise_cond.randomj_cond.min
42 --max $noise_cond.randomj_cond.max
43 #end if
44 --insertion $noise_cond.randomj_cond.insertion
45 #end if
46 --jython_script $__tool_directory__/imagej2_noise_jython_script.py
47 --output "$output"
48 ]]>
49 </command>
50 <inputs>
51 <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="input" type="data" label="Select image"/>
52 <conditional name="noise_cond">
53 <param name="noise" type="select" label="Noise">
54 <option value="add_noise" selected="True">Add Random Noise</option>
55 <option value="add_specified_noise">Add Specified Noise</option>
56 <option value="salt_and_pepper">Salt and Pepper</option>
57 <option value="despeckle">Despeckle</option>
58 <option value="remove_outliers">Remove Outliers</option>
59 <option value="remove_nans">Remove NaNs</option>
60 <option value="rof_denoise">ROF Denoise</option>
61 <option value="randomj">RandomJ</option>
62 </param>
63 <when value="add_noise" />
64 <when value="add_specified_noise">
65 <param name="standard_deviation" type="float" value="25.0" label="Standard deviation" help="Floating point number"/>
66 </when>
67 <when value="salt_and_pepper" />
68 <when value="despeckle" />
69 <when value="remove_outliers">
70 <param name="radius" type="float" value="2.0" label="Radius" help="pixels"/>
71 <param name="threshold" type="float" value="50.0" label="Threshold"/>
72 <param name="which_outliers" type="select" label="Which Outliers">
73 <option value="bright" selected="True">Bright</option>
74 <option value="dark">Dark</option>
75 </param>
76 </when>
77 <when value="remove_nans" />
78 <when value="rof_denoise" />
79 <when value="randomj">
80 <conditional name="randomj_cond">
81 <param name="randomj" type="select" label="RandomJ">
82 <option value="randomj_binomial" selected="True">RandomJ Binomial</option>
83 <option value="randomj_exponential">RandomJ Exponential</option>
84 <option value="randomj_gamma">RandomJ Gamma</option>
85 <option value="randomj_gaussian">RandomJ Gaussian</option>
86 <option value="randomj_poisson">RandomJ Poisson</option>
87 <option value="randomj_uniform">RandomJ Uniform</option>
88 </param>
89 <when value="randomj_binomial">
90 <param name="trials" type="float" value="1.0" label="Trials"/>
91 <param name="probability" type="float" value="0.5" label="Probability"/>
92 <expand macro="insertion_select" />
93 </when>
94 <when value="randomj_exponential">
95 <param name="lammbda" type="float" value="0.5" label="Lambda"/>
96 <expand macro="insertion_select" />
97 </when>
98 <when value="randomj_gamma">
99 <param name="order" type="integer" value="1" label="Order"/>
100 <expand macro="insertion_select" />
101 </when>
102 <when value="randomj_gaussian">
103 <param name="mean" type="float" value="0.0" label="Mean"/>
104 <param name="sigma" type="float" value="1.0" label="Sigma"/>
105 <expand macro="insertion_select" />
106 </when>
107 <when value="randomj_poisson">
108 <param name="mean" type="float" value="1.0" label="Mean"/>
109 <expand macro="insertion_select" />
110 </when>
111 <when value="randomj_uniform">
112 <param name="min" type="float" value="0.0" label="Min"/>
113 <param name="max" type="float" value="1.0" label="Max"/>
114 <expand macro="insertion_select" />
115 </when>
116 </conditional>
117 </when>
118 </conditional>
119 </inputs>
120 <outputs>
121 <data name="output" format_source="input" label="${tool.name} on ${on_string}: ${noise_cond.noise.replace( '_', ' ' )}" />
122 </outputs>
123 <tests>
124 <test>
125 <param name="input" value="blobs.gif" />
126 <param name="input_datatype" value="gif" />
127 <param name="noise" value="add_specified_noise" />
128 <output name="output" file="add_specified_noise.gif" />
129 </test>
130 <test>
131 <param name="input" value="blobs.gif" />
132 <param name="input_datatype" value="gif" />
133 <param name="noise" value="despeckle" />
134 <output name="output" file="despeckle.gif" />
135 </test>
136 <test>
137 <param name="input" value="blobs.gif" />
138 <param name="input_datatype" value="gif" />
139 <param name="noise" value="remove_outliers" />
140 <param name="radius" value="2.0" />
141 <param name="threshold" value="50.0" />
142 <param name="which_outliers" value="bright" />
143 <output name="output" file="remove_outliers.gif" />
144 </test>
145 </tests>
146 <help>
147 **What it does**
148
149 <![CDATA[
150 Adds noise to or removes noise from images.
151
152 - **Add Random Noise** - Adds random noise to the image. The noise is Gaussian (normally) distributed with a mean of zero and standard deviation of 25.
153 - **Add Specified Noise** - Adds Gaussian noise with a mean of zero and a chosen standard deviation.
154 - **Salt and Pepper** - Adds salt and pepper noise to the image by randomly replacing 2.5% of the pixels with black pixels and 2.5% with white pixels. This command only works with 8-bit images.
155 - **Despeckle** - Replaces each pixel with the median value in its 3 × 3 neighborhood. This is a time consuming operation because for each pixel, the nine pixels in the 3 × 3 neighborhood must be sorted and the center pixel replaced with the median value (the fifth).
156 - **Remove Outliers** - Replaces a pixel by the median of the pixels in the surrounding if it deviates from the median by more than a certain value (the threshold).
157 - **Remove NaNs** - Replaces NaN (Not-a-Number) pixels in 32-bit images by the median of the neighbors inside the circular kernel area defined by Radius. It does not remove patches of NaNs larger than the kernel size, however.
158 - **RandonJ Binomial** - Contaminates image with random numbers generated using a binomial random variable
159 - **RandonJ Exponential** - Contaminates image with random numbers generated using an exponential random variable.
160 - **RandonJ Gamma** - Contaminates image with random numbers generated using a gamma random variable.
161 - **RandonJ Gaussian** - Contaminates image with random numbers generated using a Gaussian random variable.
162 - **RandonJ Poisson** - Contaminates image with random numbers generated using a Poisson random variable.
163 - **RandonJ Uniform** - Contaminates image with random numbers generated using a uniform random variable.
164 ]]>
165 </help>
166 <expand macro="fiji_headless_citations" />
167 </tool>