Class ComplexPixArray


final class ComplexPixArray extends FloatPixArray
A representation of an array of complex (real, imaginary) 2-float pixels. Note that all pixel values handled by this class are of the primitive float class. However, it is up to the user to convert these to complex before the pixel values are used. This would typically be done using statements like:

for (int i = 0; i < nPixels; i++) {
float real = pixel[2*i];
float imag = pixel[2*i+1];
}
Floating point values that make up the complex pixels are ordered: real1, imag1, real2, imag2, real3, imag3, ... etc.
  • Method Details

    • getHisto

      public int[] getHisto(int nbins) throws InvalidImageException
      Computes a brightness histogram of a ComplexPixArray. A brighness value is computed by taking the magnitude of the complex number.
      Overrides:
      getHisto in class FloatPixArray
      Parameters:
      nbins - the number of bins in the histogram.
      Returns:
      an int[] of nbins the first element is the number of pixels with the minimum brightness, and the last element is the number of pixels with the brightness (minimum + nbins - 1).
      Throws:
      InvalidImageException - if the histogram can't be computed.
    • getPutPix

      public Object getPutPix(Object pix, int[] pixIdx, PixelOp op) throws IllegalArgumentException
      Description copied from class: FloatPixArray
      Gets/puts a single pixel value from/to an an image. Returns a java.lang.Float cast to Object corresponding to the picture primitve type. This represents the pixel intensity value for the pixel indexed by each element of pixIdx.
      Overrides:
      getPutPix in class FloatPixArray
      Parameters:
      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.
      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 - if the pixIdx is bad or if the pixel is of the wrong data type.