view imagej2_watershed_binary.xml @ 1:5b154339fd90 draft default tip

"planemo upload for repository commit 2afb24f3c81d625312186750a714d702363012b5"
author imgteam
date Mon, 28 Sep 2020 16:36:30 +0000
parents b143159845b4
line wrap: on
line source

<tool id="imagej2_watershed_binary" name="Watershed segmentation" version="@WRAPPER_VERSION@.1">
    <description>of binary image</description>
    <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="blobs_watershed_binary.gif" compare="sim_size"/>
.. class:: warningmark


**What it does**

Watershed segmentation is a way of automatically separating or cutting apart particles that touch.
It first calculates the Euclidian distance map (EDM) and finds the ultimate eroded points (UEPs).
It then dilates each of the UEPs (the peaks or local maxima of the EDM) as far as possible — either
until the edge of the particle is reached, or the edge touches a region of another (growing) UEP.
Watershed segmentation works best for smooth convex objects that don’t overlap too much.

    <expand macro="fiji_headless_citations"/>