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);
}
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());
}
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());
}
Aggregations