Class PolyCoeffs3D

java.lang.Object
com.xinapse.numerical.PolyCoeffs3D

public class PolyCoeffs3D extends Object
A 3-D polynomial used to represent a set of image intensities.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximum polynomial order that can be fitted.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PolyCoeffs3D(float[] pixels, int order, BitSet mask, int nCols, int nRows, int nSlices, float[] var)
    Create a polynomial representation of an image.
    PolyCoeffs3D(float[] pixels, int order, BitSet mask, int maxSamples, int nCols, int nRows, int nSlices, float[] var)
    Create a polynomial representation of an image.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    getImage(Double threshold)
    Get an image representing the fitted polynomial surface.
    static void
    main(String[] args)
    Run the self-test of this class.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_ORDER

      public static final int MAX_ORDER
      The maximum polynomial order that can be fitted.
      See Also:
  • Constructor Details

    • PolyCoeffs3D

      public PolyCoeffs3D(float[] pixels, int order, BitSet mask, int nCols, int nRows, int nSlices, float[] var) throws InvalidArgumentException, NumericalException
      Create a polynomial representation of an image.
      Parameters:
      pixels - the pixel intensities.
      order - the order of the polynomial used to represent the image.
      mask - if non-null, a mask to select which pixels are to used in fitting the polynomial.
      nCols - number of columns in the image.
      nRows - number of rows in the image.
      nSlices - number of slices in the image.
      var - if non-null, the variances on the pixel intensities. If var is null, then the variance is assumed to be the same for all pixels.
      Throws:
      InvalidArgumentException - if the order is greater than the maximum allowed, or if there are not enough pixels in the image to calculate the polynomials.
      NumericalException - if the polynomial cannot be calculated.
    • PolyCoeffs3D

      public PolyCoeffs3D(float[] pixels, int order, BitSet mask, int maxSamples, int nCols, int nRows, int nSlices, float[] var) throws IllegalArgumentException, NumericalException
      Create a polynomial representation of an image.
      Parameters:
      pixels - the pixel intensities.
      order - the order of the polynomial used to represent the image.
      mask - if non-null, a mask to select which pixels are to used in fitting the polynomial.
      maxSamples - the maximum number of pixel intensity samples that will be used to estimate the polynomial coefficients.
      nCols - number of columns in the image.
      nRows - number of rows in the image.
      nSlices - number of slices in the image.
      var - if non-null, the variances on the pixel intensities. If var is null, then the variance is assumed to be the same for all pixels.
      Throws:
      IllegalArgumentException - if the order is greater than the maximum allowed, or if there are not enough pixels in the image to calculate the polynomials.
      NumericalException - if the polynomial cannot be calculated.
  • Method Details

    • getImage

      public float[] getImage(Double threshold)
      Get an image representing the fitted polynomial surface.
      Parameters:
      threshold - if non-null, all pixel values in the output image will be set to zero intensity if their fitted intensity is below the threshold.
      Returns:
      an image representing the fitted polynomial surface.
    • main

      public static void main(String[] args)
      Run the self-test of this class.
      Parameters:
      args - ignored.