view imagej2_skeletonize3d.xml @ 2:49b5288dcd8c draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author imgteam
date Sun, 05 Nov 2023 14:26:52 +0000
parents 768825d9034a
children 5f5b7185bc16
line wrap: on
line source

<tool id="imagej2_skeletonize3d" name="Skeletonize" version="@WRAPPER_VERSION@.2">
    <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 error_log = 'output_log.txt'
touch '$error_log' &&
#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_skeletonize3d_jython_script.py'
'$error_log'
'$input_with_ext'
'$black_background'
'$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="black_background_param"/>
    </inputs>
    <outputs>
        <data name="output" format_source="input" label="${tool.name} on ${on_string}"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="blobs.gif"/>
            <output name="output" file="skeletonized_blobs.gif" compare="sim_size"/>
        </test>
        <test>
            <param name="input" value="clown.jpg"/>
            <output name="output" file="skeletonized_clown.jpg" compare="sim_size"/>
        </test>
    </tests>
    <help>

.. class:: warningmark

@requires_binary_input@

**What it does**

<![CDATA[
Skeletonizes a 2D or 3D binary (8-bit) image.  As Hanno Homman explains in his paper, binary thinning is
used for finding the centerlines (”skeleton”) of objects in the input image. The general idea is to erode
the object’s surface iteratively until only the skeleton remains. Erosion has to be performed symmetrically
in order to the guarantee medial position of the skeleton lines and such that the connectedness of the
object is preserved. Care has to be taken in order not to create holes or cavities in the object.

There are two major approaches to image thinning: a) kernel-based filters and b) decision trees. Kernel-based
filters apply a structuring element to the image and can generally be extended to dimensions higher than 3D,
to find computationally efficient solutions for 4D and higher dimensions is subject of ongoing research.
Methods based on decision trees are thus far limited to 2D and 3D, but are potentially faster than morphological
filters, if they are well designed and can find more deletable points at each iteration.

In 3D there are 67,108,864 possible binary combinations of object and background voxels in a 26-neighborhood,
which cannot be completely captured by kernel-based filters. Lee et al. have demonstrated in their work that
their solution, based on a decision tree, can handle all these cases correctly and find all deletable surface
points at each iteration. Thus their algorithm allows for a very fast iterative erosion process.
]]>
    </help>
    <citations>
        <citation type="doi">10.1006/cgip.1994.1042</citation>
        <citation type="doi">10.1038/nmeth.2102</citation>
    </citations>
</tool>