Package org.anchoranalysis.plugin.io.xml
Class ResolutionAsXML
Object
org.anchoranalysis.plugin.io.xml.ResolutionAsXML
public class ResolutionAsXML extends Object
Reads and writes a metadata XML file specifying the image-resolution.
If a particular dimension is missing from the XML file, 1 is supplied as a replacement value.
The XML file specifies the physical pixel sizes (in meters) of an individual voxel, as follows:
<metadata><resolution><width>0.12</width><height>0.12</height><depth>0.12</depth></resolution></metadata>
- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description static org.anchoranalysis.image.core.dimensions.ResolutionreadResolutionXml(File file)Retrieves resolution from a XML file previously written bywriteResolutionXML(Resolution, Path).static voidwriteResolutionXML(org.anchoranalysis.image.core.dimensions.Resolution resolution, Path path)Writes a XML metadata file describing the image-resolution.
-
Method Details
-
readResolutionXml
public static org.anchoranalysis.image.core.dimensions.Resolution readResolutionXml(File file) throws org.anchoranalysis.image.io.ImageIOExceptionRetrieves resolution from a XML file previously written bywriteResolutionXML(Resolution, Path).- Parameters:
file- the file to open- Returns:
- a resolution read from the file
- Throws:
org.anchoranalysis.image.io.ImageIOException- if file I/O or parsing errors occur.
-
writeResolutionXML
public static void writeResolutionXML(org.anchoranalysis.image.core.dimensions.Resolution resolution, Path path) throws org.anchoranalysis.image.io.ImageIOExceptionWrites a XML metadata file describing the image-resolution.- Parameters:
path- path to write toresolution- the resolution to write- Throws:
org.anchoranalysis.image.io.ImageIOException- if any file I/O or parser errors occur
-