Class ResolutionAsXML

Object
ResolutionAsXML

public class ResolutionAsXML extends Object
Reads and writes a metadata XML file specifying the image-resolution.

If a particular dimension is missing from the XML file, 1 is supplied as a replacement value.

The XML file specifies the physical pixel sizes (in meters) of an individual voxel, as follows:

<metadata><resolution><width>0.12</width><height>0.12</height><depth>0.12</depth></resolution></metadata>

Author:
Owen Feehan
  • Method Details

    • readResolutionXml

      public static Resolution readResolutionXml(File file) throws ImageIOException
      Retrieves resolution from a XML file previously written by writeResolutionXML(Resolution, Path).
      Parameters:
      file - the file to open
      Returns:
      a resolution read from the file
      Throws:
      ImageIOException - if file I/O or parsing errors occur.
    • writeResolutionXML

      public static void writeResolutionXML(Resolution resolution, Path path) throws ImageIOException
      Writes a XML metadata file describing the image-resolution.
      Parameters:
      resolution - the resolution to write
      path - path to write to
      Throws:
      ImageIOException - if any file I/O or parser errors occur