Source code

Download source archive ↓

upstream/tools/image_processing/imagej2/imagej2_binary_to_edm.xml

1<tool id="imagej2_binary_to_edm" name="Convert binary image to EDM" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
2    <description>with ImageJ2</description>
3    <macros>
4        <import>imagej2_macros.xml</import>
5    </macros>
6    <edam_operations>
7        <edam_operation>operation_3443</edam_operation>
8    </edam_operations>
9    <xrefs>
10        <xref type="bio.tools">imagej</xref>
11        <xref type="biii">imagej2</xref>
12    </xrefs>
13    <expand macro="fiji_requirements"/>
14    <command detect_errors="exit_code"><![CDATA[
15#import os
16#set input_sans_ext = $os.path.splitext($os.path.basename($input.file_name))[0]
17#set input_with_ext = './' + '.'.join([input_sans_ext, $input.ext])
18ln -s '$input.file_name' '$input_with_ext' &&
19#set output_filename = '.'.join(['output', $input.ext])
20touch '$output_filename' &&
21ImageJ --ij2 --headless --debug
22--jython '$__tool_directory__/imagej2_binary_to_edm_jython_script.py'
23'$input_with_ext'
24$iterations
25$count
26'$black_background'
27'$pad_edges_when_eroding'
28'$output_filename'
29'$input.ext'
30&& mv '$output_filename' '$output';
31]]></command>
32    <inputs>
33        <expand macro="param_input"/>
34        <expand macro="make_binary_params"/>
35    </inputs>
36    <outputs>
37        <data name="output" format_source="input"/>
38    </outputs>
39    <tests>
40        <test>
41            <param name="input" value="blobs.gif"/>
42            <param name="iterations" value="1"/>
43            <param name="count" value="1"/>
44            <output name="output" file="blobs_edm.gif" compare="image_diff" metric="iou" />
45        </test>
46        <test>
47            <param name="input" value="blobs.gif"/>
48            <param name="iterations" value="10"/>
49            <param name="count" value="3"/>
50            <param name="black_background" value="yes"/>
51            <param name="pad_edges_when_eroding" value="yes"/>
52            <output name="output" file="blobs_black_edm.gif" compare="image_diff" metric="iou" />
53        </test>
54    </tests>
55    <help>
56
57.. class:: warningmark
58
59@requires_binary_input@
60
61**What it does**
62
63<![CDATA[
64Converts a binary image into an 8-bit grayscale Euclidean Distance Map (EDM). Each foreground
65(nonzero) pixel in the binary image is assigned a value equal to its distance from the nearest
66background (zero) pixel.
67
68- **Iterations** - Specifies the number of times erosion, dilation, opening, and closing are performed.
69- **Count** - Specifies the number of adjacent background pixels necessary before a pixel is removed from the edge of an object during erosion and the number of adjacent foreground pixels necessary before a pixel is added to the edge of an object during dilation.
70- **Black background** - If **Yes**, binary images will be created without using an inverted LUT and an assumption that the input image contains white objects on a black background will be made.
71- **Pad edges when eroding** - If **Yes**, eroding does not erode from the edges of the image.
72
73]]>
74
75    </help>
76    <expand macro="fiji_headless_citations"/>
77</tool>