Class ReadVoxelExtentXml

Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.image.io.bean.stack.reader.StackReader>
org.anchoranalysis.image.io.bean.stack.reader.StackReader
org.anchoranalysis.plugin.io.bean.stack.reader.ReadVoxelExtentXml

public class ReadVoxelExtentXml
extends org.anchoranalysis.image.io.bean.stack.reader.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
    ReadVoxelExtentXml()  
  • Method Summary

    Modifier and Type Method Description
    org.anchoranalysis.image.io.bean.stack.reader.StackReader getStackReader()
    Reads an image before a resolution is imposed.
    boolean isAcceptNoResolution()
    If false, an exception is thrown if the resolution file is missing for a particular image.
    org.anchoranalysis.image.io.stack.input.OpenedImageFile openFile​(Path path, org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder)  
    static Optional<org.anchoranalysis.image.core.dimensions.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​(org.anchoranalysis.image.io.bean.stack.reader.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

  • Method Details

    • readMetadata

      public static Optional<org.anchoranalysis.image.core.dimensions.Resolution> readMetadata​(Path filePath, boolean acceptNoResolution) throws org.anchoranalysis.image.io.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:
      org.anchoranalysis.image.io.ImageIOException
    • openFile

      public org.anchoranalysis.image.io.stack.input.OpenedImageFile openFile​(Path path, org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder) throws org.anchoranalysis.image.io.ImageIOException
      Specified by:
      openFile in class org.anchoranalysis.image.io.bean.stack.reader.StackReader
      Throws:
      org.anchoranalysis.image.io.ImageIOException
    • getStackReader

      public org.anchoranalysis.image.io.bean.stack.reader.StackReader getStackReader()
      Reads an image before a resolution is imposed.
    • setStackReader

      public void setStackReader​(org.anchoranalysis.image.io.bean.stack.reader.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.