Mercurial > repos > imgteam > crop_image
comparison crop_image.xml @ 0:f8bfa85cac4c draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/crop_image/ commit 7a5037206d267aa7d9b7e5e062327c3464942471
| author | imgteam |
|---|---|
| date | Fri, 06 Jun 2025 12:46:50 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:f8bfa85cac4c |
|---|---|
| 1 <tool id="ip_crop_image" name="Crop image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> | |
| 2 <description>with giatools</description> | |
| 3 <macros> | |
| 4 <import>creators.xml</import> | |
| 5 <import>tests.xml</import> | |
| 6 <token name="@TOOL_VERSION@">0.4.1</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 <xrefs> | |
| 16 <xref type="bio.tools">giatools</xref> | |
| 17 </xrefs> | |
| 18 <requirements> | |
| 19 <requirement type="package" version="@TOOL_VERSION@">giatools</requirement> | |
| 20 </requirements> | |
| 21 <command detect_errors="aggressive"><![CDATA[ | |
| 22 | |
| 23 mkdir ./output && | |
| 24 python '$__tool_directory__/crop_image.py' | |
| 25 | |
| 26 '$image' | |
| 27 '$labelmap' | |
| 28 '$skip_labels' | |
| 29 '${image.ext}' | |
| 30 | |
| 31 ./output | |
| 32 | |
| 33 ]]></command> | |
| 34 <inputs> | |
| 35 <param name="image" type="data" format="png,tiff" label="Image file" help="The image to be cropped."/> | |
| 36 <param name="labelmap" type="data" format="png,tiff" label="Label map" help="Each label identifies an individual region of interest, for which a cropped image is produced."/> | |
| 37 <param name="skip_labels" type="text" label="Skip labels" value="0" optional="true" help="Comma-separated list of labels for which no cropped image shall be produced."> | |
| 38 <validator type="regex">^\d+(,\d+)*$|^$</validator> | |
| 39 </param> | |
| 40 </inputs> | |
| 41 <outputs> | |
| 42 <collection type="list" name="output" label="Crop ${on_string}" format_source="image"> | |
| 43 <discover_datasets directory="output" pattern="__name_and_ext__"/> | |
| 44 </collection> | |
| 45 </outputs> | |
| 46 <tests> | |
| 47 <!-- Test 2D TIFF --> | |
| 48 <test> | |
| 49 <param name="image" value="yx_float32.tiff" ftype="tiff"/> | |
| 50 <param name="labelmap" value="yx_uint8.tiff"/> | |
| 51 <output_collection name="output" type="list" count="2"> | |
| 52 <expand macro="tests/intensity_image_diff/element" name="1" value="yx_float32_uint8_1.tiff" ftype="tiff"/> | |
| 53 <expand macro="tests/intensity_image_diff/element" name="2" value="yx_float32_uint8_2.tiff" ftype="tiff"/> | |
| 54 </output_collection> | |
| 55 </test> | |
| 56 <!-- Test with `skip_labels` --> | |
| 57 <test> | |
| 58 <param name="image" value="yx_float32.tiff" ftype="tiff"/> | |
| 59 <param name="labelmap" value="yx_uint8.tiff"/> | |
| 60 <param name="skip_labels" value="0,1"/> | |
| 61 <output_collection name="output" type="list" count="1"> | |
| 62 <expand macro="tests/intensity_image_diff/element" name="2" value="yx_float32_uint8_2.tiff" ftype="tiff"/> | |
| 63 </output_collection> | |
| 64 </test> | |
| 65 <!-- Test with empty `skip_labels` --> | |
| 66 <test> | |
| 67 <param name="image" value="yx_float32.tiff" ftype="tiff"/> | |
| 68 <param name="labelmap" value="yx_uint8.tiff"/> | |
| 69 <param name="skip_labels" value=""/> | |
| 70 <output_collection name="output" type="list" count="3"> | |
| 71 <expand macro="tests/intensity_image_diff/element" name="0" value="yx_float32_uint8_0.tiff" ftype="tiff"/> | |
| 72 <expand macro="tests/intensity_image_diff/element" name="1" value="yx_float32_uint8_1.tiff" ftype="tiff"/> | |
| 73 <expand macro="tests/intensity_image_diff/element" name="2" value="yx_float32_uint8_2.tiff" ftype="tiff"/> | |
| 74 </output_collection> | |
| 75 </test> | |
| 76 <!-- Test 3D TIFF (multi-frame) --> | |
| 77 <test> | |
| 78 <param name="image" value="zyx_uint16.tiff" ftype="tiff"/> | |
| 79 <param name="labelmap" value="yxz_uint8.tiff"/> | |
| 80 <output_collection name="output" type="list" count="1"> | |
| 81 <expand macro="tests/intensity_image_diff/element" name="1" value="zyx_uint16_uint8_1.tiff" ftype="tiff"/> | |
| 82 </output_collection> | |
| 83 </test> | |
| 84 <!-- Test PNG --> | |
| 85 <test> | |
| 86 <param name="image" value="yxc_uint8.png" ftype="png"/> | |
| 87 <param name="labelmap" value="yxc_uint8_mask.png"/> | |
| 88 <output_collection name="output" type="list" count="1"> | |
| 89 <expand macro="tests/intensity_image_diff/element" name="2" value="yxc_uint8_uint8_2.png" ftype="png"/> | |
| 90 </output_collection> | |
| 91 </test> | |
| 92 </tests> | |
| 93 <help> | |
| 94 | |
| 95 **Crops an image using one or more regions of interest.** | |
| 96 | |
| 97 The image is cropped using a label map that identifies individual regions of interest. The image and the label map must be of equal size. | |
| 98 | |
| 99 This operation preserves the file type of the image, the brightness, and the range of values. | |
| 100 | |
| 101 </help> | |
| 102 <citations> | |
| 103 <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> | |
| 104 </citations> | |
| 105 </tool> |
