Mercurial > repos > imgteam > scale_image
comparison scale_image.xml @ 3:ba2b1a6f1b84 draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/scale_image/ commit c55311bbe4c3d7e0039c77785509a150864bb272
| author | imgteam |
|---|---|
| date | Thu, 17 Oct 2024 10:47:14 +0000 |
| parents | ac497ba6819d |
| children | 5122286b700e |
comparison
equal
deleted
inserted
replaced
| 2:ac497ba6819d | 3:ba2b1a6f1b84 |
|---|---|
| 1 <tool id="ip_scale_image" name="Scale Image" version="0.4"> | 1 <tool id="ip_scale_image" name="Scale image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> |
| 2 <description>Scales image</description> | 2 <description>with scikit-image</description> |
| 3 <macros> | |
| 4 <import>creators.xml</import> | |
| 5 <import>tests.xml</import> | |
| 6 <token name="@TOOL_VERSION@">0.18.3</token> | |
| 7 <token name="@VERSION_SUFFIX@">2</token> | |
| 8 </macros> | |
| 9 <creator> | |
| 10 <expand macro="creators/bmcv" /> | |
| 11 </creator> | |
| 12 <edam_operations> | |
| 13 <edam_operation>operation_3443</edam_operation> | |
| 14 </edam_operations> | |
| 15 <xrefs> | |
| 16 <xref type="bio.tools">scikit-image</xref> | |
| 17 <xref type="biii">scikit-image</xref> | |
| 18 </xrefs> | |
| 3 <requirements> | 19 <requirements> |
| 4 <requirement type="package" version="6.1.0">pillow</requirement> | 20 <requirement type="package" version="@TOOL_VERSION@">scikit-image</requirement> |
| 5 <requirement type="package" version="0.14.2">scikit-image</requirement> | 21 <requirement type="package" version="10.0.1">pillow</requirement> |
| 6 <requirement type="package" version="1.15.4">numpy</requirement> | 22 <requirement type="package" version="1.24.4">numpy</requirement> |
| 7 <requirement type="package" version="1.1.0">scipy</requirement> | 23 <requirement type="package" version="2021.7.2">tifffile</requirement> |
| 8 <requirement type="package" version="0.15.1">tifffile</requirement> | 24 <requirement type="package" version="0.1">giatools</requirement> |
| 9 </requirements> | 25 </requirements> |
| 10 <command detect_errors="aggressive"> | 26 <command detect_errors="aggressive"><![CDATA[ |
| 11 <![CDATA[ | |
| 12 python '$__tool_directory__/scale_image.py' '$input' ./out.png | |
| 13 #if $use_scale_option.use_scale == 'true' | |
| 14 $use_scale_option.scale | |
| 15 #else if $use_scale_option.use_scale == 'false' | |
| 16 '[$use_scale_option.scale_x, $use_scale_option.scale_y]' | |
| 17 #end if | |
| 18 $order | |
| 19 | 27 |
| 20 ]]> | 28 python '$__tool_directory__/scale_image.py' '$input' |
| 21 </command> | 29 |
| 30 ./output.${input.ext} | |
| 31 | |
| 32 --scale '$scale' | |
| 33 --order $order | |
| 34 $antialias | |
| 35 | |
| 36 && mv ./output.${input.ext} ./output | |
| 37 | |
| 38 ]]></command> | |
| 22 <inputs> | 39 <inputs> |
| 23 <param name="input" type="data" format="png" label="Image file"/> | 40 <param name="input" type="data" format="png,tiff" label="Image file"/> |
| 24 <conditional name="use_scale_option"><!--a third option (using one integer as percentage scaling) could still be implemented--> | 41 <param argument="--scale" type="text" value="1" label="Scaling factor" help="Use either a single scaling factor (uniform scaling), or a comma-separated list of scaling factors (anistropic scaling). For a 2-D single-channel or RGB image, the first scaling factor corresponds to the image width and the second corresponds to the image height. For images with 3 or more axes, the last axis is assumed to correspond to the image channels if uniform scaling is used (a single value)."/> |
| 25 <param label="Lock scaling between image dimensions" name="use_scale" type="select"> | 42 <param argument="--order" type="select" label="Interpolation method"> |
| 26 <option selected="true" value="true">Lock</option> | |
| 27 <option value="false">Individual scales</option> | |
| 28 </param> | |
| 29 <when value="true"> | |
| 30 <param name="scale" type="float" value="1.0" label="Scaling factor" /> | |
| 31 </when> | |
| 32 <when value="false"> | |
| 33 <param name="scale_x" type="integer" value="100" label="New height of the image in pixels" /> | |
| 34 <param name="scale_y" type="integer" value="100" label="New width of the image in pixels" /> | |
| 35 </when> | |
| 36 </conditional> | |
| 37 <param name="order" type="select" label="Interpolation method"> | |
| 38 <option value="0">Nearest-neighbor</option> | 43 <option value="0">Nearest-neighbor</option> |
| 39 <option value="1" selected="true">Bi-linear</option> | 44 <option value="1" selected="true">Bi-linear</option> |
| 40 <option value="2">Bi-cubic</option> | 45 <option value="2">Bi-cubic</option> |
| 41 </param> | 46 </param> |
| 47 <param name="antialias" type="boolean" truevalue="--antialias" falsevalue="" checked="true" label="Enable anti-aliasing" help="This should only be used for down-scaling."/> | |
| 42 </inputs> | 48 </inputs> |
| 43 <outputs> | 49 <outputs> |
| 44 <data format="png" name="output" from_work_dir="out.png"/> | 50 <data name="output" from_work_dir="output" format_source="input" metadata_source="input"/> |
| 45 </outputs> | 51 </outputs> |
| 46 <tests> | 52 <tests> |
| 53 <!-- Test PNG, without antialias --> | |
| 47 <test> | 54 <test> |
| 48 <param name="input" value="sample1.png"/> <!--continue here--> | 55 <param name="input" value="input1_binary_rgb.png"/> |
| 49 <param name="use_scale_option.use_scale" value="false"/> | 56 <param name="scale" value="0.5"/> |
| 50 <param name="use_scale_option.scale_x" value="200"/> | 57 <param name="antialias" value="false"/> |
| 51 <param name="use_scale_option.scale_y" value="150"/> | |
| 52 <param name="order" value="0"/> | 58 <param name="order" value="0"/> |
| 53 <output name="output" value="out2.png" ftype="png" compare="sim_size"/> | 59 <expand macro="tests/binary_image_diff" name="output" value="uniform_binary.png" ftype="png"/> |
| 60 </test> | |
| 61 <!-- Test PNG, uniform scaling --> | |
| 62 <test> | |
| 63 <param name="input" value="input1_binary_rgb.png"/> | |
| 64 <param name="scale" value="0.5"/> | |
| 65 <expand macro="tests/intensity_image_diff" name="output" value="uniform.png" ftype="png"/> | |
| 66 </test> | |
| 67 <!-- Test PNG, anistropic scaling --> | |
| 68 <test> | |
| 69 <param name="input" value="input1_binary_rgb.png"/> | |
| 70 <param name="scale" value="0.5, 0.8"/> | |
| 71 <expand macro="tests/intensity_image_diff" name="output" value="anisotropic.png" ftype="png"/> | |
| 72 </test> | |
| 73 <test> | |
| 74 <param name="input" value="input1_binary_rgb.png"/> | |
| 75 <param name="scale" value="0.5, 0.8, 1"/> | |
| 76 <expand macro="tests/intensity_image_diff" name="output" value="anisotropic.png" ftype="png"/> | |
| 77 </test> | |
| 78 <!-- Test TIFF, normalized --> | |
| 79 <test> | |
| 80 <param name="input" value="input2_normalized.tiff"/> | |
| 81 <param name="scale" value="0.5"/> | |
| 82 <expand macro="tests/intensity_image_diff" name="output" value="normalized.tiff" ftype="tiff"/> | |
| 83 </test> | |
| 84 <!-- Test TIFF, not normalized --> | |
| 85 <test> | |
| 86 <param name="input" value="input3_not_normalized.tiff"/> | |
| 87 <param name="scale" value="0.5"/> | |
| 88 <expand macro="tests/intensity_image_diff" name="output" value="not_normalized.tiff" ftype="tiff"/> | |
| 54 </test> | 89 </test> |
| 55 </tests> | 90 </tests> |
| 56 <help> | 91 <help> |
| 57 **What it does** | |
| 58 | 92 |
| 59 This tool scales an image using the scaling factor. | 93 **Scales an image using one or more scaling factors.** |
| 94 | |
| 95 The image is rescaled uniformly along all axes, or anistropically if multiple scale factors are given. | |
| 96 | |
| 97 This operation preserves both the brightness of the image, and the range of values. | |
| 98 | |
| 60 </help> | 99 </help> |
| 61 <citations> | 100 <citations> |
| 62 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> | 101 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> |
| 63 </citations> | 102 </citations> |
| 64 </tool> | 103 </tool> |
