Class UShortPixArray
java.lang.Object
com.xinapse.image.PixArray
com.xinapse.image.ShortPixArray
com.xinapse.image.UShortPixArray
A representation of an array of unsigned short pixels, with intensity range 0..65535.
Note that all pixel values stored and accessed by this class are of the primitive type short.
It is up the user to convert these to unsigned before the pixel
values are used. This would typically be done using a statement like:
int i = (int) (pixel[i] & 0xFFFF).-
Field Summary
-
Method Summary
Methods inherited from class ShortPixArray
getPutPix, getPutSlice, writeMethods inherited from class PixArray
__getPix, copyPix, getInstance, getInstance, getMinMax, newInstance
-
Method Details
-
getHisto
Computes a histogram of a UShortPixArray.- Overrides:
getHistoin classShortPixArray- Parameters:
nbins- the number of bins in the histogram.- Returns:
- an int[] of length 2 where the first element is the number of pixels of value false and the second element is the number of pixels of value true.
- Throws:
InvalidImageException- if the histogram can't be computed.
-
getPutPix
Gets/puts a single pixel value from/to an an image. Returns a java Integer cast to Object corresponding to the picture primitve type. This represents the pixel intensity value for the pixel indexed by each element of pixIdx, and is returned as a Integer (rather than a Short) since a Short value does not have the dynamic range to represent an unsigned short value.- Overrides:
getPutPixin classShortPixArray- Parameters:
pix- a pixel value for a put operation or null for a get operation; if non-null, this must be a java.lang.Integer.pixIdx- an array of length at least nDim with elements 0 to nDim-1 equal to the index in that image dimension.op- the type of operation (GET or PUT).- Returns:
- a pixel value for a get operation or the supplied pixel for a put operation.
- Throws:
IllegalArgumentException- the class of the pix array is incorrect for this type of image.
-