BioFormats reading of Nikon Nd2

@NicoKiaru @dgault

How would one read the m_dXYPositionX0 metadata from an .nd2 file, using Java code?

Using the Bio-Formats FormatReader API there are 2 types of original metadata, global metadata such as the values you are looking, or series metadata (which will be prefixed with the series name).

Global metadata can be accessed as below:

    Hashtable<String, Object> meta = reader.getGlobalMetadata();
    String[] keys = MetadataTools.keys(meta);
    for (String key : keys) {
      LOGGER.info("{}: {}", key,  meta.get(key));
    }

Series metadata is very similar:

    Hashtable<String, Object> meta = reader.getSeriesMetadata();
    String[] keys = MetadataTools.keys(meta);
    for (int i=0; i<keys.length; i++) {
      LOGGER.info("{}: {}", keys[i], meta.get(keys[i]));
    }
3 Likes