view imagej2_skeletonize3d.xml @ 3:5f5b7185bc16 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:14:34 +0000
parents 49b5288dcd8c
children
line wrap: on
line source

<tool id="imagej2_skeletonize3d" name="Skeletonize" 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_skeletonize3d_jython_script.py'
'$input_with_ext'
'$black_background'
'$output_filename'
'$input.ext'
&& mv '$output_filename' '$output';
]]></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="image_diff"/>
        </test>
        <test>
            <param name="input" value="clown.jpg"/>
            <output name="output" file="skeletonized_clown.jpg" compare="image_diff"/>
        </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>