public abstract class ImageHeader
extends java.lang.Object
Constructor and Description |
---|
ImageHeader() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkDims(java.lang.String hdrFile,
int[] dataDims,
double[] voxelDims)
Checks data and voxel dimensions from a header with those given in the arrays.
|
abstract int |
components()
Analyze : nImages
Meta : channels NIFTI-1 : DIM5 |
abstract int[] |
getDataDims() |
abstract DataSource |
getImageDataSource()
Gets the image data source, scaling applied if applicable.
|
RealMatrix |
getPhysicalToVoxelTransform()
Gets the transformation matrix R that is the inverse of the voxel to physical space transformation.
|
abstract double[] |
getVoxelDims()
Voxel dims may be negative for Analyze, use checkDims to get the absolute values.
|
abstract RealMatrix |
getVoxelToPhysicalTransform()
Gets the transformation matrix R that provides a transformation from a = (i, j, k, 1) in
voxel space to b = (x, y, z, 1) in physical space
|
static boolean |
imageExists(java.lang.String fileName) |
static ImageHeader |
readHeader(java.lang.String hdrFile)
Returns the appropriate header based on the given file name.
|
abstract double[][][] |
readVolume(int index)
Reads a 3D Analyze volume and returns the result as double.
|
abstract double[][][][] |
readVolumeData()
Gets all the data in the image.
|
abstract int |
xDataDim()
Analyze : width
MetaIO : DimSize[0] NIFTI-1 : XDIM |
abstract double |
xVoxelDim()
Analyze : pixelwidth
(may be negative). |
abstract int |
yDataDim()
Analyze : height
Meta : DimSize[1] NIFTI-1 : YDIM |
abstract double |
yVoxelDim()
Analyze : pixelheight
(may be negative). |
abstract int |
zDataDim()
Analyze : depth
Meta : DimSize[2] NIFTI-1 : ZDIM |
abstract double |
zVoxelDim()
Analyze : pixeldepth
(may be negative). |
public abstract int xDataDim()
public abstract int yDataDim()
public abstract int zDataDim()
public abstract int[] getDataDims()
public abstract double xVoxelDim()
public abstract double yVoxelDim()
public abstract double zVoxelDim()
public abstract double[] getVoxelDims()
public abstract int components()
public abstract RealMatrix getVoxelToPhysicalTransform()
public RealMatrix getPhysicalToVoxelTransform()
Assumes the transform is composed of a 3x3 invertible transform A, and a translation vector B. In the inverse, A' = A^{i-1} and B' = -A^{i-1}B.
public abstract DataSource getImageDataSource()
public abstract double[][][][] readVolumeData()
public abstract double[][][] readVolume(int index)
index
- the volume to read, indexed from 0.public static boolean imageExists(java.lang.String fileName)
fileName
- the full path to a file, including the extension (extension is optional for Analyze).public static ImageHeader readHeader(java.lang.String hdrFile) throws java.io.IOException
java.io.IOException
public static boolean checkDims(java.lang.String hdrFile, int[] dataDims, double[] voxelDims)
true
, otherwise it checks for consistency with the header and
returns false
if they are not consistent.