diff imagej2_analyze_particles_binary.xml @ 1:1dd5396c734a draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
author imgteam
date Mon, 28 Sep 2020 16:59:30 +0000
parents aeb9bb864b8c
children ae4ae9c5c56c
line wrap: on
line diff
--- a/imagej2_analyze_particles_binary.xml	Tue Sep 17 16:56:37 2019 -0400
+++ b/imagej2_analyze_particles_binary.xml	Mon Sep 28 16:59:30 2020 +0000
@@ -1,38 +1,66 @@
-<?xml version='1.0' encoding='UTF-8'?>
 <tool id="imagej2_analyze_particles_binary" name="Analyze particles" version="@WRAPPER_VERSION@.0">
     <description>of binary image</description>
     <macros>
         <import>imagej2_macros.xml</import>
     </macros>
-    <expand macro="fiji_requirements" />
-    <command>
-<![CDATA[
-    python $__tool_directory__/imagej2_analyze_particles_binary.py
-    --input "$input"
-    --input_datatype $input.ext
-    --black_background $black_background
-    --size "$size"
-    --circularity_min $circularity_min
-    --circularity_max $circularity_max
-    --show $show
-    --exclude_edges $exclude_edges
-    --include_holes $include_holes
-    --jython_script $__tool_directory__/imagej2_analyze_particles_binary_jython_script.py
-    #if str($show) == 'Nothing':
-        --display_results "yes"
-        --all_results "yes"
+    <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_log = 'output_log.txt'
+touch '$output_log' &&
+#if str($show) == 'Nothing':
+    #set display_results = 'yes'
+    #set all_results = 'yes'
+    #set output_filename = ''
+    #set output_datatype = ''
+    #set results_filename = $results
+#else:
+    #set display_results = $display_results_cond.display_results
+    #set all_results = $display_results_cond.all_results
+    #set output_filename = '.'.join(['output', $input.ext])
+    #set output_datatype = $input.ext
+    touch '$output_filename' &&
+    #if str($display_results_cond.display_results) == 'yes':
+        #set results_filename = $results
     #else:
-        --display_results $display_results_cond.display_results
-        --all_results $display_results_cond.all_results
-        --output_datatype $output.ext
-        --output "$output"
+        #set results_filename = ''
     #end if
-    --results "$results"
-]]>
-    </command>
+#end if
+ImageJ --ij2 --headless --debug
+--jython '$__tool_directory__/imagej2_analyze_particles_binary_jython_script.py'
+'$output_log'
+'$input'
+'$black_background'
+'$size'
+$circularity_min
+$circularity_max
+'$show'
+'$display_results'
+'$all_results'
+'$exclude_edges'
+'$include_holes'
+'$output_filename'
+'$output_datatype'
+'$results_filename'
+&>'$output_log';
+#if str($output_filename) != '':
+    if [[ $? -ne 0 ]]; then
+        cat '$output_log' >&2;
+    else
+        mv '$output_filename' '$output';
+    fi
+#else:
+    if [[ $? -ne 0 ]]; then
+        cat '$output_log' >&2;
+    fi
+#end if
+]]></command>
     <inputs>
-        <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="input" type="data" label="Select image"/>
-        <expand macro="black_background_param" />
+        <expand macro="param_input"/>
+        <expand macro="black_background_param"/>
         <param name="size" type="text" value="0-Infinity" label="Size (pixel^2)" help="Enter a single value and particles smaller than that value will be ignored."/>
         <param name="circularity_min" type="float" value="0.0" label="Circularity minimum" help="Values from 0.0 to 1.0, but less than maximum">
             <validator type="in_range" min="0" max="1"/>
@@ -73,30 +101,30 @@
         </param>
     </inputs>
     <outputs>
-        <data name="output" format_source="input" label="${tool.name} on ${on_string}">
+        <data name="output" format_source="input">
             <filter>show != "Nothing"</filter>
        </data>
-        <data format="tabular" name="results" label="${tool.name} on ${on_string}: Results">
+        <data format="tabular" name="results" label="${tool.name} (results) on ${on_string}">
             <filter>show == "Nothing" or display_results_cond['display_results'] == "yes"</filter>
         </data>
     </outputs>
     <tests>
         <test>
-            <param name="input" value="blobs_watershed_binary.gif" />
-            <param name="show" value="Nothing" />
-            <output name="output" file="analyze_particles_nothing.tabular" />
+            <param name="input" value="blobs.gif"/>
+            <param name="show" value="Nothing"/>
+            <output name="output" file="analyze_particles_nothing.tabular"/>
         </test>
         <test>
-            <param name="input" value="blobs_watershed_binary.gif" />
-            <param name="show" value="Outlines" />
-            <output name="output" file="analyze_particles_outlines.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="show" value="Outlines"/>
+            <output name="output" file="analyze_particles_outlines.gif" compare="sim_size"/>
         </test>
         <test>
-            <param name="input" value="blobs_watershed_binary.gif" />
-            <param name="show" value="Masks" />
-            <param name="exclude_edges" value="yes" />
-            <param name="include_holes" value="yes" />
-            <output name="output" file="analyze_particles_masks.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="show" value="Masks"/>
+            <param name="exclude_edges" value="yes"/>
+            <param name="include_holes" value="yes"/>
+            <output name="output" file="analyze_particles_masks.gif" compare="sim_size"/>
         </test>
     </tests>
     <help>
@@ -128,5 +156,5 @@
 ]]>
 
     </help>
-    <expand macro="fiji_headless_citations" />
+    <expand macro="fiji_headless_citations"/>
 </tool>