changeset 1:f8b7770cbca5 draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/image_math commit c045f067a57e8308308cf6329060c7ccd3fc372f
author imgteam
date Thu, 04 Apr 2024 15:25:35 +0000
parents 33b2ca53a566
children 48fa3ac55df2
files creators.xml image_math.xml tests.xml
diffstat 3 files changed, 132 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creators.xml	Thu Apr 04 15:25:35 2024 +0000
@@ -0,0 +1,23 @@
+<macros>
+
+    <xml name="creators/bmcv">
+        <organization name="Biomedical Computer Vision Group, Heidelberg Universtiy" alternateName="BMCV" url="http://www.bioquant.uni-heidelberg.de/research/groups/biomedical_computer_vision.html" />
+        <yield />
+    </xml>
+
+    <xml name="creators/alliecreason">
+        <person givenName="Allison" familyName="Creason"/>
+        <yield/>
+    </xml>
+
+    <xml name="creators/bugraoezdemir">
+        <person givenName="Bugra" familyName="Oezdemir"/>
+        <yield/>
+    </xml>
+
+    <xml name="creators/thawn">
+        <person givenName="Till" familyName="Korten"/>
+        <yield/>
+    </xml>
+    
+</macros>
--- a/image_math.xml	Sat Mar 09 22:04:19 2024 +0000
+++ b/image_math.xml	Thu Apr 04 15:25:35 2024 +0000
@@ -1,14 +1,19 @@
 <tool id="image_math" name="Process images using arithmetic expressions" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
     <description>with NumPy</description>
     <macros>
+        <import>creators.xml</import>
+        <import>tests.xml</import>
         <token name="@TOOL_VERSION@">1.26.4</token>
-        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
     </macros>
+    <creator>
+        <expand macro="creators/bmcv"/>
+    </creator>
     <edam_operations>
         <edam_operation>operation_3443</edam_operation>
     </edam_operations>
     <requirements>
-        <requirement type="package" version="1.26.4">numpy</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">numpy</requirement>
         <requirement type="package" version="0.22.0">scikit-image</requirement>
     </requirements>
     <command><![CDATA[
@@ -49,7 +54,7 @@
                 <param name="image" value="input1.tiff" />
                 <param name="name" value="input1" />
             </repeat>
-            <output name="result" value="input1_times_2.tiff" ftype="tiff" compare="sim_size" delta="0" />
+            <expand macro="tests/intensity_image_diff" name="result" value="input1_times_2.tiff" ftype="tiff"/>
         </test>
         <!-- Unary negation operator -->
         <test>
@@ -58,7 +63,7 @@
                 <param name="image" value="input1.tiff" />
                 <param name="name" value="input1" />
             </repeat>
-            <output name="result" value="minus_input1.tiff" ftype="tiff" compare="sim_size" delta="0" />
+            <expand macro="tests/intensity_image_diff" name="result" value="minus_input1.tiff" ftype="tiff"/>
         </test>
         <!-- Binary addition, neutral element, addition with scalar -->
         <test>
@@ -71,7 +76,7 @@
                 <param name="image" value="minus_input1.tiff" />
                 <param name="name" value="input2" />
             </repeat>
-            <output name="result" value="ones.tiff" ftype="tiff" compare="sim_size" delta="0" />
+            <expand macro="tests/intensity_image_diff" name="result" value="ones.tiff" ftype="tiff"/>
         </test>
         <!-- Parentheses -->
         <test>
@@ -84,7 +89,7 @@
                 <param name="image" value="ones.tiff" />
                 <param name="name" value="input2" />
             </repeat>
-            <output name="result" value="half_of_input1_plus_one.tiff" ftype="tiff" compare="sim_size" delta="0" />
+            <expand macro="tests/intensity_image_diff" name="result" value="half_of_input1_plus_one.tiff" ftype="tiff"/>
         </test>
         <!-- Abs -->
         <test>
@@ -93,12 +98,12 @@
                 <param name="image" value="input1.tiff" />
                 <param name="name" value="input" />
             </repeat>
-            <output name="result" value="input1_abs.tiff" ftype="tiff" compare="sim_size" delta="0" />
+            <expand macro="tests/intensity_image_diff" name="result" value="input1_abs.tiff" ftype="tiff"/>
         </test>
     </tests>
     <help>
 
-        This tool processes images according to pixel-wise arithmetic expressions.
+        **Processes images according to pixel-wise arithmetic expressions.**
 
         The supported pixel-wise expressions are:
 
@@ -128,4 +133,4 @@
     <citations>
         <citation type="doi">10.1038/s41586-020-2649-2</citation>
     </citations>
-</tool>
\ No newline at end of file
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests.xml	Thu Apr 04 15:25:35 2024 +0000
@@ -0,0 +1,95 @@
+<macros>
+
+    <!-- Macros for verification of image outputs -->
+
+    <xml
+        name="tests/binary_image_diff"
+        tokens="name,value,ftype,metric,eps"
+        token_metric="mae"
+        token_eps="0.01">
+
+        <output name="@NAME@" value="@VALUE@" ftype="@FTYPE@" compare="image_diff" metric="@METRIC@" eps="@EPS@" pin_labels="0">
+            <assert_contents>
+                <has_image_n_labels n="2"/>
+                <yield/>
+            </assert_contents>
+        </output>
+
+    </xml>
+
+    <xml
+        name="tests/label_image_diff"
+        tokens="name,value,ftype,metric,eps,pin_labels"
+        token_metric="iou"
+        token_eps="0.01"
+        token_pin_labels="0">
+
+        <output name="@NAME@" value="@VALUE@" ftype="@FTYPE@" compare="image_diff" metric="@METRIC@" eps="@EPS@" pin_labels="@PIN_LABELS@">
+            <assert_contents>
+                <yield/>
+            </assert_contents>
+        </output>
+
+    </xml>
+
+    <xml
+        name="tests/intensity_image_diff"
+        tokens="name,value,ftype,metric,eps"
+        token_metric="rms"
+        token_eps="0.01">
+
+        <output name="@NAME@" value="@VALUE@" ftype="@FTYPE@" compare="image_diff" metric="@METRIC@" eps="@EPS@">
+            <assert_contents>
+                <yield/>
+            </assert_contents>
+        </output>
+
+    </xml>
+
+    <!-- Variants of the above for verification of collection elements -->
+
+    <xml
+        name="tests/binary_image_diff/element"
+        tokens="name,value,ftype,metric,eps"
+        token_metric="mae"
+        token_eps="0.01">
+
+        <element name="@NAME@" value="@VALUE@" ftype="@FTYPE@" compare="image_diff" metric="@METRIC@" eps="@EPS@" pin_labels="0">
+            <assert_contents>
+                <has_image_n_labels n="2"/>
+                <yield/>
+            </assert_contents>
+        </element>
+
+    </xml>
+
+    <xml
+        name="tests/label_image_diff/element"
+        tokens="name,value,ftype,metric,eps"
+        token_metric="iou"
+        token_eps="0.01"
+        token_pin_labels="0">
+
+        <element name="@NAME@" value="@VALUE@" ftype="@FTYPE@" compare="image_diff" metric="@METRIC@" eps="@EPS@" pin_labels="@PIN_LABELS@">
+            <assert_contents>
+                <yield/>
+            </assert_contents>
+        </element>
+
+    </xml>
+
+    <xml
+        name="tests/intensity_image_diff/element"
+        tokens="name,value,ftype,metric,eps"
+        token_metric="rms"
+        token_eps="0.01">
+
+        <element name="@NAME@" value="@VALUE@" ftype="@FTYPE@" compare="image_diff" metric="@METRIC@" eps="@EPS@">
+            <assert_contents>
+                <yield/>
+            </assert_contents>
+        </element>
+
+    </xml>
+
+</macros>