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,
ExecutionTimeRecorder executionTimeRecorder)
Opens a file containing one or more images.
|
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, ExecutionTimeRecorder executionTimeRecorder) throws ImageIOException
StackReader
This method should run as computationally quicky as possible. Image voxels should not yet be read.
openFile
in class StackReader
path
- where the file is located.executionTimeRecorder
- records the execution-times of certain operations.ImageIOException
- if the file cannot be read.public StackReader getStackReader()
public void setStackReader(StackReader stackReader)
public boolean isAcceptNoResolution()
public void setAcceptNoResolution(boolean acceptNoResolution)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.