view imagej2_skeletonize3d.xml @ 1:768825d9034a draft default tip

"planemo upload for repository commit 2afb24f3c81d625312186750a714d702363012b5"
author imgteam
date Mon, 28 Sep 2020 17:01:19 +0000
parents f6df6830d5ec
line wrap: on
line source

<tool id="imagej2_skeletonize3d" name="Skeletonize" version="@WRAPPER_VERSION@.1">
    <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__/'
if [[ $? -ne 0 ]]; then
    cat '$error_log' >&2;
    mv '$output_filename' '$output';
        <expand macro="param_input"/>
        <expand macro="black_background_param"/>
        <data name="output" format_source="input" label="${} on ${on_string}"/>
            <param name="input" value="blobs.gif"/>
            <output name="output" file="skeletonized_blobs.gif" compare="sim_size"/>
            <param name="input" value="clown.jpg"/>
            <output name="output" file="skeletonized_clown.jpg" compare="sim_size"/>

.. class:: warningmark


**What it does**

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.
        <citation type="doi">10.1006/cgip.1994.1042</citation>
        <citation type="doi">10.1038/nmeth.2102</citation>