Search in sources :

Example 1 with PrairieMetadata

use of loci.formats.in.PrairieMetadata in project bioformats by openmicroscopy.

the class PrairieMetadataTest method testParseNewXML.

@Test
public void testParseNewXML() throws ParserConfigurationException, SAXException, IOException {
    final Document xml = XMLTools.parseDOM(NEW_XML);
    final PrairieMetadata meta = new PrairieMetadata(xml, null, null);
    final ValueTable positionCurrent = (ValueTable) meta.getSequence(1).getFrame(1).getValue("positionCurrent");
    final ValueTable xAxis = (ValueTable) positionCurrent.get("XAxis");
    assertEquals("-621.412879412341", xAxis.value());
    final ValueTable yAxis = (ValueTable) positionCurrent.get("YAxis");
    assertEquals("255.652372573538", yAxis.value());
    final ValueTable zAxis = (ValueTable) positionCurrent.get("ZAxis");
    assertEquals("28.15", zAxis.get(0).value());
    assertEquals("111.23", zAxis.get(1).value());
}
Also used : ValueTable(loci.formats.in.PrairieMetadata.ValueTable) PrairieMetadata(loci.formats.in.PrairieMetadata) Document(org.w3c.dom.Document) Test(org.testng.annotations.Test)

Example 2 with PrairieMetadata

use of loci.formats.in.PrairieMetadata in project bioformats by openmicroscopy.

the class PrairieMetadataTest method testParseOldXML.

@Test
public void testParseOldXML() throws ParserConfigurationException, SAXException, IOException {
    final Document xml = XMLTools.parseDOM(OLD_XML);
    final PrairieMetadata meta = new PrairieMetadata(xml, null, null);
    final Value positionCurrent = meta.getSequence(1).getFrame(1).getValue("positionCurrent");
    final Value xAxis = positionCurrent.get("XAxis");
    assertEquals("0.95", xAxis.value());
    final Value yAxis = positionCurrent.get("YAxis");
    assertEquals("-4.45", yAxis.value());
    final ValueTable zAxis = (ValueTable) positionCurrent.get("ZAxis");
    assertEquals("-9", zAxis.get(0).value());
    assertEquals("62.45", zAxis.get(1).value());
}
Also used : ValueTable(loci.formats.in.PrairieMetadata.ValueTable) PrairieMetadata(loci.formats.in.PrairieMetadata) Value(loci.formats.in.PrairieMetadata.Value) Document(org.w3c.dom.Document) Test(org.testng.annotations.Test)

Aggregations

PrairieMetadata (loci.formats.in.PrairieMetadata)2 ValueTable (loci.formats.in.PrairieMetadata.ValueTable)2 Test (org.testng.annotations.Test)2 Document (org.w3c.dom.Document)2 Value (loci.formats.in.PrairieMetadata.Value)1