Package com.xinapse.numerical
Class PolyCoeffs3D
java.lang.Object
com.xinapse.numerical.PolyCoeffs3D
A 3-D polynomial used to represent a set of image intensities.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum polynomial order that can be fitted. -
Constructor Summary
ConstructorDescriptionPolyCoeffs3D
(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
-
Field Details
-
MAX_ORDER
public static final int MAX_ORDERThe 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
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
Run the self-test of this class.- Parameters:
args
- ignored.
-