public class ReadVoxelExtentXml extends StackReader
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
.
Constructor and Description |
---|
ReadVoxelExtentXml() |
Modifier and Type | Method and Description |
---|---|
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.
|
OpenedImageFile |
openFile(Path path)
Opens a file containing one or more images but does not read an image.
|
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.
|
readStack
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public static Optional<Resolution> readMetadata(Path filePath, boolean acceptNoResolution) throws ImageIOException
Given an existing image filepath, the filePath.xml is checked e.g. given /somePath/stackReader.tif it will look for /somePath/RasterRader.tif.xml
filePath
- the filepath of the imageacceptNoResolution
- if false, an exception is thrown if the resolution file is missing
for a particular image.ImageIOException
public OpenedImageFile openFile(Path path) throws ImageIOException
StackReader
openFile
in class StackReader
path
- where the file is locatedImageIOException
- if the file cannot be read.public StackReader getStackReader()
public void setStackReader(StackReader stackReader)
public boolean isAcceptNoResolution()
public void setAcceptNoResolution(boolean acceptNoResolution)
Copyright © 2010–2021 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.