loci.formats.in

## Class ND2Handler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - loci.common.xml.BaseHandler
    - - loci.formats.in.ND2Handler

- All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

      public class ND2Handler
      extends loci.common.xml.BaseHandler

  DefaultHandler implementation for handling XML produced by Nikon Elements.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.util.ArrayList<java.lang.String>` | `binning`
    `private java.lang.String` | `cameraModel`
    `private boolean` | `canAdjustDimensions`
    `private java.util.ArrayList<java.lang.String>` | `channelNames`
    `private java.util.Hashtable<java.lang.String,java.lang.Integer>` | `colors`
    `private CoreMetadataList` | `core`
    `private java.lang.String` | `correction`
    `private java.lang.String` | `date`
    `private static java.lang.String` | `DATE_FORMAT`
    `private java.util.Hashtable<java.lang.String,java.lang.String>` | `dyes`
    `private java.util.ArrayList<java.lang.Double>` | `emWave`
    `private java.util.ArrayList<java.lang.Double>` | `exposureTime`
    `private java.util.ArrayList<java.lang.Double>` | `exWave`
    `private static int` | `FIELD_INDEX`
    `private boolean` | `firstTimeLoop`
    `private java.util.ArrayList<java.lang.Double>` | `gain`
    `boolean` | `imageMetadataLVExists`
    `private java.lang.String` | `immersion`
    `private boolean` | `isLossless`
    `private static org.slf4j.Logger` | `LOGGER`
    `private java.lang.Double` | `mag`
    `private java.util.Hashtable<java.lang.String,java.lang.Object>` | `metadata`
    `private java.util.ArrayList<java.lang.String>` | `modality`
    `private java.lang.Double` | `na`
    `private int` | `nImages`
    `private int` | `numSeries`
    `private int` | `nXFields`
    `private int` | `nYFields`
    `private java.lang.String` | `objectiveModel`
    `private java.lang.Double` | `pinholeSize`
    `private double` | `pixelSizeX`
    `private double` | `pixelSizeY`
    `private double` | `pixelSizeZ`
    `private boolean` | `populateXY`
    `private java.util.ArrayList<java.lang.String>` | `posNames`
    `private java.util.ArrayList<ome.units.quantity.Length>` | `posX`
    `private java.util.ArrayList<ome.units.quantity.Length>` | `posY`
    `private java.util.ArrayList<ome.units.quantity.Length>` | `posZ`
    `private java.util.ArrayList<java.lang.Integer>` | `power`
    `private java.lang.String` | `prefix`
    `private java.lang.String` | `prevElement`
    `private java.lang.String` | `prevRuntype`
    `private java.util.Hashtable<java.lang.String,java.lang.Integer>` | `realColors`
    `private java.lang.Double` | `refractiveIndex`
    `private java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.String>>` | `rois`
    `private java.util.ArrayList<java.lang.Double>` | `speed`
    `private java.util.ArrayList<java.lang.Double>` | `temperature`
    `private java.util.ArrayList<java.lang.Long>` | `ts`
    `private java.util.ArrayList<java.lang.Boolean>` | `validLoopState`
    `private java.lang.Double` | `voltage`
    `private java.util.ArrayList<java.lang.Long>` | `zs`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ND2Handler(CoreMetadataList core, boolean populateXY, int nImages)`
    `ND2Handler(CoreMetadataList core, int nImages)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endDocument()`
    `void` | `endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)`
    `java.util.ArrayList<java.lang.String>` | `getBinnings()`
    `java.lang.String` | `getCameraModel()`
    `java.util.Hashtable<java.lang.String,java.lang.Integer>` | `getChannelColors()`
    `java.util.ArrayList<java.lang.String>` | `getChannelNames()`
    `CoreMetadataList` | `getCoreMetadataList()`
    `java.lang.String` | `getCorrection()`
    `java.lang.String` | `getDate()`
    `java.util.ArrayList<java.lang.Double>` | `getEmissionWavelengths()`
    `java.util.ArrayList<java.lang.Double>` | `getExcitationWavelengths()`
    `java.util.ArrayList<java.lang.Double>` | `getExposureTimes()`
    `int` | `getFieldIndex()`
    `java.util.ArrayList<java.lang.Double>` | `getGains()`
    `java.lang.String` | `getImmersion()`
    `java.lang.Double` | `getMagnification()`
    `java.util.Hashtable<java.lang.String,java.lang.Object>` | `getMetadata()`
    `java.util.ArrayList<java.lang.String>` | `getModalities()`
    `java.lang.Double` | `getNumericalAperture()`
    `java.lang.String` | `getObjectiveModel()`
    `java.lang.Double` | `getPinholeSize()`
    `double` | `getPixelSizeX()`
    `double` | `getPixelSizeY()`
    `double` | `getPixelSizeZ()`
    `java.util.ArrayList<java.lang.String>` | `getPositionNames()`
    `java.util.ArrayList<java.lang.Integer>` | `getPowers()`
    `java.lang.Double` | `getRefractiveIndex()`
    `java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.String>>` | `getROIs()`
    `int` | `getSeriesCount()`
    `java.util.ArrayList<java.lang.Double>` | `getSpeeds()`
    `java.util.ArrayList<java.lang.Double>` | `getTemperatures()`
    `java.util.ArrayList<java.lang.Long>` | `getTimepoints()`
    `java.lang.Double` | `getVoltage()`
    `int` | `getXFields()`
    `java.util.ArrayList<ome.units.quantity.Length>` | `getXPositions()`
    `java.util.ArrayList<ome.units.quantity.Length>` | `getYPositions()`
    `java.util.ArrayList<ome.units.quantity.Length>` | `getZPositions()`
    `java.util.ArrayList<java.lang.Long>` | `getZSections()`
    `boolean` | `isDimensions(java.lang.String key)` Returns whether or not the specified key is denotes dimensions.
    `boolean` | `isLossless()`
    `void` | `parseKeyAndValue(java.lang.String key, java.lang.String value, java.lang.String runtype)`
    `private java.lang.Double` | `parsePixelsSizeZFromKey(java.lang.String key)` Parses the physical size from a key.
    `void` | `populateROIs(MetadataStore store)`
    `void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)`

    - ### Methods inherited from class loci.common.xml.BaseHandler

      `resolveEntity`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `characters, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

    - #### DATE_FORMAT

          private static final java.lang.String DATE_FORMAT

      See Also:
        Constant Field Values

    - #### FIELD_INDEX

          private static final int FIELD_INDEX

      See Also:
        Constant Field Values

    - #### prefix

          private java.lang.String prefix

    - #### prevRuntype

          private java.lang.String prevRuntype

    - #### prevElement

          private java.lang.String prevElement

    - #### metadata

          private java.util.Hashtable<java.lang.String,java.lang.Object> metadata

    - #### core

          private CoreMetadataList core

    - #### isLossless

          private boolean isLossless

    - #### zs

          private java.util.ArrayList<java.lang.Long> zs

    - #### ts

          private java.util.ArrayList<java.lang.Long> ts

    - #### numSeries

          private int numSeries

    - #### pixelSizeX

          private double pixelSizeX

    - #### pixelSizeY

          private double pixelSizeY

    - #### pixelSizeZ

          private double pixelSizeZ

    - #### pinholeSize

          private java.lang.Double pinholeSize

    - #### voltage

          private java.lang.Double voltage

    - #### mag

          private java.lang.Double mag

    - #### na

          private java.lang.Double na

    - #### objectiveModel

          private java.lang.String objectiveModel

    - #### immersion

          private java.lang.String immersion

    - #### correction

          private java.lang.String correction

    - #### refractiveIndex

          private java.lang.Double refractiveIndex

    - #### channelNames

          private java.util.ArrayList<java.lang.String> channelNames

    - #### modality

          private java.util.ArrayList<java.lang.String> modality

    - #### binning

          private java.util.ArrayList<java.lang.String> binning

    - #### speed

          private java.util.ArrayList<java.lang.Double> speed

    - #### gain

          private java.util.ArrayList<java.lang.Double> gain

    - #### temperature

          private java.util.ArrayList<java.lang.Double> temperature

    - #### exposureTime

          private java.util.ArrayList<java.lang.Double> exposureTime

    - #### exWave

          private java.util.ArrayList<java.lang.Double> exWave

    - #### emWave

          private java.util.ArrayList<java.lang.Double> emWave

    - #### power

          private java.util.ArrayList<java.lang.Integer> power

    - #### rois

          private java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.String>> rois

    - #### posX

          private java.util.ArrayList<ome.units.quantity.Length> posX

    - #### posY

          private java.util.ArrayList<ome.units.quantity.Length> posY

    - #### posZ

          private java.util.ArrayList<ome.units.quantity.Length> posZ

    - #### posNames

          private java.util.ArrayList<java.lang.String> posNames

    - #### cameraModel

          private java.lang.String cameraModel

    - #### date

          private java.lang.String date

    - #### colors

          private java.util.Hashtable<java.lang.String,java.lang.Integer> colors

    - #### dyes

          private java.util.Hashtable<java.lang.String,java.lang.String> dyes

    - #### realColors

          private java.util.Hashtable<java.lang.String,java.lang.Integer> realColors

    - #### nXFields

          private int nXFields

    - #### nYFields

          private int nYFields

    - #### populateXY

          private boolean populateXY

    - #### nImages

          private int nImages

    - #### validLoopState

          private java.util.ArrayList<java.lang.Boolean> validLoopState

    - #### canAdjustDimensions

          private boolean canAdjustDimensions

    - #### firstTimeLoop

          private boolean firstTimeLoop

    - #### imageMetadataLVExists

          public boolean imageMetadataLVExists

  - ### Constructor Detail

    - #### ND2Handler

          public ND2Handler(CoreMetadataList core,
                            int nImages)

    - #### ND2Handler

          public ND2Handler(CoreMetadataList core,
                            boolean populateXY,
                            int nImages)

  - ### Method Detail

    - #### getXFields

          public int getXFields()

    - #### getCoreMetadataList

          public CoreMetadataList getCoreMetadataList()

    - #### populateROIs

          public void populateROIs(MetadataStore store)

    - #### getDate

          public java.lang.String getDate()

    - #### getMetadata

          public java.util.Hashtable<java.lang.String,java.lang.Object> getMetadata()

    - #### getSeriesCount

          public int getSeriesCount()

    - #### isLossless

          public boolean isLossless()

    - #### getZSections

          public java.util.ArrayList<java.lang.Long> getZSections()

    - #### getTimepoints

          public java.util.ArrayList<java.lang.Long> getTimepoints()

    - #### getPixelSizeX

          public double getPixelSizeX()

    - #### getPixelSizeY

          public double getPixelSizeY()

    - #### getPixelSizeZ

          public double getPixelSizeZ()

    - #### getPinholeSize

          public java.lang.Double getPinholeSize()

    - #### getVoltage

          public java.lang.Double getVoltage()

    - #### getMagnification

          public java.lang.Double getMagnification()

    - #### getNumericalAperture

          public java.lang.Double getNumericalAperture()

    - #### getObjectiveModel

          public java.lang.String getObjectiveModel()

    - #### getImmersion

          public java.lang.String getImmersion()

    - #### getCorrection

          public java.lang.String getCorrection()

    - #### getRefractiveIndex

          public java.lang.Double getRefractiveIndex()

    - #### getChannelNames

          public java.util.ArrayList<java.lang.String> getChannelNames()

    - #### getModalities

          public java.util.ArrayList<java.lang.String> getModalities()

    - #### getBinnings

          public java.util.ArrayList<java.lang.String> getBinnings()

    - #### getSpeeds

          public java.util.ArrayList<java.lang.Double> getSpeeds()

    - #### getGains

          public java.util.ArrayList<java.lang.Double> getGains()

    - #### getTemperatures

          public java.util.ArrayList<java.lang.Double> getTemperatures()

    - #### getExposureTimes

          public java.util.ArrayList<java.lang.Double> getExposureTimes()

    - #### getExcitationWavelengths

          public java.util.ArrayList<java.lang.Double> getExcitationWavelengths()

    - #### getEmissionWavelengths

          public java.util.ArrayList<java.lang.Double> getEmissionWavelengths()

    - #### getPowers

          public java.util.ArrayList<java.lang.Integer> getPowers()

    - #### getROIs

          public java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.String>> getROIs()

    - #### getXPositions

          public java.util.ArrayList<ome.units.quantity.Length> getXPositions()

    - #### getYPositions

          public java.util.ArrayList<ome.units.quantity.Length> getYPositions()

    - #### getZPositions

          public java.util.ArrayList<ome.units.quantity.Length> getZPositions()

    - #### getPositionNames

          public java.util.ArrayList<java.lang.String> getPositionNames()

    - #### getCameraModel

          public java.lang.String getCameraModel()

    - #### getFieldIndex

          public int getFieldIndex()

    - #### getChannelColors

          public java.util.Hashtable<java.lang.String,java.lang.Integer> getChannelColors()

    - #### endElement

          public void endElement(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes attributes)

    - #### startElement

          public void startElement(java.lang.String uri,
                                   java.lang.String localName,
                                   java.lang.String qName,
                                   org.xml.sax.Attributes attributes)

      Specified by:
        `startElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startElement` in class `org.xml.sax.helpers.DefaultHandler`

    - #### endDocument

          public void endDocument()

      Specified by:
        `endDocument` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endDocument` in class `org.xml.sax.helpers.DefaultHandler`

    - #### parseKeyAndValue

          public void parseKeyAndValue(java.lang.String key,
                                       java.lang.String value,
                                       java.lang.String runtype)

    - #### isDimensions

          public boolean isDimensions(java.lang.String key)

      Returns whether or not the specified key is denotes dimensions. Full versions of Elements allow the user to choose a language, though it's not clear what all of the choices are. Most keys are always recorded in English, but some are recorded in the language specified by the user.

    - #### parsePixelsSizeZFromKey

          private java.lang.Double parsePixelsSizeZFromKey(java.lang.String key)

      Parses the physical size from a key. The expected format for the key is "- Step ".

Copyright © 2026 Open Microscopy Environment