public class ScalarImage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double[][][] |
data |
Constructor and Description |
---|
ScalarImage(double[][][] data,
double[] voxelDims)
Construct an image, default interpolation is nearest neighbour.
|
ScalarImage(java.lang.String fileNameRoot)
Construct an image from an Analyze or NIFTI file.
|
ScalarImage(java.lang.String fileNameRoot,
int index)
Construct an image from one component of a NIFTI file, default
interpolation is nearest neighbour.
|
Modifier and Type | Method and Description |
---|---|
double[] |
derivAt(Point3D p) |
int[] |
getDataDims() |
double[] |
getVoxelDims() |
void |
setInterpolation(java.lang.String interpMethod)
Sets the interpolation method for this image.
|
double |
valueAt(Point3D p)
If the point is outside the image array, the function returns
zero.
|
double[] |
valuesAt(Point3D[] points) |
double[] |
valuesAt(Voxel[] voxels) |
void |
writeAnalyze(java.lang.String fileNameRoot)
Write the image in analyze format.
|
public ScalarImage(double[][][] data, double[] voxelDims)
dataDims
- image dimensions.voxelDims
- voxel dimensions, in mm.public ScalarImage(java.lang.String fileNameRoot) throws java.io.IOException
fileNameRoot
- File name without .img or .hdr extension.java.io.IOException
public ScalarImage(java.lang.String fileNameRoot, int index) throws java.io.IOException
fileNameRoot
- File name without .img or .hdr extension.index
- The index of the component volume to read.java.io.IOException
public double valueAt(Point3D p)
public double[] valuesAt(Point3D[] points)
public double[] valuesAt(Voxel[] voxels)
public double[] derivAt(Point3D p)
public void setInterpolation(java.lang.String interpMethod)
interpMethod
- either "nearestneighbour" or "linear" for nearest neighbor or linear interpolation
respectively.public int[] getDataDims()
public double[] getVoxelDims()
public void writeAnalyze(java.lang.String fileNameRoot) throws java.io.IOException
fileNameRoot
- the root of the filename for the output.
.hdr and .img will get added.java.io.IOException