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.StackReadergetStackReader()Reads an image before a resolution is imposed.booleanisAcceptNoResolution()If false, an exception is thrown if the resolution file is missing for a particular image.org.anchoranalysis.image.io.stack.input.OpenedImageFileopenFile(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 resolutionvoidsetAcceptNoResolution(boolean acceptNoResolution)If false, an exception is thrown if the resolution file is missing for a particular image.voidsetStackReader(org.anchoranalysis.image.io.bean.stack.reader.StackReader stackReader)Reads an image before a resolution is imposed.
-
Constructor Details
-
ReadVoxelExtentXml
public ReadVoxelExtentXml()
-
-
Method Details
-
readMetadata
public static Optional<org.anchoranalysis.image.core.dimensions.Resolution> readMetadata(Path filePath, boolean acceptNoResolution) throws org.anchoranalysis.image.io.ImageIOExceptionLooks for a metadata file describing the resolutionGiven 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 imageacceptNoResolution- 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:
openFilein classorg.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.
-