diff imagej2_bunwarpj_compare_elastic.xml @ 1:125641435c4b 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:44:00 +0000
parents b95f87118c6f
children 42ba21dc9ea6
line wrap: on
line diff
--- a/imagej2_bunwarpj_compare_elastic.xml	Tue Sep 17 17:05:38 2019 -0400
+++ b/imagej2_bunwarpj_compare_elastic.xml	Mon Sep 28 16:44:00 2020 +0000
@@ -1,38 +1,46 @@
-<?xml version='1.0' encoding='UTF-8'?>
 <tool id="imagej2_bunwarpj_compare_elastic" name="Compare opposite elastic deformations" version="@WRAPPER_VERSION@.0">
     <description>by warping index with bUnwarpJ</description>
     <macros>
         <import>imagej2_macros.xml</import>
     </macros>
-    <expand macro="fiji_requirements" />
-    <command>
-<![CDATA[
-    python $__tool_directory__/imagej2_bunwarpj_compare_elastic.py
-    --target_image "$target_image"
-    --target_image_format $target_image.ext
-    --source_image "$source_image"
-    --source_image_format $source_image.ext
-    --target_transformation "$target_transformation"
-    --source_transformation "$source_transformation"
-    --output "$output"
+    <expand macro="fiji_requirements"/>
+    <command detect_errors="exit_code"><![CDATA[
+#import os
+#set output_log = 'output_log.txt'
+#set source_sans_ext = $os.path.splitext($os.path.basename($source_image.file_name))[0]
+#set source_with_ext = '.'.join([source_sans_ext, $source_image.ext])
+ln -s '$source_image.file_name' '$source_with_ext' &&
+#set target_sans_ext = $os.path.splitext($os.path.basename($target_image.file_name))[0]
+#set target_with_ext = '.'.join([target_sans_ext, $target_image.ext])
+ln -s '$target_image.file_name' '$target_with_ext' &&
+bunwarpj -compare_elastic
+'$target_with_ext'
+'$source_with_ext'
+'$target_transformation'
+'$source_transformation'
+&>'$output_log';
+if [[ $? -ne 0 ]]; then
+    cat '$output_log' >&2;
+else
+    grep -Po 'Warping index = \K[^ ]+' '$output_log' > '$output';
+fi
 ]]>
     </command>
     <inputs>
-        <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="target_image" type="data" label="Target image"/>
-        <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="source_image" type="data" label="Source image"/>
+        <expand macro="param_target_image"/>
+        <expand macro="param_source_image"/>
         <param format="txt" name="target_transformation" type="data" label="Target inverse transformation"/>
         <param format="txt" name="source_transformation" type="data" label="Source direct transformation"/>
     </inputs>
     <outputs>
-        <data name="output" format="txt" label="${tool.name} on ${on_string}: Warping index" />
+        <data name="output" format="txt"/>
     </outputs>
     <tests>
         <test>
-            <param name="target_image" value="dotblot.jpg" />
-            <param name="source_image" value="blobs.gif" />
-            <param name="target_transformation" value="target_elastic_transformation.txt" />
-            <param name="source_transformation" value="source_elastic_transformation.txt" />
-            <output name="output" file="warping_index.txt" />
+            <expand macro="test_target_source_images"/>
+            <param name="target_transformation" value="target_elastic_transformation.txt"/>
+            <param name="source_transformation" value="source_elastic_transformation.txt"/>
+            <output name="output" file="warping_index.txt"/>
         </test>
     </tests>
     <help>
@@ -47,5 +55,5 @@
 ]]>
 
     </help>
-    <expand macro="bunwarpj_citations" />
+    <expand macro="bunwarpj_citations"/>
 </tool>