|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xinapse.multisliceimage.PixArray
public abstract class PixArray
An abstract representation of an array of pixels of varying type. This Class is only of interest to developers wishing to sub-class MultiSliceImage. Users of the MultiSliceImage package should always access pixel values via the methods of MultiSliceImage.
| Field Summary | |
|---|---|
protected PixelDataType |
dataType
The type of pixel that this PixArray stores. |
| Method Summary | |
|---|---|
PixArray |
clone()
Returns a new PixArray object that contains pixel values and properties that are the same as the original. |
abstract int[] |
getHisto(int nbins)
Computes a histogram of this PixArray. |
static PixArray |
getInstance(PixelDataType dataType,
java.io.DataInputStream s,
java.nio.ByteOrder byteOrder,
int nDim,
int[] dims)
Creates one of the sub-classes of PixArray Object of the type specified by the dataType with pixel data coming from a DataInputStream. |
static PixArray |
getInstance(PixelDataType dataType,
int nDim,
int[] dims)
Creates one of the sub-classes of PixArray Object of the type specified by the pixel data type. |
static PixArray |
getInstance(PixelDataType dataType,
java.io.RandomAccessFile randomAccessFile,
java.nio.ByteOrder byteOrder,
int fileOffset,
int nDim,
int[] dims)
Creates one of the sub-classes of PixArray Object of the type specified by the dataType with pixel data coming from a RandomAccessFile. |
int[] |
getMinMax()
Finds the minimum and maximum values in this PixArray. |
abstract java.lang.Object |
getPutPix(java.lang.Object pix,
int[] pixIdx,
boolean get)
Gets/puts a single pixel value from/to an an image. |
abstract java.lang.Object |
getPutPix(java.lang.Object array,
int[] lowIdx,
int[] highIdx,
boolean get)
Basic pixel accessor method for images of any dimensionality. |
abstract java.lang.Object |
getPutSlice(java.lang.Object array,
int slice,
boolean get)
Returns a 1-Dimensional array of type appropriate of the image pixel type, cast as an Object, with array indices [0 to (nRows * nCols)-1], representing the pixel intensity values for one slice of this image. |
abstract long |
write(java.io.DataOutputStream s,
java.nio.ByteOrder byteOrder)
Writes this PixArray Object to a DataOutputStream. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PixelDataType dataType
| Method Detail |
|---|
public static final PixArray getInstance(PixelDataType dataType,
int nDim,
int[] dims)
throws MultiSliceImageException
dataType - a supported PixelDataType, one of:
nDim - the dimensionality of the PixArray.dims - the dimensions of the PixArray.
MultiSliceImageException - if the dataType is not supported.
public static final PixArray getInstance(PixelDataType dataType,
java.io.RandomAccessFile randomAccessFile,
java.nio.ByteOrder byteOrder,
int fileOffset,
int nDim,
int[] dims)
throws MultiSliceImageException
dataType - a supported PixelDataType, one of:
randomAccessFile - the RandomAccessFile from which the pixel data values will be derived.byteOrder - the ByteOrder of the data in the file.fileOffset - an offset (in bytes) from the start of the file, to the start of the pixel
data.nDim - the dimensionality of the PixArray.dims - the dimensions of the PixArray.
MultiSliceImageException - if the dataType is not supported,
or the pixel values cannot be derived from randomAccessFile.
public static final PixArray getInstance(PixelDataType dataType,
java.io.DataInputStream s,
java.nio.ByteOrder byteOrder,
int nDim,
int[] dims)
throws MultiSliceImageException
dataType - a supported PixelDataType, one of
s - the DataInputStream from which the pixel data values will be derived.byteOrder - the ByteOrder of the data in the input stream.nDim - the dimensionality of the PixArray.dims - the dimensions of the PixArray.
MultiSliceImageException - if the dataType not supported,
or the pixel values cannot be derived from s.
public abstract java.lang.Object getPutPix(java.lang.Object array,
int[] lowIdx,
int[] highIdx,
boolean get)
throws MultiSliceImageException
array - for get operations is an array to put pixels values in;
for put operations contains the pixel values to put.lowIdx - contains indexes to the lowest index of the
image pixel array that is required to be accessedhighIdx - contains indexes to the highest index of the
image pixel array that is required to be accessedget - true for get operations, false for put operations.
MultiSliceImageException - if the requested pixel values cannot be put or got,
or if the class of the array is incorrect for this type of image.
public abstract java.lang.Object getPutPix(java.lang.Object pix,
int[] pixIdx,
boolean get)
throws MultiSliceImageException
The class of pixel that nust be supplied (for put operations), or that
is returned (for get operations) is:
PixelDataType.BINARY images - java.lang.Boolean.
PixelDataType.UBYTE images - java.lang.Short.
PixelDataType.BYTE images - java.lang.Byte.
PixelDataType.RGB_INTERLACED images - java.awt.Color.
PixelDataType.RGB_BY_PLANE images - java.awt.Color.
PixelDataType.COLOURPACKED images - java.awt.Color.
PixelDataType.SHORT images - java.lang.Short.
PixelDataType.INT images - java.lang.Integer.
PixelDataType.FLOAT images - java.lang.Float.
PixelDataType.COMPLEX images - com.xinapse.multisliceimage.Complex.
PixelDataType.DOUBLE images - java.lang.Double.
pix - a pixel value for a put operation or null for a get operation.pixIdx - an array of length at least nDim with elements 0 to nDim-1
equal to the index in that image dimension.get - true for a gett operation and false for a put operation.
MultiSliceImageException - if the pixIdx is bad, or if the
class of the pixel is incorrect for this type of image.
public abstract java.lang.Object getPutSlice(java.lang.Object array,
int slice,
boolean get)
throws MultiSliceImageException
array - for get operations is an array to put pixels values in;
for put operations contains the pixel values to put.slice - the slice number.get - true for get operations, false for put operations.
MultiSliceImageException - if the requested pixel values cannot be put or got,
or if the class of the array is incorrect for this type of image.
public abstract long write(java.io.DataOutputStream s,
java.nio.ByteOrder byteOrder)
throws java.io.IOException
s - the DataOutputStream.byteOrder - the ByteOrder of the data in the output stream.
java.io.IOException - if the data cannot be written.
public int[] getMinMax()
throws MultiSliceImageException
For PixelDataType.BINARY, the values returned are always 0 and 1.
For RGB images (PixelDataType.RGB_INTERLACED, PixelDataType.RGB_BY_PLANE, PixelDataType.COLOURPACKED), the values returned are the miniumum and maximum luminance values, where the luminance is (0.299 * Red) + (0.587 * Green) + (0.114 * Blue).
For floating types (PixelDataType.FLOAT and PixelDataType.DOUBLE), the values returned are the integers that are the Math.floor() and Math.ceil() of the real min and max respectively.
For PixelDataType.COMPLEX, the values returned are the min and max magnitudes of the complex values.
MultiSliceImageException - if the min/max can't be computed for
the pixel data type, or if the intensity range in the pixels overflows that
which can be stored as an int.
public abstract int[] getHisto(int nbins)
throws MultiSliceImageException
nbins - the number of bins in the histogram.
MultiSliceImageException - if the histogram can't be computed.public PixArray clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||