bioformats icon indicating copy to clipboard operation
bioformats copied to clipboard

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

Open dgault opened this issue 4 years ago • 4 comments

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 avatar Mar 30 '21 09:03 dgault

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

imagesc-bot avatar Mar 30 '21 09:03 imagesc-bot

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

https://github.com/ome/bioformats/blob/25645389e076a7bd0011e04c4dd8982c0f0614ed/components/formats-bsd/src/loci/formats/in/OMETiffReader.java#L805-L807 https://github.com/ome/bioformats/blob/25645389e076a7bd0011e04c4dd8982c0f0614ed/components/formats-bsd/src/loci/formats/in/OMETiffReader.java#L1068-L1069

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.

sbesson avatar Mar 30 '21 11:03 sbesson

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.

dgault avatar Mar 30 '21 17:03 dgault

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.

:+1: this is certainly inline with the current behavior of xmlvalid

sbesson avatar Mar 30 '21 19:03 sbesson