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

BFtools: Add option to showinf to validate TIFF vs OME-XML #3677

Open
dgault opened this issue Mar 30, 2021 · 4 comments
Open

BFtools: Add option to showinf to validate TIFF vs OME-XML #3677

dgault opened this issue Mar 30, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@dgault
Copy link
Member

dgault commented Mar 30, 2021

This was a feature request raised on imagesc thread https://forum.image.sc/t/xmlvalid-check-for-omexml-vs-tiff-header-mismatch/50720/4

In the given example the OME-XML metadata does not align with the TIFF metadata and attempts to catch the mismatch in a validation step failed as the XML is only validated against the schema using the xmlvalid tool.

Showinf does perform such checks and outputs warnings but they are contained amongst the remainder of the showinf ouptut. Having a new option which would enable stricter validation and only out any validation errors or warnings for metadata mismatches would be useful in this case.

@dgault dgault added the enhancement New feature or request label Mar 30, 2021
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/xmlvalid-check-for-omexml-vs-tiff-header-mismatch/50720/6

@sbesson
Copy link
Member

sbesson commented Mar 30, 2021

We have been discussing a similar strict option in the past. At the moment, a WARNING level logging message is used:

LOGGER.warn("SamplesPerPixel mismatch: OME={}, TIFF={}",
samples, tiffSamples);
samples = tiffSamples;

LOGGER.warn("SizeX mismatch: OME={}, TIFF={}",
m.sizeX, tiffWidth);

Would a reader option that would allow to either log at the WARN level or throw a FormatException with the appropriate error message be a step in the right direction, especially in the context of QC as mentioned in the forum post?

IF so, a next question would be to know whether a single key/value pair allowing to choose between strict/lenient would be sufficient or whether more granularity might be required.

@dgault
Copy link
Member Author

dgault commented Mar 30, 2021

Throwing an exception could be beneficial and having it as an option would be nice, strict or lenient would work fine for this. Ideally you would likely want to know the full list of mismatched values so it may be best to gather the full list of warnings first.

@sbesson
Copy link
Member

sbesson commented Mar 30, 2021

Ideally you would likely want to know the full list of mismatched values so it may be best to gather the full list of warnings first.

👍 this is certainly inline with the current behavior of xmlvalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants