-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add content assertion XML tags for test output verification using images #17581
Add content assertion XML tags for test output verification using images #17581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool!
Maybe it would be good to reuse this scheme for asserting numeric values https://github.com/galaxyproject/galaxy/blob/cef07534d54b6e0ad55623534f909f446fb0a1c0/lib/galaxy/tool_util/verify/asserts/size.py#L22C5-L22C19, i.e. use delta
, min
and max
?
My intention in this PR was to use the same attribute names for image verification as in #17556. There, the absolute tolerance for verification is named |
Thanks for your suggestion regarding the lower/upper bounds scheme. I have added The The Footnotes
|
Sounds reasonable to me.
We could have a separate default for images. But anyway I'm happy with it. |
commit 33b660e Author: Leonid Kostrykin <[email protected]> Date: Tue Mar 5 20:58:24 2024 +0000 Fix XSD commit 4ee6112 Author: Leonid Kostrykin <[email protected]> Date: Tue Mar 5 20:53:14 2024 +0000 Add `labels` attribute for `has_image_labels` and `has_image_mean_object_size` commit 4ff401c Author: Leonid Kostrykin <[email protected]> Date: Tue Mar 5 20:32:57 2024 +0000 Replace `image_has_labels` by `has_image_labels` and `has_image_mean_object_size` commit 09149d1 Author: Leonid Kostrykin <[email protected]> Date: Tue Mar 5 19:51:56 2024 +0000 Fix bug commit 28fedb9 Author: Leonid Kostrykin <[email protected]> Date: Tue Mar 5 19:44:12 2024 +0000 Replace `image_has_intensities` by `has_image_mean_intensity` and `has_image_center_of_mass` commit fe96916 Author: Leonid Kostrykin <[email protected]> Date: Tue Mar 5 19:10:38 2024 +0000 Replace `image_has_metadata` by `has_image_width`, etc.
Thanks for your comments, @bernt-matthias. In the course of splitting the combined You mentioned before, that
can you please elaborate how this is possible? See the XSD snippet below. Caution We would also need to change to the type of
Then we would have This is the definition of the default in galaxy.xsd: <xs:attribute name="delta" type="xs:integer" default="10000">
...
</xs:attribute> Edit: After having thought about this for a while, I think that renaming |
For some reason the |
Unrelated to your PR, will be fixed by #17612 . |
Co-authored-by: M Bernt <[email protected]>
Co-authored-by: M Bernt <[email protected]>
Thanks so much. Really cool. This will be really helpful. |
…s_images Add content assertion XML tags for test output verification using images
…ysis` This is a temporary change to enable the features from: - galaxyproject/galaxy#17556 - galaxyproject/galaxy#17581
* Update pr.yaml * Update * Update pr.yaml * Add `pip install pillow` * Temporarilly fix CI * Update pr.yaml * Update ci.yaml * Add test tool from `/test/functional/tools/image_diff.xml` * Update pr.yaml * Add .shed.yml * Add missing test files * Switch CI to galaxy fork `kostrykin/galaxy` branch `galaxy-image-analysis` This is a temporary change to enable the features from: - galaxyproject/galaxy#17556 - galaxyproject/galaxy#17581 * Remove `test` tool
* Rename tools Change the `Performs` in the name of the two tools - `Performs projective transformation with/without labels` - `Performs projective transformation` to `Perform`, which is more consistent with the name of the other tools (imperative form). * Update projective_transformation.xml * Update projective_transformation_points.xml * Add CONVENTIONS.md * wip * wip * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Remove help section * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update * Update test data * Add content assertions * Update pr.yaml * Update * Update pr.yaml * Add `pip install pillow` * Merge CONVENTIONS.md into CONTRIBUTING.md * Temporarilly fix CI * Update `2d_feature_extraction` tool * Update `2d_auto_threshold` tool * Fix `2d_feature_extraction` tests * Fix test data * Fix tool * Start refactoring `2d_simple_filter` tool * Fix `2d_simple_filter` tool * Add more tests * Fix tests * Update * Fix * Update CONTRIBUTING.md * Fix bugs * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Fix linting issues * Update CONTRIBUTING.md * Refactor tests using macros * Update tests * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update pr.yaml * Update `anisotropic_diffusion` tool * Fix spelling (was BE, using AE is more consistent) * Update `2d_histogram_equalization` tool * Update `colorize_labels` tool * Update `bf2raw` tool * Add `macros/creators.xml` * Update `rfove` tool * Fix `bioformats2raw` and `voronoi_tessellation` tools * Fix labels * Fix `rfove` tool * Update `overlay_images` tool * Add RGB test for `overlay_images` * Update `overlay_images` help * Add image verification support to CI (BMCV#117) * Update pr.yaml * Update * Update pr.yaml * Add `pip install pillow` * Temporarilly fix CI * Update pr.yaml * Update ci.yaml * Add test tool from `/test/functional/tools/image_diff.xml` * Update pr.yaml * Add .shed.yml * Add missing test files * Switch CI to galaxy fork `kostrykin/galaxy` branch `galaxy-image-analysis` This is a temporary change to enable the features from: - galaxyproject/galaxy#17556 - galaxyproject/galaxy#17581 * Remove `test` tool * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update test data * Add RGB test for `overlay_images` * Update `anisotropic_diffusion` to medpy 0.4.0 * Update PULL_REQUEST_TEMPLATE.md * Update `projective_transformation_points` tool * Update PULL_REQUEST_TEMPLATE.md * Update `bioformats2raw` * Update `projective_transformation` tool * Update `bfconvert` tool (tests failing) * Update CONTRIBUTING.md * Fix `bfconvert` tests * Fix test data size * Update `projective_transformation_points` tool * Remove spurious files * Update requirements using `@TOOL_VERSION@` macro * Update `segmetrics` tool * Remove spurious sym links * Update `superdsm` tool * Update `scale_image` tool (not finished yet) * Fix tests * Fix `scale_image` tool * Refactor * Fix linting issues * Update tests and help of `2d_simple_filter` tool * Update `scale_image` help * Update CI to use latest version of `galaxy` fork * Fix tests for float TIFF in `scale_image` tool * Add tifffile to CI workflows * Fix tests of `bfconvert` tool * Update `2d_filter_segmentation_by_features` tool * Update `image_math` tool * Update `orientationpy` tool * Update `morphological_operations` tool * Update `split_labelmap` tool * Add float TIFF test for `2d_simple_filter` * Update `slice_image` tool * Add missing macros * Update help of `2d_filter_segmentation_by_features` tool * Update `concat_images` tool * Fix linting issues * Fix file sizes * Fix missing `profile`
Update 23 tools and macros * Update 23 tools * Rename tools Change the `Performs` in the name of the two tools - `Performs projective transformation with/without labels` - `Performs projective transformation` to `Perform`, which is more consistent with the name of the other tools (imperative form). * Update projective_transformation.xml * Update projective_transformation_points.xml * Add CONVENTIONS.md * wip * wip * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Remove help section * Update CONVENTIONS.md * Update CONVENTIONS.md * Update CONVENTIONS.md * Update * Update test data * Add content assertions * Update pr.yaml * Update * Update pr.yaml * Add `pip install pillow` * Merge CONVENTIONS.md into CONTRIBUTING.md * Temporarilly fix CI * Update `2d_feature_extraction` tool * Update `2d_auto_threshold` tool * Fix `2d_feature_extraction` tests * Fix test data * Fix tool * Start refactoring `2d_simple_filter` tool * Fix `2d_simple_filter` tool * Add more tests * Fix tests * Update * Fix * Update CONTRIBUTING.md * Fix bugs * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Fix linting issues * Update CONTRIBUTING.md * Refactor tests using macros * Update tests * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update pr.yaml * Update `anisotropic_diffusion` tool * Fix spelling (was BE, using AE is more consistent) * Update `2d_histogram_equalization` tool * Update `colorize_labels` tool * Update `bf2raw` tool * Add `macros/creators.xml` * Update `rfove` tool * Fix `bioformats2raw` and `voronoi_tessellation` tools * Fix labels * Fix `rfove` tool * Update `overlay_images` tool * Add RGB test for `overlay_images` * Update `overlay_images` help * Add image verification support to CI (#117) * Update pr.yaml * Update * Update pr.yaml * Add `pip install pillow` * Temporarilly fix CI * Update pr.yaml * Update ci.yaml * Add test tool from `/test/functional/tools/image_diff.xml` * Update pr.yaml * Add .shed.yml * Add missing test files * Switch CI to galaxy fork `kostrykin/galaxy` branch `galaxy-image-analysis` This is a temporary change to enable the features from: - galaxyproject/galaxy#17556 - galaxyproject/galaxy#17581 * Remove `test` tool * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update test data * Add RGB test for `overlay_images` * Update `anisotropic_diffusion` to medpy 0.4.0 * Update PULL_REQUEST_TEMPLATE.md * Update `projective_transformation_points` tool * Update PULL_REQUEST_TEMPLATE.md * Update `bioformats2raw` * Update `projective_transformation` tool * Update `bfconvert` tool (tests failing) * Update CONTRIBUTING.md * Fix `bfconvert` tests * Fix test data size * Update `projective_transformation_points` tool * Remove spurious files * Update requirements using `@TOOL_VERSION@` macro * Update `segmetrics` tool * Remove spurious sym links * Update `superdsm` tool * Update `scale_image` tool (not finished yet) * Fix tests * Fix `scale_image` tool * Refactor * Fix linting issues * Update tests and help of `2d_simple_filter` tool * Update `scale_image` help * Update CI to use latest version of `galaxy` fork * Fix tests for float TIFF in `scale_image` tool * Add tifffile to CI workflows * Fix tests of `bfconvert` tool * Update `2d_filter_segmentation_by_features` tool * Update `image_math` tool * Update `orientationpy` tool * Update `morphological_operations` tool * Update `split_labelmap` tool * Add float TIFF test for `2d_simple_filter` * Update `slice_image` tool * Add missing macros * Update help of `2d_filter_segmentation_by_features` tool * Update `concat_images` tool * Fix linting issues * Fix file sizes * Fix missing `profile` * Update test macros
As part of the Imaging Hackathon in Freiburg. This is a follow-up PR of #17556.
Contributions
This PR adds content assertion XML tags for automated test output verification using 2-D single-channel and multi-channel images. The contributed XML tags are detailed below.
image_has_metadata
The
image_has_metadata
XML tag can be used for verification of the metadata of the images generated by a Galaxy tool wrapper. Currently supported metadata is:width
height
channels
Example:
image_has_intensities
The
image_has_intensities
XML tag can be used for verification of the image intensities of the images generated by a Galaxy tool wrapper. Verification of the following features is supported:mean_intensity
mean_intensity_min
mean_intensity_max
center_of_mass
eps
mean_intensity
andcenter_of_mass
assertions.channel
The assertions are imposed for all image channels if the
channel
attribute is omitted.Example:
image_has_labels
The
image_has_labels
XML tag can be used for verification of label images (label maps) generated by a Galaxy tool wrapper. Verification of the following features is supported:number_of_objects
mean_object_size
mean_object_size_min
mean_object_size_max
exclude_labels
eps
mean_object_size
assertion.The primary use case of the
exclude_labels
attribute is to exclude the image background from thenumber_of_objects
andmean_object_size
assertions, which is often labeled by0
or-1
.Example:
How to test the changes?
(Select all options that apply)
License