view imagej2_analyze_skeleton.xml @ 3:50f2b961b192 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:09:42 +0000
parents bdee06a1bcfa
children
line wrap: on
line source

<tool id="imagej2_analyze_skeleton" name="Analyze skeleton" 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' &&
ImageJ --ij2 --headless --debug
--jython '$__tool_directory__/imagej2_analyze_skeleton_jython_script.py'
'$input_with_ext'
'$black_background'
'$prune_cycle_method'
'$prune_ends'
'$calculate_largest_shortest_path'
'no'
'$output'
]]></command>
    <inputs>
        <expand macro="param_input"/>
        <expand macro="black_background_param"/>
        <param name="prune_cycle_method" type="select" label="Prune cycle method">
            <option value="none" selected="True">None</option>
            <option value="shortest_branch">Shortest branch</option>
            <option value="lowest_intensity_voxel">Lowest intensity voxel</option>
            <option value="lowest_intensity_branch">Lowest intensity branch</option>
        </param>
        <param name="prune_ends" type="select" label="Prune ends">
            <option value="no" selected="True">No</option>
            <option value="yes">Yes</option>
        </param>
        <param name="calculate_largest_shortest_path" type="select" label="Calculate largest shortest path">
            <option value="no" selected="True">No</option>
            <option value="yes">Yes</option>
        </param>
        <!-- TODO: Uncomment this option when the tool has been enhanced to use the
        future "Display labeled skeletons" option.  See http://fiji.sc/AnalyzeSkeleton.
        <param name="show_detailed_info" type="select" label="Show detailed info">
            <option value="no" selected="True">No</option>
            <option value="yes">Yes</option>
        </param>
        -->
    </inputs>
    <outputs>
        <data name="output" format="tabular"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="skeletonized_blobs.gif"/>
            <output name="output" file="basic.tabular" ftype="tabular"/>
        </test>
        <test>
            <param name="input" value="skeletonized_clown.jpg"/>
            <param name="prune_cycle_method" value="shortest_branch"/>
            <output name="output" file="shortest_branch_basic.tabular" ftype="tabular"/>
        </test>
        <test>
            <param name="input" value="skeletonized_blobs.gif"/>
            <param name="calculate_largest_shortest_path" value="yes"/>
            <output name="output" file="largest_shortest_path_basic.tabular" ftype="tabular"/>
        </test>
        <test>
            <param name="input" value="skeletonized_clown.jpg"/>
            <param name="prune_cycle_method" value="shortest_branch"/>
            <param name="calculate_largest_shortest_path" value="yes"/>
            <output name="output" file="shortest_branch_all_yes.tabular" ftype="tabular"/>
        </test>
    </tests>
    <help>

.. class:: warningmark

The underlying AnalyzeSkeleton Fiji plugin works on binary images, so other image types will
automatically be converted to binary before they are analyzed.  This step is performed using the
ImageJ2 **Make Binary** command with the following settings: **Iterations:** 1, **Count:** 1,
**Black background:** No, **Pad edges when eroding:** No.  If these settings are not appropriate,
first manually convert the image to binary using the **Convert to binary (black and white) with
ImageJ2** tool, which allows you to change them.

.. class:: warningmark

The **Skeletonize images** tool produces skeleton images that can be used as input to this tool.
Images that have not been skeletonized will not result in errors, but the results may or may not
be useful.

**What it does**

<![CDATA[
Tags all pixel/voxels in a skeleton image and then counts all its junctions, triple and quadruple
points and branches, and measures their average and maximum length.  The voxels are classified into
three different categories depending on their 26 neighbors:

- **End-point** voxels: if they have less than 2 neighbors.
- **Junction** voxels: if they have more than 2 neighbors.
- **Slab** voxels: if they have exactly 2 neighbors.

-----

**Options**

- **Prune cycle method**: prune the possible loops in the skeleton.
- **Prune ends**: prunes any branch that ends in an end-point.
- **Calculate largest shortest path**: calculate the largest shortest path of each skeleton using the APSP (all pairs shortest path).
]]>
    </help>
    <citations>
        <citation type="doi">10.1002/jemt.20829</citation>
        <citation type="doi">10.1038/nmeth.2102</citation>
    </citations>
</tool>