view colorize_labels.xml @ 4:5907be5a8d7c draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
author imgteam
date Tue, 24 Sep 2024 17:30:20 +0000
parents 2d1de6e7b113
children
line wrap: on
line source

<tool id="colorize_labels" name="Colorize label map" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05">
    <description>with NetworkX</description>
    <macros>
        <import>creators.xml</import>
        <import>tests.xml</import>
        <token name="@TOOL_VERSION@">3.2.1</token>
        <token name="@VERSION_SUFFIX@">3</token>
    </macros>
    <creator>
        <expand macro="creators/bmcv" />
    </creator>
    <edam_operations>
        <edam_operation>operation_3443</edam_operation>
    </edam_operations>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">networkx</requirement>
        <requirement type="package" version="1.22">numpy</requirement>
        <requirement type="package" version="0.18.1">scikit-image</requirement>
        <requirement type="package" version="0.1">giatools</requirement>
    </requirements>
    <command><![CDATA[
    
    ## Inputs
    
    python '$__tool_directory__/colorize_labels.py' '$input'
    --radius $radius
    --bg_label $bg_label
    --bg_color '$bg_color'
    
    ## Outputs
    
    --output output.png
    
    ]]>
    </command>
    <inputs>
        <param name="input" type="data" format="tiff,png" label="Input image (label map)" />
        <param argument="--radius" type="integer" min="1" value="10" label="Radius of the neighborhood" help="Defines the neighborhood (in pixels) where labels are considered to be adjacent." />
        <param argument="--bg_label" type="integer" value="0" label="Background label" />
        <param argument="--bg_color" type="color" value="#000000" label="Background color"/>
    </inputs>
    <outputs>
       <data format="png" name="output" from_work_dir="output.png" />
    </outputs>
    <tests>
        <!-- int64 -->
        <test>
            <param name="input" value="input1.tif" />
            <param name="radius" value="1" />
            <param name="bg_label" value="0" />
            <param name="bg_color" value="#5a5a5a" />
            <expand macro="tests/intensity_image_diff" name="output" value="output1.png" ftype="png">
                <has_image_channels channels="3"/>
            </expand>
        </test>
        <!-- uint8 -->
        <test>
            <param name="input" value="input2.tif" />
            <param name="radius" value="10" />
            <param name="bg_label" value="0" />
            <param name="bg_color" value="#ffffff" />
            <expand macro="tests/intensity_image_diff" name="output" value="output2.png" ftype="png">
                <has_image_channels channels="3"/>
            </expand>
        </test>
        <!-- uint16 -->
        <test>
            <param name="input" value="input3.tif" />
            <param name="radius" value="100" />
            <param name="bg_label" value="0" />
            <param name="bg_color" value="#ffffff" />
            <expand macro="tests/intensity_image_diff" name="output" value="output3.png" ftype="png">
                <has_image_channels channels="3"/>
            </expand>
        </test>
    </tests>
    <help>

        **Colorizes a 2-D label map for visualization using greedy coloring.**

        Label maps are produced by segmentation and other image analysis steps.
        Direct inspection of label maps can be difficult,
        because labels usually correspond to gray values which are difficult to
        distinguish visually from each other and from the image background.
        To facilitate the visual inspection of label maps, this tools converts
        label maps to color images, by assigning each label a unique color.

    </help>
    <citations>
        <citation type="bibtex">
        @inproceedings{networkx,
          author = {Hagberg, Aric A. and Schult, Daniel A. and Swart, Pieter J.},
          title = {Exploring network structure, dynamics, and function using {NetworkX}},
          booktitle = {Proc. of the 7th Python in Science Conference (SciPy 2008)},
          pages = {11--15},
          year = {2008},
        }
        </citation>
    </citations>
</tool>