view imagej2_binary_to_edm.xml @ 1:33f6b1f921e7 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
author imgteam
date Mon, 28 Sep 2020 16:55:57 +0000
parents f62303e87275
children 182994b12622
line wrap: on
line source

<tool id="imagej2_binary_to_edm" name="Convert binary image to EDM" version="@WRAPPER_VERSION@.1">
    <description>(Euclidean Distance Map)</description>
    <macros>
        <import>imagej2_macros.xml</import>
    </macros>
    <expand macro="fiji_requirements"/>
    <command detect_errors="exit_code"><![CDATA[
#import os
#set error_log = 'output_log.txt'
#set input_sans_ext = $os.path.splitext($os.path.basename($input.file_name))[0]
#set input_with_ext = '.'.join([input_sans_ext, $input.ext])
ln -s '$input.file_name' '$input_with_ext' &&
#set output_filename = '.'.join(['output', $input.ext])
touch '$output_filename' &&
touch '$error_log' &&
ImageJ --ij2 --headless --debug
--jython '$__tool_directory__/imagej2_binary_to_edm_jython_script.py'
'$error_log'
'$input_with_ext'
$iterations
$count
'$black_background'
'$pad_edges_when_eroding'
'$output_filename'
'$input.ext'
&>'$error_log';
if [[ $? -ne 0 ]]; then
    cat '$error_log' >&2;
else
    mv '$output_filename' '$output';
fi
]]></command>
    <inputs>
        <expand macro="param_input"/>
        <expand macro="make_binary_params"/>
    </inputs>
    <outputs>
        <data name="output" format_source="input"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="blobs.gif"/>
            <param name="iterations" value="1"/>
            <param name="count" value="1"/>
            <output name="output" file="blobs_edm.gif" compare="sim_size"/>
        </test>
        <test>
            <param name="input" value="blobs.gif"/>
            <param name="iterations" value="10"/>
            <param name="count" value="3"/>
            <param name="black_background" value="yes"/>
            <param name="pad_edges_when_eroding" value="yes"/>
            <output name="output" file="blobs_black_edm.gif" compare="sim_size"/>
        </test>
    </tests>
    <help>

.. class:: warningmark

@requires_binary_input@

**What it does**

<![CDATA[
Converts a binary image into an 8-bit grayscale Euclidean Distance Map (EDM). Each foreground
(nonzero) pixel in the binary image is assigned a value equal to its distance from the nearest
background (zero) pixel.

- **Iterations** - Specifies the number of times erosion, dilation, opening, and closing are performed.
- **Count** - Specifies the number of adjacent background pixels necessary before a pixel is removed from the edge of an object during erosion and the number of adjacent foreground pixels necessary before a pixel is added to the edge of an object during dilation.
- **Black background** - If **Yes**, binary images will be created without using an inverted LUT and an assumption that the input image contains white objects on a black background will be made.
- **Pad edges when eroding** - If **Yes**, eroding does not erode from the edges of the image.

]]>

    </help>
    <expand macro="fiji_headless_citations"/>
</tool>