view validators.xml @ 4:a9f10dceb17e draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/libcarna/ commit 99d6ebe67515f1362ea4412b143ab2a140c8d631
author imgteam
date Tue, 13 Jan 2026 12:21:55 +0000
parents 7d6be2b7e1e2
children
line wrap: on
line source

<macros>

    <!-- Macros for validation of inputs -->

    <xml name="validators/is_single_channel">
        <!--
        The OME-Zarr datatype in Galaxy is currently not derived from the Image datatype, and it does
        hence not inherit the metadata fields like `channels`. To cope with that, we allow all datasets
        except those where we *know* that they are *not* single-channel.
        -->
        <validator type="expression" message="Dataset is a multi-channel image"
            ><![CDATA[getattr(value.metadata, "channels", None) in (None, '') or int(value.metadata.channels) < 2]]></validator>
    </xml>

    <xml name="validators/is_single_frame">
        <!--
        The OME-Zarr datatype in Galaxy is currently not derived from the Image datatype, and it does
        hence not inherit the metadata fields like `frames`. To cope with that, we allow all datasets
        except those where we *know* that they are *not* single-frame.
        -->
        <validator type="expression" message="Dataset is a multi-frame image"
            ><![CDATA[getattr(value.metadata, "frames", None) in (None, '') or int(value.metadata.frames) < 2]]></validator>
    </xml>

    <xml name="validators/is_2d">
        <!--
        The OME-Zarr datatype in Galaxy is currently not derived from the Image datatype, and it does
        hence not inherit the metadata fields like `depth`. To cope with that, we allow all datasets
        except those where we *know* that they are *not* 2-D.
        -->
        <validator type="expression" message="Dataset is a 3-D image"
            ><![CDATA[getattr(value.metadata, "depth", None) in (None, '') or int(value.metadata.depth) < 2]]></validator>
    </xml>

    <xml name="validators/is_3d">
        <!--
        The OME-Zarr datatype in Galaxy is currently not derived from the Image datatype, and it does
        hence not inherit the metadata fields like `depth`. To cope with that, we allow all datasets
        except those where we *know* that they are *not* 3-D.
        -->
        <validator type="expression" message="Dataset is a 2-D image"
            ><![CDATA[getattr(value.metadata, "depth", None) in (None, '') or int(value.metadata.depth) >= 2]]></validator>
    </xml>

    <xml name="validators/is_binary">
        <!--
        The OME-Zarr datatype in Galaxy is currently not derived from the Image datatype, and it does
        hence not inherit the metadata fields like `num_unique_values`. To cope with that, we allow all
        datasets except those where we *know* that they are *not* binary.
        -->
        <validator type="expression" message="Dataset is not a binary image"
            ><![CDATA[getattr(value.metadata, "num_unique_values", None) in (None, '') or int(value.metadata.num_unique_values) <= 2]]></validator>
    </xml>

</macros>