Page 1 of 1

Validating xml in ome-tiff files

PostPosted: Wed May 16, 2012 2:51 pm
by Simon Carter
I'm struggling with the validation of the xml in the tiffs I'm generating.

The online validator - when it doesn't hang - will report errors when I use the Experimenter element or Creator attribute.

See http://git.openmicroscopy.org/src/devel ... perimenter) and http://git.openmicroscopy.org/src/devel ... ME_Creator

Element '{http://www.openmicroscopy.org/Schemas/OME/2011-06}Experimenter': This element is not expected. Expected is one of ( {http://www.openmicroscopy.org/Schemas/OME/2011-06}Instrument, {http://www.openmicroscopy.org/Schemas/OME/2011-06}Image, {http://www.openmicroscopy.org/Schemas/SA/2011-06}StructuredAnnotations, {http://www.openmicroscopy.org/Schemas/ROI/2011-06}ROI ).

Element '{http://www.openmicroscopy.org/Schemas/OME/2011-06}OME', attribute 'Creator': The attribute 'Creator' is not allowed.

The showinf script in bf tools when used with the -omexml parameter claims to perform validation but never fails, even when the xml is invalid, so cannot be trusted.

The xmlvalid script always reports "Parsing schema path
No schema path found. Validation cannot continue." - even in cases when the online validator succeeds.

What's the recommended way to validate single files?
What's the recommended way to validate whole-plate sets of files with one image per tiff?

Thanks in advance.

Sample data follows (note I couldn't attach a file to this post with the extension .xml, .sample or .txt so I gave up:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<!-- Warning: this comment is an OME-XML metadata block, which contains crucial
dimensional parameters and other important metadata. Please edit cautiously (if
at all), and back up the original data before doing so. For more information,
see the OME-Tiff web site: http://ome-xml.org/wiki/OmeTiff. -->

<ome:OME xmlns:spw="http://www.openmicroscopy.org/Schemas/SPW/2011-06"
         xmlns:ome="http://www.openmicroscopy.org/Schemas/OME/2011-06"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2011-06 http://www.openmicroscopy.org/Schemas/OME/2011-06/ome.xsd"
         Creator="TTP Labtech Ltd., Cellista, V4.1.0.52380"
         UUID="urn:uuid:4e5e8fbf-fd13-4c92-826c-187e8c6da835 ">

  <ome:Instrument ID="Instrument:0">
    <ome:Detector ID="Detector:MB_Simulated"
                  Model="Mirrorball"
                  SerialNumber="MB_Simulated"
                  Type="PMT" />
  </ome:Instrument>

  <ome:Experimenter ID="Experimenter:TTPGROUP\simon.carter:S-1-5-21-1547161642-854245398-682003330"
                    DisplayName="simon.carter" />

  <spw:Plate ID="Plate:onewelltiff.1:52d2a1d0-ff36-4f1d-957c-2d3eb9873b81"
       ColumnNamingConvention="number"
       RowNamingConvention="letter"
       Name="onewelltiff.1"
       Rows="16"
       Columns="24">
    <spw:Description>Matrical 384 (0.17mm glass, square),MGB101-1-2-LG</spw:Description>
    <spw:Well ID="Well:A1"
              Column="0"
              Row="0" />
  </spw:Plate>

  <ome:Image ID="Image:0"
       Name="./onewelltiff.1.A1.FL-1 (488-540 nm).tif">

    <ome:AcquiredDate>2012-05-17T07:52:28.5112652Z</ome:AcquiredDate>

    <ome:Pixels  ID="Pixels:0"
                 DimensionOrder="XYZCT"
                 Type="uint8"
                 SizeX="1000"
                 SizeY="1001"
                 SizeZ="1"
                 SizeC="1"
                 SizeT="1"
                 PhysicalSizeX="4"
                 PhysicalSizeY="4">

      <ome:Channel AcquisitionMode="WideField"
                   ID="Channel:1"
                   Name="FL-1"
                   IlluminationType="Epifluorescence"
                   EmissionWavelength="514"
                   ContrastMethod="Fluorescence"
                   Color="754909439">
        <ome:DetectorSettings ID="Detector:MB_Simulated"
                              Voltage="500" />
      </ome:Channel>

      <ome:TiffData FirstC="0"
                    FirstT="0"
                    FirstZ="0"
                    IFD="0"
                    PlaneCount="1">
        <ome:UUID FileName="./onewelltiff.1.A1.FL-1 (488-540 nm).tif">urn:uuid:4e5e8fbf-fd13-4c92-826c-187e8c6da835</ome:UUID>
      </ome:TiffData>

    </ome:Pixels>

  </ome:Image>

</ome:OME>


edit: sample xml corrected, but I still have the same problems.

Re: Validating xml in ome-tiff files

PostPosted: Thu May 17, 2012 8:11 am
by Simon Carter
I'll answer part of my own question in case anyone else stumbles across this..

I've found http://www.validome.org/xml/validate/ to be the most reliable and useful validator so far. One of my problems was that the child elements of the OME element must be in order - they are specified as an xsd:sequence, which is not clear from the documentation at http://git.openmicroscopy.org/src/devel ... 6/ome.html.

The online validator still reports "Element '{http://www.openmicroscopy.org/Schemas/OME/2011-06}OME', attribute 'Creator': The attribute 'Creator' is not allowed" but the validome validator is happy so I'll ignore that for now.

Re: Validating xml in ome-tiff files

PostPosted: Tue May 22, 2012 12:42 pm
by ajpatterson
Hello Simon,

A two part answer:
* You are correct in your solution. All of the elements are ordered, they need there child elements to appear in the order defined.
* You have found a bug in the online validator, it is not recognising the creator attribute on an OME node. I have added a link to this post to the current ticket to update the validator for our next release. http://trac.openmicroscopy.org.uk/ome/ticket/8640

I will check the command line method you mention and see what is up.

Let me know if you have any other problems,

Andrew

Re: Validating xml in ome-tiff files

PostPosted: Tue May 22, 2012 1:06 pm
by Simon Carter
Thank you - any suggestions for the third part?

What's the recommended way to validate whole-plate sets of files with one image per tiff?