Mercurial > repos > imgteam > crop_image
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crop_image.xml Fri Jun 06 12:46:50 2025 +0000 @@ -0,0 +1,105 @@ +<tool id="ip_crop_image" name="Crop image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05"> + <description>with giatools</description> + <macros> + <import>creators.xml</import> + <import>tests.xml</import> + <token name="@TOOL_VERSION@">0.4.1</token> + <token name="@VERSION_SUFFIX@">0</token> + </macros> + <creator> + <expand macro="creators/bmcv" /> + </creator> + <edam_operations> + <edam_operation>operation_3443</edam_operation> + </edam_operations> + <xrefs> + <xref type="bio.tools">giatools</xref> + </xrefs> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">giatools</requirement> + </requirements> + <command detect_errors="aggressive"><![CDATA[ + + mkdir ./output && + python '$__tool_directory__/crop_image.py' + + '$image' + '$labelmap' + '$skip_labels' + '${image.ext}' + + ./output + + ]]></command> + <inputs> + <param name="image" type="data" format="png,tiff" label="Image file" help="The image to be cropped."/> + <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."/> + <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."> + <validator type="regex">^\d+(,\d+)*$|^$</validator> + </param> + </inputs> + <outputs> + <collection type="list" name="output" label="Crop ${on_string}" format_source="image"> + <discover_datasets directory="output" pattern="__name_and_ext__"/> + </collection> + </outputs> + <tests> + <!-- Test 2D TIFF --> + <test> + <param name="image" value="yx_float32.tiff" ftype="tiff"/> + <param name="labelmap" value="yx_uint8.tiff"/> + <output_collection name="output" type="list" count="2"> + <expand macro="tests/intensity_image_diff/element" name="1" value="yx_float32_uint8_1.tiff" ftype="tiff"/> + <expand macro="tests/intensity_image_diff/element" name="2" value="yx_float32_uint8_2.tiff" ftype="tiff"/> + </output_collection> + </test> + <!-- Test with `skip_labels` --> + <test> + <param name="image" value="yx_float32.tiff" ftype="tiff"/> + <param name="labelmap" value="yx_uint8.tiff"/> + <param name="skip_labels" value="0,1"/> + <output_collection name="output" type="list" count="1"> + <expand macro="tests/intensity_image_diff/element" name="2" value="yx_float32_uint8_2.tiff" ftype="tiff"/> + </output_collection> + </test> + <!-- Test with empty `skip_labels` --> + <test> + <param name="image" value="yx_float32.tiff" ftype="tiff"/> + <param name="labelmap" value="yx_uint8.tiff"/> + <param name="skip_labels" value=""/> + <output_collection name="output" type="list" count="3"> + <expand macro="tests/intensity_image_diff/element" name="0" value="yx_float32_uint8_0.tiff" ftype="tiff"/> + <expand macro="tests/intensity_image_diff/element" name="1" value="yx_float32_uint8_1.tiff" ftype="tiff"/> + <expand macro="tests/intensity_image_diff/element" name="2" value="yx_float32_uint8_2.tiff" ftype="tiff"/> + </output_collection> + </test> + <!-- Test 3D TIFF (multi-frame) --> + <test> + <param name="image" value="zyx_uint16.tiff" ftype="tiff"/> + <param name="labelmap" value="yxz_uint8.tiff"/> + <output_collection name="output" type="list" count="1"> + <expand macro="tests/intensity_image_diff/element" name="1" value="zyx_uint16_uint8_1.tiff" ftype="tiff"/> + </output_collection> + </test> + <!-- Test PNG --> + <test> + <param name="image" value="yxc_uint8.png" ftype="png"/> + <param name="labelmap" value="yxc_uint8_mask.png"/> + <output_collection name="output" type="list" count="1"> + <expand macro="tests/intensity_image_diff/element" name="2" value="yxc_uint8_uint8_2.png" ftype="png"/> + </output_collection> + </test> + </tests> + <help> + + **Crops an image using one or more regions of interest.** + + 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. + + This operation preserves the file type of the image, the brightness, and the range of values. + + </help> + <citations> + <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation> + </citations> +</tool>
