diff imagej2_find_maxima.xml @ 1:e2622ebb5ce4 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:49:43 +0000
parents 29b39f5b0e69
children 6a07f71806bb
line wrap: on
line diff
--- a/imagej2_find_maxima.xml	Tue Sep 17 17:01:44 2019 -0400
+++ b/imagej2_find_maxima.xml	Mon Sep 28 16:49:43 2020 +0000
@@ -1,33 +1,53 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<tool id="imagej2_find_maxima" name="Find maxima" version="@WRAPPER_VERSION@.0">
+<tool id="imagej2_find_maxima" name="Find maxima" version="@WRAPPER_VERSION@.1">
     <description></description>
     <macros>
         <import>imagej2_macros.xml</import>
     </macros>
-    <expand macro="fiji_requirements" />
-    <command>
-<![CDATA[
-    python $__tool_directory__/imagej2_find_maxima.py
-    --input "$input"
-    --input_datatype $input.ext
-    --scale_when_converting $scale_when_converting
-    --weighted_rgb_conversions $weighted_rgb_conversions
-    --noise_tolerance $noise_tolerance
-    --output_type $output_type
-    --exclude_edge_maxima $exclude_edge_maxima
-    --light_background $light_background
-    --jython_script $__tool_directory__/imagej2_find_maxima_jython_script.py
-    #if str( $output_type ) == "List" or str( $output_type ) == "Count":
-        --output "$results"
-        --output_datatype "tabular"
+    <expand macro="fiji_requirements"/>
+    <command detect_errors="exit_code"><![CDATA[
+#import os
+#set error_log = 'output_log.txt'
+#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' &&
+#if str($output_type) == 'List' or str($output_type) == 'Count':
+    #set list_or_count = True
+#else:
+    #set output_filename = '.'.join(['output', $input.ext])
+    touch '$output_filename' &&
+    #set list_or_count = False
+#end if
+touch '$error_log' &&
+ImageJ --ij2 --headless --debug
+--jython '$__tool_directory__/imagej2_find_maxima_jython_script.py'
+'$error_log'
+'$input_with_ext'
+'$scale_when_converting'
+'$weighted_rgb_conversions'
+$noise_tolerance
+'$output_type'
+'$exclude_edge_maxima'
+'$light_background'
+#if $list_or_count:
+    '$results'
+    'tabular'
+#else:
+    '$output_filename'
+    '$input.ext'
+#end if
+&>'$error_log';
+if [[ $? -ne 0 ]]; then
+    cat '$error_log' >&2;
+else
+    #if $list_or_count:
+        mv '$results' '$output';
     #else:
-        --output "$output"
-        --output_datatype $output.ext
+        mv '$output_filename' '$output';
     #end if
-]]>
-    </command>
+fi
+]]></command>
     <inputs>
-        <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="input" type="data" label="Select image"/>
+        <expand macro="param_input"/>
         <param name="noise_tolerance" type="integer" value="10" min="0" label="Noise tolerance" help="Maxima are ignored if they do not stand out from the surroundings by more than this value."/>
         <param name="output_type" type="select" label="Output type">
             <option value="Single_Points" selected="True">Single Points</option>
@@ -59,30 +79,30 @@
         </param>
     </inputs>
     <outputs>
-        <data name="output" format_source="input" label="${tool.name} on ${on_string}: ${output_type}">
+        <data name="output" format_source="input">
             <filter>output_type != "List" and output_type != "Count"</filter>
         </data>
-        <data name="results" format="tabular" label="${tool.name} on ${on_string}: ${output_type}">
+        <data name="results" format="tabular">
             <filter>output_type == "List" or output_type == "Count"</filter>
         </data>
     </outputs>
     <tests>
         <test>
-            <param name="input" value="blobs.gif" />
-            <output name="output" file="blobs_single_points.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <output name="output" file="blobs_single_points.gif" compare="sim_size"/>
         </test>
         <test>
-            <param name="input" value="blobs.gif" />
-            <param name="noise_tolerance" value="13" />
-            <param name="output_type" value="Maxima_Within_Tolerance" />
-            <output name="output" file="blobs_tolerance.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="noise_tolerance" value="13"/>
+            <param name="output_type" value="Maxima_Within_Tolerance"/>
+            <output name="output" file="blobs_tolerance.gif" compare="sim_size"/>
         </test>
         <test>
-            <param name="input" value="blobs.gif" />
-            <param name="noise_tolerance" value="16" />
-            <param name="output_type" value="Segmented_Particles" />
-            <param name="exclude_edge_maxima" value="yes" />
-            <output name="output" file="blobs_segmented.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="noise_tolerance" value="16"/>
+            <param name="output_type" value="Segmented_Particles"/>
+            <param name="exclude_edge_maxima" value="yes"/>
+            <output name="output" file="blobs_segmented.gif" compare="sim_size"/>
         </test>
         <!--
         This version of Fiji does not produce the same resultsTable
@@ -132,5 +152,5 @@
 - **Light Background** - Select "yes" if the image background is brighter than the objects you want to find.
 
     </help>
-    <expand macro="fiji_headless_citations" />
+    <expand macro="fiji_headless_citations"/>
 </tool>