Package loci.formats.in
Class PrairieMetadata
java.lang.Object
loci.formats.in.PrairieMetadata
Metadata structure for Prairie Technologies' TIFF-based format.
- Author:
- Curtis Rueden, Michael Fox
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA Prairie<Frame>, beneath a<Sequence>.classA Prairie<File>beneath a<Frame>.classA Prairie<Sequence>.static interfaceA value in a Prairie metadata dictionary.static classA leaf value with an actualPrairieMetadata.ValueItem.value()as well as an optionalPrairieMetadata.ValueItem.description().static classA table of values. -
Field Summary
FieldsModifier and TypeFieldDescriptionSet of active channel indices.private final PrairieMetadata.ValueTableKey/value pairs from CFG and/or ENV files.private intMaximum cycle value.private intMinimum cycle value.private StringThe date of the acquisition.private PrairieMetadata.SequenceThe first actual<Sequence>element.private final PrairieMetadata.ValueTableTable of key/value pairs at the top level.private final HashMap<Integer, PrairieMetadata.Sequence> <Sequence>elements, keyed on each sequence'scycle.private DoubleThe wait time of the acquisition. -
Constructor Summary
ConstructorsConstructorDescriptionPrairieMetadata(Document xml, Document cfg, Document env) Creates a new Prairie metadata by parsing the given XML, CFG and/or ENV documents. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringGets the attribute value with the given name, or null if not defined.private booleanConverts the given string to aboolean.private voidcheckElement(Element el, String name) Checks that the given element has the specified name.private DoubleConverts the given string to aDouble, ornullif incompatible.private ElementGets theindexth element from the given list of nodes.int[]Gets the list of active channel indices, in sorted order.Gets thebitDepthrecorded in the configuration.Gets the map of configuration key/value pairs.Gets thevalueof the given configurationkey.intGets the number of recorded cycles.intGets the maximum cycle value.intGets the minimum cycle value.getDate()Gets the date of the acquisition.getFile(int cycle, int index, int channel) Gets theFrameat the given (cycle,index,channel).private ElementgetFirstChild(Element el, String name) Gets the first child element with the given name.Gets the firstSequence.getFrame(int cycle, int index) Gets theFrameat the given (cycleandindex).Gets the firstlaserPowerrecorded in the configuration.getSequence(int cycle) Gets theSequenceat the givencycle.Gets allSequences, ordered bycycle.Gets thevalueof the givenkey, at the top-level<PVScan>element.Gets the table ofPVScankey/value pairs.Gets thewaitTimerecorded in the configuration.private IntegerConverts the given string to anInteger, or null if incompatible.booleanGets whether the stage position X coordinates are inverted (i.e., left-to-right).booleanGets whether the stage position Y coordinates are inverted (i.e., bottom-to-top).private voidParses metadata from Prairie CFG file.private voidParses details of the activated channels into theactiveChannelsdata structure from the "channel" entry of the configuration.private voidParses metadata from Prairie ENV file.private voidparseKeys(Element el, PrairieMetadata.ValueTable table) Parses<Key>elements beneath the given element, into the specified table.private voidparsePVStateShard(Element el, PrairieMetadata.ValueTable table) Parses the<PVStateShard>element beneath the given element, into the specified table.private voidParses metadata from Prairie XML file.private StringGets theith token of the given string, split according to the specific regular expression.private Stringvalue(PrairieMetadata.Value value) Returnsvalue.value(), or null ifvalueis null.private Stringvalue(PrairieMetadata.Value value, int index) Returnsvalue.get(index).value(), or null ifvalueorvalue.get(index)is null.private Stringvalue(PrairieMetadata.Value value, String key) Returnsvalue.get(key).value(), or null ifvalueorvalue.get(key)is null.private <K extends Comparable<? super K>,V>
ArrayList<V> valuesByKey(Map<K, V> map) Gets the values of the given map, sorted by key.
-
Field Details
-
sequences
<Sequence>elements, keyed on each sequence'scycle. -
scanValues
Table of key/value pairs at the top level. -
firstSequence
The first actual<Sequence>element. -
cycleMin
private int cycleMinMinimum cycle value. -
cycleMax
private int cycleMaxMaximum cycle value. -
date
The date of the acquisition. -
waitTime
The wait time of the acquisition. -
activeChannels
Set of active channel indices. -
config
Key/value pairs from CFG and/or ENV files.
-
-
Constructor Details
-
PrairieMetadata
Creates a new Prairie metadata by parsing the given XML, CFG and/or ENV documents.- Parameters:
xml- The XML document to parse, or null if none available.cfg- The CFG document to parse, or null if none available.env- The ENV document to parse, or null if none available.
-
-
Method Details
-
getWaitTime
Gets thewaitTimerecorded in the configuration. -
getActiveChannels
public int[] getActiveChannels()Gets the list of active channel indices, in sorted order.These indices correspond to the configuration's
channelkeys flagged asTrue. -
isInvertX
public boolean isInvertX()Gets whether the stage position X coordinates are inverted (i.e., left-to-right). -
isInvertY
public boolean isInvertY()Gets whether the stage position Y coordinates are inverted (i.e., bottom-to-top). -
getBitDepth
Gets thebitDepthrecorded in the configuration. -
getLaserPower
Gets the firstlaserPowerrecorded in the configuration. -
getConfig
Gets thevalueof the given configurationkey. -
getConfig
Gets the map of configuration key/value pairs. -
getDate
Gets the date of the acquisition. -
getCycleMin
public int getCycleMin()Gets the minimum cycle value. Matches the smallestcycleattribute found, and hence will not necessarily equal1(though in practice it usually does). -
getCycleMax
public int getCycleMax()Gets the maximum cycle value. Matches the largestcycleattribute found, and hence will not necessarily equalsequences#size()(though in practice it usually does). -
getCycleCount
public int getCycleCount()Gets the number of recorded cycles. This value is equal togetCycleMax()-getCycleMin()+ 1. -
getFirstSequence
Gets the firstSequence. -
getSequence
Gets theSequenceat the givencycle. -
getSequences
Gets allSequences, ordered bycycle. -
getFrame
Gets theFrameat the given (cycleandindex). -
getFile
Gets theFrameat the given (cycle,index,channel). -
getValue
Gets thevalueof the givenkey, at the top-level<PVScan>element. -
getValues
Gets the table ofPVScankey/value pairs. -
parseXML
Parses metadata from Prairie XML file. -
parseCFG
Parses metadata from Prairie CFG file. This file is only present for Prairie datasets recorded prior to version 5.2. -
parseENV
Parses metadata from Prairie ENV file. This file is only present for Prairie datasets recorded with version 5.2 or later. -
parseKeys
Parses<Key>elements beneath the given element, into the specified table. These<Key>elements are only present in data from PrairieView versions prior to 5.2. -
parsePVStateShard
Parses the<PVStateShard>element beneath the given element, into the specified table. These<PVStateShard>elements are only present in data from PrairieView versions 5.2 and later. -
parseChannels
private void parseChannels()Parses details of the activated channels into theactiveChannelsdata structure from the "channel" entry of the configuration. -
checkElement
Checks that the given element has the specified name.- Throws:
IllegalArgumentException- if the name does not match.
-
getFirstChild
Gets the first child element with the given name. -
el
Gets theindexth element from the given list of nodes. -
attr
Gets the attribute value with the given name, or null if not defined. -
value
Returnsvalue.value(), or null ifvalueis null. -
value
Returnsvalue.get(key).value(), or null ifvalueorvalue.get(key)is null. -
value
Returnsvalue.get(index).value(), or null ifvalueorvalue.get(index)is null. -
b
Converts the given string to aboolean. -
d
Converts the given string to aDouble, ornullif incompatible. -
i
Converts the given string to anInteger, or null if incompatible. -
token
Gets theith token of the given string, split according to the specific regular expression. -
valuesByKey
Gets the values of the given map, sorted by key.
-