public class RGB_ScalarImage
extends java.lang.Object
This class also serves as an image object for PD_OrientationViewer.
Modifier and Type | Field and Description |
---|---|
static int |
BUFFERSIZE |
Constructor and Description |
---|
RGB_ScalarImage(Vector3D[][][][] vecs,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar) |
Modifier and Type | Method and Description |
---|---|
double[] |
getVoxelDims() |
static RGB_ScalarImage |
imageFromBallStick(VoxelOrderDataSource data,
int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar)
Read image from Ball and stick input.
|
static RGB_ScalarImage |
imageFromCompartmentModel(int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar)
Read image from fitting a compartment model.
|
static RGB_ScalarImage |
imageFromPICoPDFs(VoxelOrderDataSource data,
int maxPDs,
int paramsPerPD,
int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar)
Read an image from PICoPDFs.
|
static RGB_ScalarImage |
imageFromPICoPDFs(VoxelOrderDataSource data,
int maxPDs,
int paramsPerPD,
int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar,
int eigIndex)
Read an image from PICoPDFs.
|
static RGB_ScalarImage |
imageFromSphFuncPDs(VoxelOrderDataSource data,
int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar)
Read image from ODF peak input.
|
static RGB_ScalarImage |
imageFromTensorEigenSys(VoxelOrderDataSource data,
int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar)
Read an image from tensor eigen system input.
|
static RGB_ScalarImage |
imageFromTensorEigenSys(VoxelOrderDataSource data,
int[] dataDims,
double[] voxelDims,
double[][][] scalars,
double minScalar,
double maxScalar,
int eigIndex)
Read an image from tensor eigen system input.
|
static void |
main(java.lang.String[] args) |
double |
rgbGamma() |
double |
scalarGamma() |
void |
setNormalizedScalars(double chop)
Sets scalar range from the range present in the data, after excluding outliers.
|
void |
setNormalizedScalars(double minScalar,
double maxScalar)
Sets scalar range between the specified minimum (maps to black) and maximum
(maps to white).
|
void |
setRGB_Gamma(double g)
Sets the gamma constant
g for the rgb component. |
void |
setScalarGamma(double g)
Sets the gamma constant
g for the scalar component. |
void |
writeImage(java.lang.String file)
Writes this image, determines output type from extension (either .mha, .mhd or .vtk).
|
void |
writeMeta(java.lang.String fileRoot)
Writes the RGB image in Meta I/O format.
|
void |
writeVTK(java.lang.String fileRoot)
Writes a VTK 2.0 (ie, not the new XML) file.
|
public static final int BUFFERSIZE
public RGB_ScalarImage(Vector3D[][][][] vecs, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar)
public void writeImage(java.lang.String file) throws java.io.IOException
java.io.IOException
public void writeMeta(java.lang.String fileRoot) throws java.io.IOException
java.io.IOException
public void writeVTK(java.lang.String fileRoot) throws java.io.IOException
java.io.IOException
public void setNormalizedScalars(double chop)
chop
- the fraction of voxels to exclude. The smallest and largest (chop * 100) % of
the scalar values will be mapped to black and white respectively.public void setNormalizedScalars(double minScalar, double maxScalar)
public static void main(java.lang.String[] args)
public static RGB_ScalarImage imageFromSphFuncPDs(VoxelOrderDataSource data, int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar)
scalars
- if null, then the Hessian trace of the first peak is used.public static RGB_ScalarImage imageFromPICoPDFs(VoxelOrderDataSource data, int maxPDs, int paramsPerPD, int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar)
maxPDs
- maximum number of PDs in the voxel. Only two will be displayed.paramsPerPD
- scalar PICo parameters per PD.scalars
- if null, then the sum of the concentration parameters is used.public static RGB_ScalarImage imageFromPICoPDFs(VoxelOrderDataSource data, int maxPDs, int paramsPerPD, int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar, int eigIndex)
maxPDs
- maximum number of PDs in the voxel. Only two will be displayed.paramsPerPD
- scalar PICo parameters per PD.scalars
- if null, then the sum of the concentration parameters is used.eigIndex
- which of the scatter matrix eigenvectors to use (0-2).public static RGB_ScalarImage imageFromBallStick(VoxelOrderDataSource data, int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar)
scalars
- if null, then the mixing fraction f is used.public static RGB_ScalarImage imageFromCompartmentModel(int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar)
if
- scalars is null, then the mixing fraction f is used.public static RGB_ScalarImage imageFromTensorEigenSys(VoxelOrderDataSource data, int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar)
scalars
- if null, then the FA of the tensor (or mean FA of the first two tensors)
is used.public static RGB_ScalarImage imageFromTensorEigenSys(VoxelOrderDataSource data, int[] dataDims, double[] voxelDims, double[][][] scalars, double minScalar, double maxScalar, int eigIndex)
scalars
- if null, then the FA of the tensor (or mean FA of the first two tensors)
is used.eigIndex
- public void setRGB_Gamma(double g)
g
for the rgb component. For each color channel c, the
image value is 255 * c^g, where c is between 0 and 1.
If g == 0.0
, the image is greyscale.public double rgbGamma()
public void setScalarGamma(double g)
g
for the scalar component. For each scalar value s, the
image value is 255 * s^g, where s is between 0 and 1.public double scalarGamma()
public double[] getVoxelDims()