public class LMSMetadataExtractor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<java.lang.Long> |
channelBytesIncs |
(package private) int |
extras |
private static long |
METER_MULTIPLY |
private LMSFileReader |
r |
Constructor and Description |
---|
LMSMetadataExtractor(LMSFileReader reader) |
Modifier and Type | Method and Description |
---|---|
private void |
addUserCommentMeta(org.w3c.dom.Element imageNode,
int image)
Extracts user comments and adds them to the reader's
CoreMetadata |
private org.w3c.dom.NodeList |
getChannelDescriptionNodes(org.w3c.dom.Element root) |
static int |
getChannelIndex(org.w3c.dom.Element filterSetting) |
private int |
getChannelPriority(java.lang.String lutName) |
private org.w3c.dom.NodeList |
getDimensionDescriptionNodes(org.w3c.dom.Element root) |
private org.w3c.dom.Element |
getImageDescription(org.w3c.dom.Element root) |
private org.w3c.dom.NodeList |
getNodes(org.w3c.dom.Element root,
java.lang.String nodeName)
Returns all (grand*n)children nodes with given node name
|
double |
parseDouble(java.lang.String value) |
int |
parseInt(java.lang.String value) |
long |
parseLong(java.lang.String value) |
private void |
populateOriginalMetadata(org.w3c.dom.Element root,
java.util.Deque<java.lang.String> nameStack)
Creates key value pairs from attributes of the root's child nodes (tag | attribute name : attribute value) and adds them to reader's
CoreMetadata |
private void |
setCoreDimensionSizes(int coreIndex)
Writes extracted dimension sizes to CoreMetadata
|
private void |
setPixelType(int coreIndex)
Sets CoreMetadata.pixelType depending on extracted x bytesInc
|
void |
translateAttachmentNodes(org.w3c.dom.Element imageNode,
int image)
Extracts information from dimension descriptions and writes it to reader's
MetadataTempBuffer |
void |
translateChannelDescriptions(org.w3c.dom.Element imageNode,
int coreIndex)
Extracts i.a.
|
void |
translateDetectors(org.w3c.dom.Element imageNode,
int image)
Extracts detector information and writes it to reader's
MetadataTempBuffer |
private void |
translateDimensionDescriptions(org.w3c.dom.Element imageNode,
int coreIndex)
Extracts information from dimension descriptions and writes it to reader's
CoreMetadata and MetadataTempBuffer |
void |
translateFilterSettings(org.w3c.dom.Element imageNode,
int image)
Extracts filter information and writes it to reader's
MetadataTempBuffer |
void |
translateImage(org.w3c.dom.Element image,
int i)
Extracts information from element node and writes it to reader's
CoreMetadata and MetadataTempBuffer |
void |
translateLaserLines(org.w3c.dom.Element imageNode,
int image)
Extracts laser information and writes it to reader's
MetadataTempBuffer |
private ome.xml.model.primitives.Color |
translateLut(java.lang.String lutName)
Translates Leica XML lut name / value to Color
|
private void |
translateLuts(java.util.List<java.lang.String> luts,
int imgIndex)
Translates raw channel luts of an image to Colors and writes it to reader's
MetadataTempBuffer |
void |
translateMetadata(java.util.List<LMSImageXmlDocument> docs)
Extracts all information from Leica image xml Documents and writes it to reader's
CoreMetadata and MetadataTempBuffer |
void |
translateROIs(org.w3c.dom.Element imageNode,
int image)
Extracts ROIs and writes them to reader's
MetadataTempBuffer |
void |
translateScannerSettings(org.w3c.dom.Element imageNode,
int image)
Extracts scanner information and writes it to reader's
CoreMetadata and MetadataTempBuffer |
void |
translateSingleROIs(org.w3c.dom.Element imageNode,
int image)
Extracts single ROIs and writes them to reader's
MetadataTempBuffer |
private double |
translateSingleTimestamp(org.w3c.dom.Element timestamp)
Translates the content of a timestamp node to double value
|
private double |
translateSingleTimestamp(java.lang.String timestamp)
Translates hex timestamp string to double value
|
void |
translateTimestamps(org.w3c.dom.Element imageNode,
int image)
Extracts timestamps and writes them to reader's
MetadataTempBuffer |
private static final long METER_MULTIPLY
private LMSFileReader r
java.util.List<java.lang.Long> channelBytesIncs
int extras
public LMSMetadataExtractor(LMSFileReader reader)
public void translateMetadata(java.util.List<LMSImageXmlDocument> docs) throws FormatException, java.io.IOException
CoreMetadata
and MetadataTempBuffer
docs
- list of Leica xml documentsFormatException
java.io.IOException
public void translateImage(org.w3c.dom.Element image, int i) throws FormatException
CoreMetadata
and MetadataTempBuffer
img
- node with tag name "element" from Leica XMLi
- image /core indexFormatException
public void translateChannelDescriptions(org.w3c.dom.Element imageNode, int coreIndex) throws FormatException
CoreMetadata
and MetadataTempBuffer
imageNode
- Image node from Leica xmlcoreIndex
- FormatException
private void translateLuts(java.util.List<java.lang.String> luts, int imgIndex)
MetadataTempBuffer
luts
- list of raw lut names / values from Leica XMLprivate int getChannelPriority(java.lang.String lutName)
private ome.xml.model.primitives.Color translateLut(java.lang.String lutName)
lutName
- private void translateDimensionDescriptions(org.w3c.dom.Element imageNode, int coreIndex) throws FormatException
CoreMetadata
and MetadataTempBuffer
imageNode
- Image node from Leica xmlcoreIndex
- FormatException
private void setCoreDimensionSizes(int coreIndex)
coreIndex
- private void setPixelType(int coreIndex) throws FormatException
coreIndex
- FormatException
public void translateAttachmentNodes(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateScannerSettings(org.w3c.dom.Element imageNode, int image) throws FormatException
CoreMetadata
and MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateFilterSettings(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateTimestamps(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateLaserLines(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateROIs(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateSingleROIs(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
public void translateDetectors(org.w3c.dom.Element imageNode, int image) throws FormatException
MetadataTempBuffer
imageNode
- Image node from Leica xmlimage
- image / core indexFormatException
private double translateSingleTimestamp(java.lang.String timestamp)
timestamp
- timestamp in formatprivate double translateSingleTimestamp(org.w3c.dom.Element timestamp)
imageNode
- timestamp nodeimage
- image / core indexFormatException
private void addUserCommentMeta(org.w3c.dom.Element imageNode, int image) throws FormatException
CoreMetadata
imageNode
- image
- FormatException
private void populateOriginalMetadata(org.w3c.dom.Element root, java.util.Deque<java.lang.String> nameStack)
CoreMetadata
root
- xml nodenameStack
- list of node names to be prepended to key namepublic long parseLong(java.lang.String value)
public int parseInt(java.lang.String value)
public double parseDouble(java.lang.String value)
private org.w3c.dom.Element getImageDescription(org.w3c.dom.Element root)
private org.w3c.dom.NodeList getChannelDescriptionNodes(org.w3c.dom.Element root)
private org.w3c.dom.NodeList getDimensionDescriptionNodes(org.w3c.dom.Element root)
private org.w3c.dom.NodeList getNodes(org.w3c.dom.Element root, java.lang.String nodeName)
root
- root nodenodeName
- name of children that shall be searchedpublic static int getChannelIndex(org.w3c.dom.Element filterSetting)
Copyright © 2023 Open Microscopy Environment