comparison split_image.xml @ 0:5deaa390ca62 draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/split_image/ commit f1052360d410594fa1795cf0e02576b8fa4d4135
author imgteam
date Fri, 07 Mar 2025 08:07:52 +0000
parents
children 4b7940d0c051
comparison
equal deleted inserted replaced
-1:000000000000 0:5deaa390ca62
1 <tool id="ip_split_image" name="Split image along axes" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05">
2 <description>with NumPy</description>
3 <macros>
4 <import>creators.xml</import>
5 <import>tests.xml</import>
6 <token name="@TOOL_VERSION@">2.2.3</token>
7 <token name="@VERSION_SUFFIX@">0</token>
8 </macros>
9 <creator>
10 <expand macro="creators/bmcv"/>
11 </creator>
12 <edam_operations>
13 <edam_operation>operation_3443</edam_operation>
14 </edam_operations>
15 <requirements>
16 <requirement type="package" version="@TOOL_VERSION@">numpy</requirement>
17 <requirement type="package" version="0.3.2">giatools</requirement>
18 <requirement type="package" version="2024.7.24">tifffile</requirement>
19 </requirements>
20 <command detect_errors="aggressive"><![CDATA[
21
22 mkdir output &&
23 python '$__tool_directory__/split.py'
24
25 '$input'
26 '$axis'
27 output
28
29 $squeeze
30
31 ]]></command>
32 <inputs>
33 <param name="input" type="data" format="tiff,png" label="Image to split" />
34 <param name="axis" type="select" label="Axis to split along">
35 <option value="T">T-axis (split the frames of a temporal image sequence)</option>
36 <option value="Z">Z-axis (split the slices of a 3-D image or image sequence)</option>
37 <option value="C" selected="true">C-axis (split the channels of an image or image sequence)</option>
38 <option value="S">S-axis (split the samples of an image or image sequence)</option>
39 </param>
40 <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." />
41 </inputs>
42 <outputs>
43 <collection type="list" name="output" label="Split ${on_string} along ${axis} axis">
44 <discover_datasets directory="output" pattern="__name__" format="tiff" />
45 </collection>
46 </outputs>
47 <tests>
48
49 <!-- PNG tests -->
50 <test>
51 <param name="input" value="rgb1.png" />
52 <param name="axis" value="C" />
53 <param name="squeeze" value="false" />
54 <output_collection name="output" type="list" count="3">
55 <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="rgb1_r.tiff" ftype="tiff"/>
56 <expand macro="tests/intensity_image_diff/element" name="2.tiff" value="rgb1_g.tiff" ftype="tiff"/>
57 <expand macro="tests/intensity_image_diff/element" name="3.tiff" value="rgb1_b.tiff" ftype="tiff"/>
58 </output_collection>
59 </test>
60
61 <!-- TIFF tests -->
62 <test>
63 <param name="input" value="zcyx.tiff" />
64 <param name="axis" value="Z" />
65 <param name="squeeze" value="false" />
66 <output_collection name="output" type="list" count="25">
67 <expand macro="tests/intensity_image_diff/element" name="01.tiff" value="zcyx_slice01.tiff" ftype="tiff"/>
68 <expand macro="tests/intensity_image_diff/element" name="25.tiff" value="zcyx_slice25.tiff" ftype="tiff"/>
69 </output_collection>
70 </test>
71
72 <!-- Test squeezing -->
73 <test>
74 <param name="input" value="rgb1.png" />
75 <param name="axis" value="C" />
76 <param name="squeeze" value="true" />
77 <output_collection name="output" type="list" count="3">
78 <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="rgb1_squeezed_r.tiff" ftype="tiff"/>
79 <expand macro="tests/intensity_image_diff/element" name="2.tiff" value="rgb1_squeezed_g.tiff" ftype="tiff"/>
80 <expand macro="tests/intensity_image_diff/element" name="3.tiff" value="rgb1_squeezed_b.tiff" ftype="tiff"/>
81 </output_collection>
82 </test>
83
84 <!-- Test with missing axes -->
85 <test>
86 <param name="input" value="rgb1.png" />
87 <param name="axis" value="Z" />
88 <param name="squeeze" value="false" />
89 <output_collection name="output" type="list" count="1">
90 <expand macro="tests/intensity_image_diff/element" name="1.tiff" value="rgb1_split_z.tiff" ftype="tiff"/>
91 </output_collection>
92 </test>
93
94 </tests>
95 <help>
96
97 **Splits an image along a specific axis (e.g., channels).**
98
99 This tool splits an image along a specifc axis and yields a collection of images.
100 This can be used, for example, to convert a multi-channel image into a collection of single-channel images.
101
102 The pixel data type of the split image is preserved (will be the same as the input image).
103
104 </help>
105 <citations>
106 <citation type="doi">10.1038/s41586-020-2649-2</citation>
107 </citations>
108 </tool>