diff imagej2_adjust_threshold_binary.xml @ 1:29a4d422f32a draft default tip

"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:41:15 +0000
parents f1ba33cd9edf
children
line wrap: on
line diff
--- a/imagej2_adjust_threshold_binary.xml	Tue Sep 17 17:09:25 2019 -0400
+++ b/imagej2_adjust_threshold_binary.xml	Mon Sep 28 16:41:15 2020 +0000
@@ -1,30 +1,41 @@
-<?xml version='1.0' encoding='UTF-8'?>
 <tool id="imagej2_adjust_threshold_binary" name="Adjust threshold" 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_adjust_threshold_binary.py
-    --input "$input"
-    --input_datatype $input.ext
-    --threshold_min $threshold_min
-    --threshold_max $threshold_max
-    --method $method
-    --display $display
-    --black_background $black_background
-    --stack_histogram $stack_histogram
-    --jython_script $__tool_directory__/imagej2_adjust_threshold_binary_jython_script.py
-    --output_datatype $output.ext
-    --output "$output"
-]]>
-    </command>
+    <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' &&
+#set output_filename = '.'.join(['output', $input.ext])
+touch '$output_filename' &&
+touch '$error_log' &&
+ImageJ --ij2 --headless --debug
+--jython '$__tool_directory__/imagej2_adjust_threshold_binary_jython_script.py'
+'$error_log'
+'$input_with_ext'
+$threshold_min
+$threshold_max
+'$method'
+'$display'
+'$black_background'
+'$stack_histogram'
+'$output_filename'
+'$input.ext'
+&>'$error_log';
+if [[ $? -ne 0 ]]; then
+    cat '$error_log' >&2;
+else
+    mv '$output_filename' '$output';
+fi
+]]></command>
     <inputs>
-        <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="input" type="data" label="Select image"/>
-        <param name="threshold_min" type="float" value="0" min="0" max="255" label="Minimum threshold value" />
-        <param name="threshold_max" type="float" value="0" min="0" max="255" label="Maximum threshold value" />
+        <expand macro="param_input"/>
+        <param name="threshold_min" type="float" value="0" min="0" max="255" label="Minimum threshold value"/>
+        <param name="threshold_max" type="float" value="0" min="0" max="255" label="Maximum threshold value"/>
         <param name="method" type="select" label="Method" help="The Default method is the modified IsoData algorithm.">
             <option value="Default" selected="True">Default</option>
             <option value="Huang">Huang</option>
@@ -58,41 +69,41 @@
         </param>
     </inputs>
     <outputs>
-        <data name="output" format_source="input" label="${tool.name} on ${on_string}"/>
+        <data name="output" format_source="input"/>
     </outputs>
     <tests>
         <test>
-            <param name="input" value="blobs.gif" />
-            <param name="output_datatype" value="gif" />
-            <param name="threshold_min" value="0.0" />
-            <param name="threshold_max" value="129.0" />
-            <param name="method" value="Default" />
-            <param name="display" value="red" />
-            <param name="black_background" value="no" />
-            <param name="stack_histogram" value="no" />
-            <output name="output" file="blobs_threshold_default.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="output_datatype" value="gif"/>
+            <param name="threshold_min" value="0.0"/>
+            <param name="threshold_max" value="129.0"/>
+            <param name="method" value="Default"/>
+            <param name="display" value="red"/>
+            <param name="black_background" value="no"/>
+            <param name="stack_histogram" value="no"/>
+            <output name="output" file="blobs_threshold_default.gif" compare="sim_size"/>
         </test>
         <test>
-            <param name="input" value="blobs.gif" />
-            <param name="output_datatype" value="gif" />
-            <param name="threshold_min" value="118.0" />
-            <param name="threshold_max" value="255.0" />
-            <param name="method" value="IJ_IsoData" />
-            <param name="display" value="over_under" />
-            <param name="black_background" value="no" />
-            <param name="stack_histogram" value="no" />
-            <output name="output" file="blobs_threshold_ijiso.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="output_datatype" value="gif"/>
+            <param name="threshold_min" value="118.0"/>
+            <param name="threshold_max" value="255.0"/>
+            <param name="method" value="IJ_IsoData"/>
+            <param name="display" value="over_under"/>
+            <param name="black_background" value="no"/>
+            <param name="stack_histogram" value="no"/>
+            <output name="output" file="blobs_threshold_ijiso.gif" compare="sim_size"/>
         </test>
         <test>
-            <param name="input" value="blobs.gif" />
-            <param name="output_datatype" value="gif" />
-            <param name="threshold_min" value="72.0" />
-            <param name="threshold_max" value="255.0" />
-            <param name="method" value="Huang" />
-            <param name="display" value="bw" />
-            <param name="black_background" value="yes" />
-            <param name="stack_histogram" value="no" />
-            <output name="output" file="blobs_threshold_huang_dark.gif" compare="sim_size" />
+            <param name="input" value="blobs.gif"/>
+            <param name="output_datatype" value="gif"/>
+            <param name="threshold_min" value="72.0"/>
+            <param name="threshold_max" value="255.0"/>
+            <param name="method" value="Huang"/>
+            <param name="display" value="bw"/>
+            <param name="black_background" value="yes"/>
+            <param name="stack_histogram" value="no"/>
+            <output name="output" file="blobs_threshold_huang_dark.gif" compare="sim_size"/>
         </test>
     </tests>
     <help>
@@ -113,5 +124,5 @@
 ]]>
 
     </help>
-    <expand macro="fiji_headless_citations" />
+    <expand macro="fiji_headless_citations"/>
 </tool>