Search in sources :

Example 1 with ValueTable

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

the class PrairieReader method populateOriginalMetadata.

/**
 * This steps populates the original metadata table (the tables returned by
 * {@link #getGlobalMetadata()} and {@link #getSeriesMetadata()}).
 */
private void populateOriginalMetadata() {
    final boolean minimumMetadata = isMinimumMetadata();
    if (minimumMetadata)
        return;
    // populate global metadata
    addGlobalMeta("cycleCount", meta.getCycleCount());
    addGlobalMeta("date", meta.getDate());
    addGlobalMeta("waitTime", meta.getWaitTime());
    addGlobalMeta("sequenceCount", sequences.size());
    final ValueTable config = meta.getConfig();
    for (final String key : config.keySet()) {
        addGlobalMeta(key, config.get(key).toString());
    }
    addGlobalMeta("meta", meta);
    // populate series metadata
    final int seriesCount = getSeriesCount();
    for (int s = 0; s < seriesCount; s++) {
        setSeries(s);
        final Sequence sequence = sequence(s);
        addSeriesMeta("cycle", sequence.getCycle());
        addSeriesMeta("indexCount", sequence.getIndexCount());
        addSeriesMeta("type", sequence.getType());
    }
    setSeries(0);
}
Also used : ValueTable(loci.formats.in.PrairieMetadata.ValueTable) Sequence(loci.formats.in.PrairieMetadata.Sequence)

Example 2 with ValueTable

use of loci.formats.in.PrairieMetadata.ValueTable 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 3 with ValueTable

use of loci.formats.in.PrairieMetadata.ValueTable 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

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