Skip to content
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 new script Compare_Ome_Xml.py #201

Closed
wants to merge 3 commits into from

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented May 10, 2022

Compare OME.xml between images of the same name in selected Dataset(s).

Script added under "Export_Scripts".
Message gives info on how many images are compared and any differences.

NB: If you've imported images from NGFF, you'll need to manually rename them to match images imported from original files.

Screenshot 2022-05-10 at 09 56 29

cc @pwalczysko

tree2 = ElementTree.ElementTree(ElementTree.fromstring(xml2))

mismatch = False
for child1, child2 in zip(tree1.iter(), tree2.iter()):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See ome/ZarrReader#31 (comment) for a potential concern about the diffing of the trees

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9213cfe compares Planes only with other planes of the same Z/C/T index.
This doesn't check that there are the same number of Plane elements in both XML docs - It simply stores the Plane in a dict with Z/C/T key, and if there's a Plane already stored with that key then we compare them (assumes they are from the 2 different XML docs, but doesn't check that).

For multi-T image (that was previously flagged as non-matching XML) this now passes: https://merge-ci.openmicroscopy.org/web/webclient/?show=image-231218
For multi Z/C/T image, this still fails https://merge-ci.openmicroscopy.org/web/webclient/?show=image-230717
with output like:

Comparing planes Plane:1:1:14
-------- ** difference... ** --------------
nodeA {'DeltaT': '3656.5830078125', 'DeltaTUnit': 's', 'ExposureTime': '0.05000000074505806', 'ExposureTimeUnit': 's', 'PositionX': '925.13', 'PositionXUnit': 'reference frame', 'PositionY': '-5910.84', 'PositionYUnit': 'reference frame', 'PositionZ': '-0.499', 'PositionZUnit': 'reference frame', 'TheC': '1', 'TheT': '14', 'TheZ': '1'}
nodeB {'DeltaT': '1766.001953125', 'DeltaTUnit': 's', 'ExposureTime': '0.07999999821186066', 'ExposureTimeUnit': 's', 'PositionX': '925.13', 'PositionXUnit': 'reference frame', 'PositionY': '-5910.84', 'PositionYUnit': 'reference frame', 'PositionZ': '-0.499', 'PositionZUnit': 'reference frame', 'TheC': '1', 'TheT': '14', 'TheZ': '1'}
...----------------------

@will-moore
Copy link
Member Author

This has served it's purpose - closing until we need it again...

@will-moore will-moore closed this May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants