view binary2label.xml @ 3:a041e4e9d449 draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/binary2labelimage/ commit 48df7d9c58fb88e472caeb4d4a1e14170d79b643
author imgteam
date Mon, 12 May 2025 08:15:32 +0000
parents 37b99b904027
children
line wrap: on
line source

<tool id="ip_binary_to_labelimage" name="Convert binary image to label map" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description></description>
    <macros>
        <import>creators.xml</import>
        <token name="@TOOL_VERSION@">0.6</token>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <creator>
        <expand macro="creators/bmcv"/>
    </creator>
    <edam_operations>
        <edam_operation>operation_3443</edam_operation>
    </edam_operations>
    <xrefs>
        <xref type="bio.tools">galaxy_image_analysis</xref>
    </xrefs>
    <requirements>
        <requirement type="package" version="0.4.0">giatools</requirement>
        <requirement type="package" version="1.12.0">scipy</requirement>
    </requirements>
    <command detect_errors="aggressive">
        <![CDATA[
        #if str($mode.mode_selector) == 'cca':
            python '$__tool_directory__/binary2label.py' '$input' '$output'
        #elif str($mode.mode_selector) == 'watershed':
            python '$__tool_directory__/2d_split_binaryimage_by_watershed.py' '$input' '$output' $min_distance
        #end if
        ]]>
    </command>
    <inputs>
        <param name="input" type="data" format="tiff,png,jpg,bmp" label="Binary image"/>
        <conditional name="mode">
            <param name="mode_selector" type="select" label="Mode">
                <option value="cca" selected="true">Connected component analysis</option>
                <option value="watershed">Watershed transform</option>
            </param>
            <when value="cca">
            </when>
            <when value="watershed">
                <param name="min_distance" type="integer" min="0" value="5" label="Minimum distance between two objects" />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data format="tiff" name="output"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="galaxyIcon_noText.tiff" />
            <conditional name="mode">
                <param name="mode_selector" value="cca" />
            </conditional>
            <output name="output" value="label.tiff" ftype="tiff" compare="image_diff"/>
        </test>
        <test>
            <param name="input" value="in.tiff"/>
            <conditional name="mode">
                <param name="mode_selector" value="watershed" />
                <param name="min_distance" value="10" />
            </conditional>
            <output name="output" value="out.tiff" ftype="tiff" compare="image_diff"/>
        </test>
        <test>
            <param name="input" value="uint8_z12_x11_y10.tiff"/>
            <conditional name="mode">
                <param name="mode_selector" value="cca" />
            </conditional>
            <output name="output" value="uint8_z12_x11_y10-output.tiff" ftype="tiff" compare="image_diff">
                <assert_contents>
                    <has_image_width width="11"/>
                    <has_image_height height="10"/>
                    <has_image_depth depth="12"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help>
    This tool assigns each object a unique label.

    Individual objects are determined using connected component analysis, or distance transform and watershed.
    </help>
    <citations>
        <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation>
    </citations>
</tool>