Mercurial > repos > imgteam > clip_image
comparison clip_image.xml @ 1:eb5a84e77beb draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/clip_image/ commit e9a49428eb8424b1e2b80093e6b3f924f98f2d14
| author | imgteam |
|---|---|
| date | Sun, 04 Jan 2026 22:20:07 +0000 |
| parents | 969840610383 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:969840610383 | 1:eb5a84e77beb |
|---|---|
| 1 <tool id="clip_image" name="Clip image intensities" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> | 1 <tool id="clip_image" name="Clip image intensities" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="25.1"> |
| 2 <description>with giatools</description> | 2 <description>with giatools</description> |
| 3 <macros> | 3 <macros> |
| 4 <import>creators.xml</import> | 4 <import>creators.xml</import> |
| 5 <import>tests.xml</import> | 5 <import>tests.xml</import> |
| 6 <token name="@TOOL_VERSION@">0.7.3</token> | 6 <token name="@TOOL_VERSION@">0.7.3</token> |
| 7 <token name="@VERSION_SUFFIX@">0</token> | 7 <token name="@VERSION_SUFFIX@">0</token> |
| 8 <xml name="bound" tokens="name,label,help"> | 8 <xml name="bound" tokens="name,label,help"> |
| 9 <param name="@NAME@" type="float" label="@LABEL@" help="@HELP@"/> | 9 <param name="@NAME@" type="float" optional="true" label="@LABEL@" help="@HELP@"/> |
| 10 </xml> | |
| 11 <xml name="lower_bound"> | |
| 12 <expand macro="bound" name="lower_bound" label="Lower bound" | |
| 13 help="Image intensities below this value will be set to this value."/> | |
| 14 </xml> | |
| 15 <xml name="upper_bound"> | |
| 16 <expand macro="bound" name="upper_bound" label="Upper bound" | |
| 17 help="Image intensities above this value will be set to this value."/> | |
| 18 </xml> | 10 </xml> |
| 19 </macros> | 11 </macros> |
| 20 <creator> | 12 <creator> |
| 21 <expand macro="creators/bmcv"/> | 13 <expand macro="creators/bmcv"/> |
| 22 <expand macro="creators/kostrykin"/> | 14 <expand macro="creators/kostrykin"/> |
| 53 ]]></command> | 45 ]]></command> |
| 54 <configfiles> | 46 <configfiles> |
| 55 <configfile name="params"><![CDATA[ | 47 <configfile name="params"><![CDATA[ |
| 56 { | 48 { |
| 57 | 49 |
| 58 #if "lower" in str($setup.mode) | 50 #if str($lower_bound) != "" |
| 59 "lower_bound": $setup.lower_bound, | 51 "lower_bound": $lower_bound, |
| 60 #end if | 52 #end if |
| 61 | 53 |
| 62 #if "upper" in str($setup.mode) | 54 #if str($upper_bound) != "" |
| 63 "upper_bound": $setup.upper_bound, | 55 "upper_bound": $upper_bound, |
| 64 #end if | 56 #end if |
| 65 | 57 |
| 66 "": null | 58 "": null |
| 67 } | 59 } |
| 68 ]]></configfile> | 60 ]]></configfile> |
| 69 </configfiles> | 61 </configfiles> |
| 70 <inputs> | 62 <inputs> |
| 71 <param name="input" type="data" format="tiff,zarr,png,jpg" label="Input image"/> | 63 <param name="input" type="data" format="tiff,zarr,png,jpg" label="Input image"/> |
| 72 <conditional name="setup"> | 64 <expand macro="bound" name="lower_bound" label="Lower bound" |
| 73 <param name="mode" type="select" label="Clipping"> | 65 help="Image intensities below this value will be set to this value."/> |
| 74 <option value="lower-upper" selected="true">Clip to lower and upper bounds</option> | 66 <expand macro="bound" name="upper_bound" label="Upper bound" |
| 75 <option value="lower">Clip to lower bound</option> | 67 help="Image intensities above this value will be set to this value."/> |
| 76 <option value="upper">Clip to upper bound</option> | |
| 77 </param> | |
| 78 <when value="lower-upper"> | |
| 79 <expand macro="lower_bound"/> | |
| 80 <expand macro="upper_bound"/> | |
| 81 </when> | |
| 82 <when value="lower"> | |
| 83 <expand macro="lower_bound"/> | |
| 84 </when> | |
| 85 <when value="upper"> | |
| 86 <expand macro="upper_bound"/> | |
| 87 </when> | |
| 88 </conditional> | |
| 89 </inputs> | 68 </inputs> |
| 90 <outputs> | 69 <outputs> |
| 91 <data format="tiff" name="output" from_work_dir="output.tiff"/> | 70 <data format="tiff" name="output" from_work_dir="output.tiff"/> |
| 92 </outputs> | 71 </outputs> |
| 93 <tests> | 72 <tests> |
| 94 <test> | 73 <test> |
| 95 <param name="input" value="input/input4_float16.tiff"/> | 74 <param name="input" value="input/input4_float16.tiff"/> |
| 96 <conditional name="setup"> | 75 <param name="lower_bound" value="0.5"/> |
| 97 <param name="mode" value="lower"/> | |
| 98 <param name="lower_bound" value="0.5"/> | |
| 99 </conditional> | |
| 100 <expand macro="tests/intensity_image_diff" name="output" value="output/input4.tiff" ftype="tiff"/> | 76 <expand macro="tests/intensity_image_diff" name="output" value="output/input4.tiff" ftype="tiff"/> |
| 101 <assert_stdout> | 77 <assert_stdout> |
| 102 <has_line line="[input] Input image axes: ZYX"/> | 78 <has_line line="[input] Input image axes: ZYX"/> |
| 103 <has_line line="[input] Input image shape: (10, 15, 18)"/> | 79 <has_line line="[input] Input image shape: (10, 15, 18)"/> |
| 104 <has_line line="[input] Input image dtype: float16"/> | 80 <has_line line="[input] Input image dtype: float16"/> |
| 110 <has_line line="[output] Output image resolution=(2.0, 1.0), unit='inch', z_spacing=2.0"/> | 86 <has_line line="[output] Output image resolution=(2.0, 1.0), unit='inch', z_spacing=2.0"/> |
| 111 </assert_stdout> | 87 </assert_stdout> |
| 112 </test> | 88 </test> |
| 113 <test> | 89 <test> |
| 114 <param name="input" value="input/input5.jpg"/> | 90 <param name="input" value="input/input5.jpg"/> |
| 115 <conditional name="setup"> | 91 <param name="upper_bound" value="100.5"/> |
| 116 <param name="mode" value="upper"/> | |
| 117 <param name="upper_bound" value="100.5"/> | |
| 118 </conditional> | |
| 119 <expand macro="tests/intensity_image_diff" name="output" value="output/input5.tiff" ftype="tiff"/> | 92 <expand macro="tests/intensity_image_diff" name="output" value="output/input5.tiff" ftype="tiff"/> |
| 120 <assert_stdout> | 93 <assert_stdout> |
| 121 <has_line line="[input] Input image axes: YXC"/> | 94 <has_line line="[input] Input image axes: YXC"/> |
| 122 <has_line line="[input] Input image shape: (10, 10, 3)"/> | 95 <has_line line="[input] Input image shape: (10, 10, 3)"/> |
| 123 <has_line line="[input] Input image dtype: uint8"/> | 96 <has_line line="[input] Input image dtype: uint8"/> |
| 127 <has_line line="[output] Output image dtype: uint8"/> | 100 <has_line line="[output] Output image dtype: uint8"/> |
| 128 </assert_stdout> | 101 </assert_stdout> |
| 129 </test> | 102 </test> |
| 130 <test expect_failure="true"> | 103 <test expect_failure="true"> |
| 131 <param name="input" value="input/input5.jpg"/> | 104 <param name="input" value="input/input5.jpg"/> |
| 132 <conditional name="setup"> | 105 <param name="lower_bound" value="60"/> |
| 133 <param name="mode" value="lower-upper"/> | 106 <param name="upper_bound" value="50"/> |
| 134 <param name="lower_bound" value="60"/> | |
| 135 <param name="upper_bound" value="50"/> | |
| 136 </conditional> | |
| 137 <assert_stderr> | 107 <assert_stderr> |
| 138 <has_line line="Lower bound (60) must be less or equal compared to the upper bound (50)."/> | 108 <has_line line="Lower bound (60) must be less or equal compared to the upper bound (50)."/> |
| 139 </assert_stderr> | 109 </assert_stderr> |
| 140 </test> | 110 </test> |
| 141 <test> | 111 <test> |
| 142 <param name="input" value="input/input6_yx.zarr"/> | 112 <param name="input" value="input/input6_yx.zarr"/> |
| 143 <conditional name="setup"> | 113 <param name="lower_bound" value="-21.5"/> |
| 144 <param name="mode" value="lower-upper"/> | 114 <param name="upper_bound" value="101.5"/> |
| 145 <param name="lower_bound" value="-21.5"/> | |
| 146 <param name="upper_bound" value="101.5"/> | |
| 147 </conditional> | |
| 148 <expand macro="tests/intensity_image_diff" name="output" value="output/input6.tiff" ftype="tiff"/> | 115 <expand macro="tests/intensity_image_diff" name="output" value="output/input6.tiff" ftype="tiff"/> |
| 149 <assert_stdout> | 116 <assert_stdout> |
| 150 <has_line line="[input] Input image axes: YX"/> | 117 <has_line line="[input] Input image axes: YX"/> |
| 151 <has_line line="[input] Input image shape: (200, 200)"/> | 118 <has_line line="[input] Input image shape: (200, 200)"/> |
| 152 <has_line line="[input] Input image dtype: float64"/> | 119 <has_line line="[input] Input image dtype: float64"/> |
| 154 <has_line line="Applying clipping: [-21.5, 101.5]"/> | 121 <has_line line="Applying clipping: [-21.5, 101.5]"/> |
| 155 <has_line line="[output] Output image axes: YX"/> | 122 <has_line line="[output] Output image axes: YX"/> |
| 156 <has_line line="[output] Output image shape: (200, 200)"/> | 123 <has_line line="[output] Output image shape: (200, 200)"/> |
| 157 <has_line line="[output] Output image dtype: float64"/> | 124 <has_line line="[output] Output image dtype: float64"/> |
| 158 <has_line line="[output] Output image resolution=(1.0, 1.0), unit='um'"/> | 125 <has_line line="[output] Output image resolution=(1.0, 1.0), unit='um'"/> |
| 126 </assert_stdout> | |
| 127 </test> | |
| 128 <test> | |
| 129 <param name="input" value="input/input4_float16.tiff"/> | |
| 130 <expand macro="tests/intensity_image_diff" name="output" value="input/input4_float16.tiff" ftype="tiff"/> | |
| 131 <assert_stdout> | |
| 132 <has_line line="[input] Input image axes: ZYX"/> | |
| 133 <has_line line="[input] Input image shape: (10, 15, 18)"/> | |
| 134 <has_line line="[input] Input image dtype: float16"/> | |
| 135 <has_line line="[input] Input image resolution=(2.0, 1.0), unit='inch', z_spacing=2.0"/> | |
| 136 <has_line line="Applying clipping: [-inf, inf]"/> | |
| 137 <has_line line="[output] Output image axes: ZYX"/> | |
| 138 <has_line line="[output] Output image shape: (10, 15, 18)"/> | |
| 139 <has_line line="[output] Output image dtype: float16"/> | |
| 140 <has_line line="[output] Output image resolution=(2.0, 1.0), unit='inch', z_spacing=2.0"/> | |
| 159 </assert_stdout> | 141 </assert_stdout> |
| 160 </test> | 142 </test> |
| 161 </tests> | 143 </tests> |
| 162 <help> | 144 <help> |
| 163 | 145 |
