diff imagej2_make_binary.xml @ 1:6e8be21a505c 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:53:58 +0000
parents baa308e2533a
children d3e8ef83f3bf
line wrap: on
line diff
--- a/imagej2_make_binary.xml	Tue Sep 17 17:07:31 2019 -0400
+++ b/imagej2_make_binary.xml	Mon Sep 28 16:53:58 2020 +0000
@@ -1,38 +1,46 @@
-<?xml version='1.0' encoding='UTF-8'?>
 <tool id="imagej2_make_binary" name="Convert to binary" version="@WRAPPER_VERSION@.0">
     <description>(black and white)</description>
     <macros>
         <import>imagej2_macros.xml</import>
     </macros>
-    <expand macro="fiji_requirements" />
-    <command>
-<![CDATA[
-    python $__tool_directory__/imagej2_make_binary.py
-    --input "$input"
-    --input_datatype $input.ext
-    @make_binary_args@
-    --jython_script $__tool_directory__/imagej2_make_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_make_binary_jython_script.py'
+'$error_log'
+'$input_with_ext'
+$iterations
+$count
+'$black_background'
+'$pad_edges_when_eroding'
+'$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"/>
-        <expand macro="make_binary_params" />
+        <expand macro="param_input"/>
+        <expand macro="make_binary_params"/>
     </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="clown.jpg" />
-            <param name="input_datatype" value="jpg" />
-            <param name="iterations" value="1" />
-            <param name="count" value="1" />
-            <param name="black_background" value="no" />
-            <param name="pad_edges_when_eroding" value="no" />
-            <param name="output_datatype" value="jpg" />
-            <output name="output" file="clown_binary.jpg" compare="sim_size" />
+            <param name="input" value="clown.jpg"/>
+            <output name="output" file="clown_binary.jpg" compare="sim_size"/>
         </test>
     </tests>
     <help>
@@ -50,5 +58,5 @@
 ]]>
 
     </help>
-    <expand macro="fiji_headless_citations" />
+    <expand macro="fiji_headless_citations"/>
 </tool>