Mercurial > repos > imgteam > 2d_simple_filter
comparison filter.xml @ 3:6c4b22ef2b81 draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_simple_filter/ commit c045f067a57e8308308cf6329060c7ccd3fc372f
author | imgteam |
---|---|
date | Thu, 04 Apr 2024 15:23:42 +0000 |
parents | f70b215d155c |
children | d51310ab328a |
comparison
equal
deleted
inserted
replaced
2:f70b215d155c | 3:6c4b22ef2b81 |
---|---|
1 <tool id="ip_filter_standard" name="Filter 2D image" version="0.0.3-3"> | 1 <tool id="ip_filter_standard" name="Filter 2-D image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> |
2 <description>with scikit-image</description> | 2 <description>with scipy</description> |
3 <macros> | |
4 <import>creators.xml</import> | |
5 <import>tests.xml</import> | |
6 <token name="@TOOL_VERSION@">1.12.0</token> | |
7 <token name="@VERSION_SUFFIX@">0</token> | |
8 </macros> | |
9 <creator> | |
10 <expand macro="creators/bmcv" /> | |
11 </creator> | |
3 <edam_operations> | 12 <edam_operations> |
4 <edam_operation>operation_3443</edam_operation> | 13 <edam_operation>operation_3443</edam_operation> |
5 </edam_operations> | 14 </edam_operations> |
6 <xrefs> | 15 <xrefs> |
7 <xref type="bio.tools">scikit-image</xref> | 16 <xref type="biii">scipy</xref> |
8 <xref type="biii">scikit-image</xref> | |
9 </xrefs> | 17 </xrefs> |
10 <requirements> | 18 <requirements> |
11 <requirement type="package" version="0.14.2">scikit-image</requirement> | 19 <requirement type="package" version="@TOOL_VERSION@">scipy</requirement> |
12 <requirement type="package" version="1.15.4">numpy</requirement> | 20 <requirement type="package" version="1.26.4">numpy</requirement> |
13 <requirement type="package" version="5.3.0">pillow</requirement> | 21 <requirement type="package" version="0.22.0">scikit-image</requirement> |
14 <requirement type="package" version="0.15.1">tifffile</requirement> | 22 <requirement type="package" version="2024.2.12">tifffile</requirement> |
15 </requirements> | 23 </requirements> |
16 <command detect_errors="aggressive"> | 24 <command detect_errors="aggressive"><![CDATA[ |
17 <![CDATA[ | 25 |
18 python '$__tool_directory__/filter_image.py' '$input' '$output' $filter_type $radius | 26 python '$__tool_directory__/filter_image.py' |
19 ]]> | 27 |
20 </command> | 28 '$input' |
29 '$output' | |
30 | |
31 $filter_type | |
32 $size | |
33 | |
34 ]]></command> | |
21 <inputs> | 35 <inputs> |
22 <param name="filter_type" type="select" label="Filter type"> | 36 <param name="input" type="data" format="tiff,png" label="Input image" /> |
23 <option value="median" selected="True">Median</option> | 37 <conditional name="filter"> |
24 <option value="gaussian">Gaussian Blur</option> | 38 <param name="filter_type" type="select" label="Filter type"> |
25 <option value="prewitt">Prewitt</option> | 39 <option value="gaussian" selected="True">Gaussian</option> |
26 <option value="sobel">Sobel</option> | 40 <option value="median">Median</option> |
27 <option value="scharr">Scharr</option> | 41 <option value="prewitt_h">Prewitt horizontal</option> |
28 </param> | 42 <option value="prewitt_v">Prewitt vertical</option> |
29 <param name="radius" type="integer" value="3" label="Radius/Sigma" /> | 43 <option value="sobel_h">Sobel horizontal</option> |
30 <param name="input" type="data" format="tiff" label="Source file" /> | 44 <option value="sobel_v">Sobel vertical</option> |
45 </param> | |
46 <when value="gaussian"> | |
47 <param name="size" type="float" value="3" min="0.1" label="Sigma" help="The half width of the Gaussian bell (in pixels)." /> | |
48 </when> | |
49 <when value="median"> | |
50 <param name="size" type="integer" value="3" label="Radius" help="Radius of the neighborhood (in pixels)." /> | |
51 </when> | |
52 <when value="prewitt_h"> | |
53 <param name="size" type="hidden" value="0" /> | |
54 </when> | |
55 <when value="prewitt_v"> | |
56 <param name="size" type="hidden" value="0" /> | |
57 </when> | |
58 <when value="sobel_h"> | |
59 <param name="size" type="hidden" value="0" /> | |
60 </when> | |
61 <when value="sobel_v"> | |
62 <param name="size" type="hidden" value="0" /> | |
63 </when> | |
64 </conditional> | |
31 </inputs> | 65 </inputs> |
32 <outputs> | 66 <outputs> |
33 <data format="tiff" name="output" /> | 67 <data format="tiff" name="output" /> |
34 </outputs> | 68 </outputs> |
35 <tests> | 69 <tests> |
36 <test> | 70 <!-- Tests with uint8 TIFF input image --> |
37 <param name="input" value="sample.tif" /> | 71 <test> |
38 <output name="output" value="res.tif" ftype="tiff" compare="sim_size"/> | 72 <param name="input" value="input1_uint8.tif" /> |
39 <param name="filter_type" value="prewitt" /> | 73 <param name="filter_type" value="gaussian" /> |
40 <param name="radius" value="4" /> | 74 <expand macro="tests/intensity_image_diff" name="output" value="input1_gaussian.tif" ftype="tiff"> |
41 </test> | 75 <!-- |
76 | |
77 The input file `input1_uint8.tif` has values ranging between 23 and 254, with a mean value of 63.67. | |
78 | |
79 Below, we use an assertion in addition to the `image_diff` comparison, to ensure that the range of | |
80 values is preserved. The motiviation behind this is that the expectation images are usually checked | |
81 visually, which means that the `image_diff` comparison is likely to ensure that the brightness of | |
82 the image is correct, thus it's good to double-check the range of values (hence the comparably large | |
83 value for `eps`). This also concerns the median filter. | |
84 | |
85 --> | |
86 <has_image_mean_intensity mean_intensity="63.67" eps="10"/> | |
87 </expand> | |
88 </test> | |
89 <test> | |
90 <param name="input" value="input1_uint8.tif" /> | |
91 <param name="filter_type" value="median" /> | |
92 <expand macro="tests/intensity_image_diff" name="output" value="input1_median.tif" ftype="tiff"> | |
93 <!-- See note for Gaussian filter above. --> | |
94 <has_image_mean_intensity mean_intensity="63.67" eps="10"/> | |
95 </expand> | |
96 </test> | |
97 <test> | |
98 <param name="input" value="input1_uint8.tif" /> | |
99 <param name="filter_type" value="prewitt_h" /> | |
100 <expand macro="tests/intensity_image_diff" name="output" value="input1_prewitt_h.tif" ftype="tiff"/> | |
101 </test> | |
102 <test> | |
103 <param name="input" value="input1_uint8.tif" /> | |
104 <param name="filter_type" value="prewitt_v" /> | |
105 <expand macro="tests/intensity_image_diff" name="output" value="input1_prewitt_v.tif" ftype="tiff"/> | |
106 </test> | |
107 <test> | |
108 <param name="input" value="input1_uint8.tif" /> | |
109 <param name="filter_type" value="sobel_h" /> | |
110 <expand macro="tests/intensity_image_diff" name="output" value="input1_sobel_h.tif" ftype="tiff"/> | |
111 </test> | |
112 <test> | |
113 <param name="input" value="input1_uint8.tif" /> | |
114 <param name="filter_type" value="sobel_v" /> | |
115 <expand macro="tests/intensity_image_diff" name="output" value="input1_sobel_v.tif" ftype="tiff"/> | |
116 </test> | |
117 <!-- Tests with float TIFF input image --> | |
118 <test> | |
119 <param name="input" value="input2_float.tif" /> | |
120 <param name="filter_type" value="gaussian" /> | |
121 <expand macro="tests/intensity_image_diff" name="output" value="input2_gaussian.tif" ftype="tiff"> | |
122 <!-- See note for Gaussian filter above. --> | |
123 <has_image_mean_intensity mean_intensity="0.25" eps="0.01"/> | |
124 </expand> | |
125 </test> | |
42 </tests> | 126 </tests> |
43 <help> | 127 <help> |
44 **What it does** | |
45 | 128 |
46 Applies a standard filter to an image. | 129 **Applies a standard filter to a single-channel 2-D image.** |
130 | |
131 Mean filters like the Gaussian filter or the median filter preserve both the brightness of the image, and the range of values. | |
132 | |
47 </help> | 133 </help> |
48 <citations> | 134 <citations> |
49 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> | 135 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> |
50 </citations> | 136 </citations> |
51 </tool> | 137 </tool> |