view imagej2_make_binary.xml @ 3:1cf9771e0e53 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
author imgteam
date Wed, 25 Sep 2024 16:12:59 +0000
parents d3e8ef83f3bf
children
line wrap: on
line source

<tool id="imagej2_make_binary" name="Convert to binary" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
    <description>with ImageJ2</description>
    <macros>
        <import>imagej2_macros.xml</import>
    </macros>
    <edam_operations>
        <edam_operation>operation_3443</edam_operation>
    </edam_operations>
    <xrefs>
        <xref type="bio.tools">imagej</xref>
        <xref type="biii">imagej2</xref>
    </xrefs>
    <expand macro="fiji_requirements"/>
    <command detect_errors="exit_code"><![CDATA[
#import os
#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' &&
ImageJ --ij2 --headless --debug
--jython '$__tool_directory__/imagej2_make_binary_jython_script.py'
'$input_with_ext'
$iterations
$count
'$black_background'
'$pad_edges_when_eroding'
'$output_filename'
'$input.ext'
&& mv '$output_filename' '$output'
]]></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="clown.jpg"/>
            <!-- It seems that metric iou does not work for this test -->
            <output name="output" file="clown_binary.jpg" compare="image_diff" />
        </test>
    </tests>
    <help>
**What it does**

<![CDATA[
Converts an image into a binary (black and white) image by analyzing the histogram of
the  entire image and setting an automatic threshold level to create the binary image.

- **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>