Class ReadVoxelExtentXml

Object
AnchorBean<StackReader>
StackReader
ReadVoxelExtentXml

public class ReadVoxelExtentXml extends StackReader
Reads Resolution from an XML file associated an image.

Any existing Resolution is replaced.

The XML file is expected at the file path of the image, with .xml appended. e.g. someImage.tif would have metadata at someImage.tif.xml

The format of the XML is described in ResolutionAsXML.

Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    StackReader
    Reads an image before a resolution is imposed.
    boolean
    If false, an exception is thrown if the resolution file is missing for a particular image.
    OpenedImageFile
    openFile(Path path, ExecutionTimeRecorder executionTimeRecorder)
     
    static Optional<Resolution>
    readMetadata(Path filePath, boolean acceptNoResolution)
    Looks for a metadata file describing the resolution
    void
    setAcceptNoResolution(boolean acceptNoResolution)
    If false, an exception is thrown if the resolution file is missing for a particular image.
    void
    setStackReader(StackReader stackReader)
    Reads an image before a resolution is imposed.

    Methods inherited from class org.anchoranalysis.image.io.bean.stack.reader.StackReader

    readStack

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ReadVoxelExtentXml

      public ReadVoxelExtentXml()
  • Method Details

    • readMetadata

      public static Optional<Resolution> readMetadata(Path filePath, boolean acceptNoResolution) throws ImageIOException
      Looks for a metadata file describing the resolution

      Given an existing image filepath, the filePath.xml is checked e.g. given /somePath/stackReader.tif it will look for /somePath/RasterRader.tif.xml

      Parameters:
      filePath - the filepath of the image
      acceptNoResolution - if false, an exception is thrown if the resolution file is missing for a particular image.
      Returns:
      the scene res if the metadata file exists and was parsed. null otherwise.
      Throws:
      ImageIOException
    • openFile

      public OpenedImageFile openFile(Path path, ExecutionTimeRecorder executionTimeRecorder) throws ImageIOException
      Specified by:
      openFile in class StackReader
      Throws:
      ImageIOException
    • getStackReader

      public StackReader getStackReader()
      Reads an image before a resolution is imposed.
    • setStackReader

      public void setStackReader(StackReader stackReader)
      Reads an image before a resolution is imposed.
    • isAcceptNoResolution

      public boolean isAcceptNoResolution()
      If false, an exception is thrown if the resolution file is missing for a particular image.
    • setAcceptNoResolution

      public void setAcceptNoResolution(boolean acceptNoResolution)
      If false, an exception is thrown if the resolution file is missing for a particular image.