view scale_image.xml @ 3:d09507d3fb0e draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/scale_image/ commit 6b687746bdb3d5d1fb11ecffd6dd1bf42dc2c38d
author imgteam
date Fri, 10 Nov 2023 14:23:33 +0000
parents f3c05a734dd1
children 3179853faae9
line wrap: on
line source

<tool id="ip_scale_image" name="Scale image" version="0.4-2"> 
    <description>with scikit-image</description>
    <edam_operations>
        <edam_operation>operation_3443</edam_operation>
    </edam_operations>
    <xrefs>
        <xref type="bio.tools">scikit-image</xref>
        <xref type="biii">scikit-image</xref>
    </xrefs>
    <requirements>
        <requirement type="package" version="6.1.0">pillow</requirement>
        <requirement type="package" version="0.14.2">scikit-image</requirement>
        <requirement type="package" version="1.15.4">numpy</requirement>
        <requirement type="package" version="1.1.0">scipy</requirement>
        <requirement type="package" version="0.15.1">tifffile</requirement>
    </requirements> 
    <command detect_errors="aggressive">
        <![CDATA[
        python '$__tool_directory__/scale_image.py' '$input' ./out.png
        #if $use_scale_option.use_scale == 'true'
          $use_scale_option.scale
        #else if $use_scale_option.use_scale == 'false'
          '[$use_scale_option.scale_x, $use_scale_option.scale_y]'
        #end if
        $order

        ]]>
    </command>
    <inputs>
        <param name="input" type="data" format="png" label="Image file"/>
        <conditional name="use_scale_option"><!--a third option (using one integer as percentage scaling) could still be implemented-->
            <param label="Lock scaling between image dimensions" name="use_scale" type="select">
                <option selected="true" value="true">Lock</option>
                <option value="false">Individual scales</option>
            </param>
            <when value="true">
                <param name="scale" type="float" value="1.0" label="Scaling factor" />
            </when>
            <when value="false">
                <param name="scale_x" type="integer" value="100" label="New height of the image in pixels" />
                <param name="scale_y" type="integer" value="100" label="New width of the image in pixels" />
            </when>
        </conditional>
        <param name="order" type="select" label="Interpolation method">
            <option value="0">Nearest-neighbor</option>
            <option value="1" selected="true">Bi-linear</option>
            <option value="2">Bi-cubic</option>
        </param>
    </inputs>
    <outputs>
        <data format="png" name="output" from_work_dir="out.png"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="sample1.png"/> <!--continue here-->
            <conditional name="use_scale_option">
                <param name="use_scale" value="false"/>
                <param name="scale_x" value="200"/>
                <param name="scale_y" value="150"/>
            </conditional>
            <param name="order" value="0"/>
            <output name="output" value="out2.png" ftype="png" compare="sim_size"/>
        </test>
    </tests>
    <help>
    **What it does**

    This tool scales an image using the scaling factor.
    </help>
    <citations>
        <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation>
    </citations>
</tool>