diff split_image.xml @ 2:227e8928af6e draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/split_image/ commit 5e452f10eb88f0fa8a420eec66c6c97e3060e433
author imgteam
date Fri, 12 Dec 2025 21:02:25 +0000
parents 4b7940d0c051
children
line wrap: on
line diff
--- a/split_image.xml	Sat Apr 12 15:05:17 2025 +0000
+++ b/split_image.xml	Fri Dec 12 21:02:25 2025 +0000
@@ -3,19 +3,23 @@
     <macros>
         <import>creators.xml</import>
         <import>tests.xml</import>
-        <token name="@TOOL_VERSION@">2.2.3</token>
-        <token name="@VERSION_SUFFIX@">1</token>
+        <token name="@TOOL_VERSION@">2.3.5</token>
+        <token name="@VERSION_SUFFIX@">0</token>
     </macros>
     <creator>
         <expand macro="creators/bmcv"/>
+        <expand macro="creators/kostrykin"/>
     </creator>
     <edam_operations>
         <edam_operation>operation_3443</edam_operation>
     </edam_operations>
+    <xrefs>
+        <xref type="bio.tools">galaxy_image_analysis</xref>
+    </xrefs>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">numpy</requirement>
-        <requirement type="package" version="0.4.0">giatools</requirement>
-        <requirement type="package" version="2024.7.24">tifffile</requirement>
+        <requirement type="package" version="0.5.2">giatools</requirement>
+        <requirement type="package" version="2025.10.16">tifffile</requirement>
     </requirements>
     <command detect_errors="aggressive"><![CDATA[
 
@@ -37,8 +41,10 @@
             <option value="C" selected="true">C-axis (split the channels of an image or image sequence)</option>
             <option value="S">S-axis (split the samples of an image or image sequence)</option>
             <option value="Q">Q-axis (other or unknown axis)</option>
+            <option value="">Split dataset that contains multiple images (e.g., multi-series TIFF)</option>
         </param>
-        <param name="squeeze" type="boolean" checked="false" truevalue="--squeeze" falsevalue="" label="Squeeze result imags" help="Only axes with more than one element will be retained in the result images. Does not apply for X and Y axes." />
+        <param name="squeeze" type="boolean" checked="false" truevalue="--squeeze" falsevalue="" label="Squeeze result images"
+               help="Only non-singleton axes (axes with more than one element) will be retained in the result images. This does not apply for the X and Y axes which always are retained." />
     </inputs>
     <outputs>
         <collection type="list" name="output" label="Split ${on_string} along ${axis} axis">
@@ -57,6 +63,27 @@
                 <expand macro="tests/intensity_image_diff/element" name="2.tiff" value="rgb1_g.tiff" ftype="tiff"/>
                 <expand macro="tests/intensity_image_diff/element" name="3.tiff" value="rgb1_b.tiff" ftype="tiff"/>
             </output_collection>
+            <assert_stdout>
+                <has_line line="Input image axes: YXC"/>
+                <has_line line="Input image shape: (32, 32, 3)"/>
+                <has_line line="Writing 3 image(s)"/>
+                <has_line line="Output axes: YXC"/>
+                <has_line line="Output shape: (32, 32, 1)"/>
+            </assert_stdout>
+        </test>
+        <test>
+            <param name="input" value="rgb1.png" />
+            <param name="axis" value="" />
+            <param name="squeeze" value="false" />
+            <output_collection name="output" type="list" count="1">
+                <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="rgb1.tiff" ftype="tiff"/>
+            </output_collection>
+            <assert_stdout>
+                <has_line line="Not a TIFF file"/>
+                <has_line line="Writing 1 image(s)"/>
+                <has_line line="Output axes: YXC"/>
+                <has_line line="Output shape: (32, 32, 3)"/>
+            </assert_stdout>
         </test>
 
         <!-- TIFF tests -->
@@ -68,6 +95,13 @@
                 <expand macro="tests/intensity_image_diff/element" name="01.tiff" value="zcyx_slice01.tiff" ftype="tiff"/>
                 <expand macro="tests/intensity_image_diff/element" name="25.tiff" value="zcyx_slice25.tiff" ftype="tiff"/>
             </output_collection>
+            <assert_stdout>
+                <has_line line="Input image axes: ZCYX"/>
+                <has_line line="Input image shape: (25, 2, 50, 50)"/>
+                <has_line line="Writing 25 image(s)"/>
+                <has_line line="Output axes: ZCYX"/>
+                <has_line line="Output shape: (1, 2, 50, 50)"/>
+            </assert_stdout>
         </test>
         <test>
             <param name="input" value="qyx.tiff" />
@@ -77,6 +111,51 @@
                 <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="qyx_q1.tiff" ftype="tiff"/>
                 <expand macro="tests/intensity_image_diff/element" name="2.tiff" value="qyx_q2.tiff" ftype="tiff"/>
             </output_collection>
+            <assert_stdout>
+                <has_line line="Input image axes: QYX"/>
+                <has_line line="Input image shape: (2, 256, 256)"/>
+                <has_line line="Writing 2 image(s)"/>
+                <has_line line="Output axes: QYX"/>
+                <has_line line="Output shape: (1, 256, 256)"/>
+            </assert_stdout>
+        </test>
+        <test>
+            <param name="input" value="qyx.tiff" />
+            <param name="axis" value="" />
+            <param name="squeeze" value="false" />
+            <output_collection name="output" type="list" count="1">
+                <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="qyx.tiff" ftype="tiff"/>
+            </output_collection>
+            <assert_stdout>
+                <has_line line="Found TIFF with 1 series"/>
+            </assert_stdout>
+        </test>
+
+        <!-- Test splitting multi-series TIFF -->
+        <test>
+            <param name="input" value="multiseries.ome.tiff" />
+            <param name="axis" value="" />
+            <param name="squeeze" value="false" />
+            <output_collection name="output" type="list" count="6">
+                <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="multiseries_series1.tiff" ftype="tiff"/>
+                <expand macro="tests/intensity_image_diff/element" name="6.tiff" value="multiseries_series6.tiff" ftype="tiff"/>
+            </output_collection>
+            <assert_stdout>
+                <has_line line="Found TIFF with 6 series"/>
+                <has_line line="Writing 6 image(s)"/>
+                <has_line line="Output 1 axes: CYX"/>
+                <has_line line="Output 1 shape: (4, 5, 5)"/>
+                <has_line line="Output 2 axes: CYX"/>
+                <has_line line="Output 2 shape: (4, 5, 5)"/>
+                <has_line line="Output 3 axes: CYX"/>
+                <has_line line="Output 3 shape: (4, 5, 5)"/>
+                <has_line line="Output 4 axes: CYX"/>
+                <has_line line="Output 4 shape: (4, 5, 5)"/>
+                <has_line line="Output 5 axes: CYX"/>
+                <has_line line="Output 5 shape: (4, 5, 5)"/>
+                <has_line line="Output 6 axes: CYX"/>
+                <has_line line="Output 6 shape: (4, 5, 5)"/>
+            </assert_stdout>
         </test>
 
         <!-- Test squeezing -->
@@ -89,6 +168,13 @@
                 <expand macro="tests/intensity_image_diff/element" name="2.tiff" value="rgb1_squeezed_g.tiff" ftype="tiff"/>
                 <expand macro="tests/intensity_image_diff/element" name="3.tiff" value="rgb1_squeezed_b.tiff" ftype="tiff"/>
             </output_collection>
+            <assert_stdout>
+                <has_line line="Input image axes: YXC"/>
+                <has_line line="Input image shape: (32, 32, 3)"/>
+                <has_line line="Writing 3 image(s)"/>
+                <has_line line="Output axes: YX"/>
+                <has_line line="Output shape: (32, 32)"/>
+            </assert_stdout>
         </test>
 
         <!-- Test with missing axes -->
@@ -99,6 +185,13 @@
             <output_collection name="output" type="list" count="1">
                 <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="rgb1_split_z.tiff" ftype="tiff"/>
             </output_collection>
+            <assert_stdout>
+                <has_line line="Input image axes: YXC"/>
+                <has_line line="Input image shape: (32, 32, 3)"/>
+                <has_line line="Writing 1 image(s)"/>
+                <has_line line="Output axes: YXC"/>
+                <has_line line="Output shape: (32, 32, 3)"/>
+            </assert_stdout>
         </test>
 
     </tests>