Xmlvalid check for OMEXML vs. TIFF header mismatch

Hi OME team,
I just encountered a self-inflicted injury by creating a large number of ome.tiff files where I used a wrong pixel-type (uint16 vs. the correct uint8) in the OME-XML. We had been using xmlvalid in the QC pipeline to make sure the files were good but I now realize that xmlvalid doesn’t check for such mismatches between what the OMEXML says and the TIFF header info. Would adding such a check to xmlvalid be beyond its intended purpose?

Hi @dsudar.

Yet another interesting Friday question… Do you have the stacktrace for what went wrong? If it’s detectable with the TiffParser then it looks like it’d be fairly easy to add it in at bioformats/XMLValidate.java at c29e626296fcf360da9959eaec041a7d2c885f69 · ome/bioformats · GitHub

But I’ll leave others to say if it’s beyond the intended purpose.

Hope all is well.

Hi @joshmoore . Yeah, Fridays are good for that.
There is no error from xmlvalid at all on these files so TiffParser doesn’t see any trouble when it’s just the OMEXML that is wrong. And FYI, I (yes, that’s me) created the OMEXML myself and stuffed it into the TIFF header using tiffcomment -set . So the original TIFF was just fine until … mistakes were made :slight_smile:

So any such checks in xmlvalid would be more complex. It would actually have to compare the values in the OMEXML with the supposedly matching values in the TIFF tags.

Have a great weekend,

Yeah currently the validation simply validates the XML against the schema. Showinf and the underlying readers themselves will perform more detailed checks and having an option for showinf to only display validation warnings may be one possibility.

Currently running showinf with an invalid pixelType for example will produce a warning (PixelType mismatch: OME=3, TIFF=1 will be displayed in the output and the tiff pixel type will override the OME-XML) but this currently would require someone to check through the output for any such warnings which really isn’t ideal.

Thanks @dgault for directing me to showinf. Indeed, it would be even better if it had an option so it only reports the mismatches and other issues but even this is usable in our QC script that checks for issues in submitted files.

Should I submit a github Issue against showinf for such an option or will you?

I’ve opened a new Issue with the feature request: BFtools: Add option to showinf to validate TIFF vs OME-XML · Issue #3677 · ome/bioformats · GitHub