Class LMSMetadataExtractor
java.lang.Object
loci.formats.in.LeicaMicrosystemsMetadata.LMSMetadataExtractor
This class extracts metadata information from Leica Microsystems image XML and stores it in the reader's CoreMetadata and MetadataTempBuffer
- Author:
- Melissa Linkert melissa at glencoesoftware.com, Constanze Wendlandt constanze.wendlandt at leica-microsystems.com
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intprivate static final longprivate LMSFileReader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddUserCommentMeta(Element imageNode, int image) Extracts user comments and adds them to the reader'sCoreMetadataprivate NodeListstatic intgetChannelIndex(Element filterSetting) private intgetChannelPriority(String lutName) private NodeListprivate ElementgetImageDescription(Element root) private NodeListReturns all (grand*n)children nodes with given node namedoubleparseDouble(String value) intlongprivate voidpopulateOriginalMetadata(Element root, Deque<String> nameStack) Creates key value pairs from attributes of the root's child nodes (tag | attribute name : attribute value) and adds them to reader'sCoreMetadataprivate voidsetCoreDimensionSizes(int coreIndex) Writes extracted dimension sizes to CoreMetadataprivate voidsetPixelType(int coreIndex) Sets CoreMetadata.pixelType depending on extracted x bytesIncvoidtranslateAttachmentNodes(Element imageNode, int image) Extracts information from dimension descriptions and writes it to reader'sMetadataTempBuffervoidtranslateChannelDescriptions(Element imageNode, int coreIndex) Extracts i.a.voidtranslateDetectors(Element imageNode, int image) Extracts detector information and writes it to reader'sMetadataTempBufferprivate voidtranslateDimensionDescriptions(Element imageNode, int coreIndex) Extracts information from dimension descriptions and writes it to reader'sCoreMetadataandMetadataTempBuffervoidtranslateFilterSettings(Element imageNode, int image) Extracts filter information and writes it to reader'sMetadataTempBuffervoidtranslateImage(Element image, int i) Extracts information from element node and writes it to reader'sCoreMetadataandMetadataTempBuffervoidtranslateLaserLines(Element imageNode, int image) Extracts laser information and writes it to reader'sMetadataTempBufferprivate ome.xml.model.primitives.ColortranslateLut(String lutName) Translates Leica XML lut name / value to Colorprivate voidtranslateLuts(List<String> luts, int imgIndex) Translates raw channel luts of an image to Colors and writes it to reader'sMetadataTempBuffervoidExtracts all information from Leica image xml Documents and writes it to reader'sCoreMetadataandMetadataTempBuffervoidtranslateROIs(Element imageNode, int image) Extracts ROIs and writes them to reader'sMetadataTempBuffervoidtranslateScannerSettings(Element imageNode, int image) Extracts scanner information and writes it to reader'sCoreMetadataandMetadataTempBuffervoidtranslateSingleROIs(Element imageNode, int image) Extracts single ROIs and writes them to reader'sMetadataTempBufferprivate doubletranslateSingleTimestamp(String timestamp) Translates hex timestamp string to double valueprivate doubletranslateSingleTimestamp(Element timestamp) Translates the content of a timestamp node to double valuevoidtranslateTimestamps(Element imageNode, int image) Extracts timestamps and writes them to reader'sMetadataTempBuffer
-
Field Details
-
METER_MULTIPLY
private static final long METER_MULTIPLY- See Also:
-
r
-
channelBytesIncs
-
extras
int extras
-
-
Constructor Details
-
LMSMetadataExtractor
-
-
Method Details
-
translateMetadata
Extracts all information from Leica image xml Documents and writes it to reader'sCoreMetadataandMetadataTempBuffer- Parameters:
docs- list of Leica xml documents- Throws:
FormatExceptionIOException
-
translateImage
Extracts information from element node and writes it to reader'sCoreMetadataandMetadataTempBuffer- Parameters:
image- node with tag name "element" from Leica XMLi- image /core index- Throws:
FormatException
-
translateChannelDescriptions
Extracts i.a. channel number and luts from channel descriptions and writes it to reader'sCoreMetadataandMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlcoreIndex-- Throws:
FormatException
-
translateLuts
Translates raw channel luts of an image to Colors and writes it to reader'sMetadataTempBuffer- Parameters:
luts- list of raw lut names / values from Leica XML
-
getChannelPriority
-
translateLut
Translates Leica XML lut name / value to Color- Parameters:
lutName-- Returns:
-
translateDimensionDescriptions
private void translateDimensionDescriptions(Element imageNode, int coreIndex) throws FormatException Extracts information from dimension descriptions and writes it to reader'sCoreMetadataandMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlcoreIndex-- Throws:
FormatException
-
setCoreDimensionSizes
private void setCoreDimensionSizes(int coreIndex) Writes extracted dimension sizes to CoreMetadata- Parameters:
coreIndex-
-
setPixelType
Sets CoreMetadata.pixelType depending on extracted x bytesInc- Parameters:
coreIndex-- Throws:
FormatException
-
translateAttachmentNodes
Extracts information from dimension descriptions and writes it to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateScannerSettings
Extracts scanner information and writes it to reader'sCoreMetadataandMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateFilterSettings
Extracts filter information and writes it to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateTimestamps
Extracts timestamps and writes them to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateLaserLines
Extracts laser information and writes it to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateROIs
Extracts ROIs and writes them to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateSingleROIs
Extracts single ROIs and writes them to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateDetectors
Extracts detector information and writes it to reader'sMetadataTempBuffer- Parameters:
imageNode- Image node from Leica xmlimage- image / core index- Throws:
FormatException
-
translateSingleTimestamp
Translates hex timestamp string to double value- Parameters:
timestamp- timestamp in format- Returns:
- number of seconds
-
translateSingleTimestamp
Translates the content of a timestamp node to double value- Parameters:
timestamp- timestamp node- Throws:
FormatException
-
addUserCommentMeta
Extracts user comments and adds them to the reader'sCoreMetadata- Parameters:
imageNode-image-- Throws:
FormatException
-
populateOriginalMetadata
Creates key value pairs from attributes of the root's child nodes (tag | attribute name : attribute value) and adds them to reader'sCoreMetadata- Parameters:
root- xml nodenameStack- list of node names to be prepended to key name
-
parseLong
-
parseInt
-
parseDouble
-
getImageDescription
-
getChannelDescriptionNodes
-
getDimensionDescriptionNodes
-
getNodes
Returns all (grand*n)children nodes with given node name- Parameters:
root- root nodenodeName- name of children that shall be searched- Returns:
- list of child nodes with given name
-
getChannelIndex
-