Class LinearLeastSquaresViaNormalEquationBase
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<T,org.anchoranalysis.mpp.init.PointsInitialization>
org.anchoranalysis.mpp.bean.points.PointsBean<org.anchoranalysis.mpp.bean.points.fitter.PointsFitter>
org.anchoranalysis.mpp.bean.points.fitter.PointsFitter
org.anchoranalysis.plugin.points.bean.fitter.ConicFitterBase
org.anchoranalysis.plugin.points.bean.fitter.LinearLeastSquaresViaNormalEquationBase
- All Implemented Interfaces:
org.anchoranalysis.mpp.mark.CompatibleWithMark
public abstract class LinearLeastSquaresViaNormalEquationBase extends ConicFitterBase
Base class for linear least squares fitting using the normal equation method.
-
Constructor Summary
Constructors Constructor Description LinearLeastSquaresViaNormalEquationBase() -
Method Summary
Modifier and Type Method Description protected abstract voidapplyCoefficientsToMark(cern.colt.matrix.DoubleMatrix2D matrixV, org.anchoranalysis.mpp.mark.Mark mark, org.anchoranalysis.image.core.dimensions.Dimensions dimensions)Applies the calculated coefficients to the mark.protected abstract cern.colt.matrix.DoubleMatrix2DcreateDesignMatrix(List<org.anchoranalysis.spatial.point.Point3f> points)Creates the design matrix from the input points.voidfit(List<org.anchoranalysis.spatial.point.Point3f> points, org.anchoranalysis.mpp.mark.Mark mark, org.anchoranalysis.image.core.dimensions.Dimensions dimensions)protected abstract intminNumPoints()Returns the minimum number of points required for fitting.Methods inherited from class org.anchoranalysis.plugin.points.bean.fitter.ConicFitterBase
assignTo, getInputPointShift, getScaleRadii, getShell, getSubtractRadii, setInputPointShift, setScaleRadii, setShell, setSubtractRadiiMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
LinearLeastSquaresViaNormalEquationBase
public LinearLeastSquaresViaNormalEquationBase()
-
-
Method Details
-
fit
public void fit(List<org.anchoranalysis.spatial.point.Point3f> points, org.anchoranalysis.mpp.mark.Mark mark, org.anchoranalysis.image.core.dimensions.Dimensions dimensions) throws org.anchoranalysis.mpp.bean.points.fitter.PointsFitterException- Specified by:
fitin classorg.anchoranalysis.mpp.bean.points.fitter.PointsFitter- Throws:
org.anchoranalysis.mpp.bean.points.fitter.PointsFitterException
-
minNumPoints
protected abstract int minNumPoints()Returns the minimum number of points required for fitting.- Returns:
- the minimum number of points
-
applyCoefficientsToMark
protected abstract void applyCoefficientsToMark(cern.colt.matrix.DoubleMatrix2D matrixV, org.anchoranalysis.mpp.mark.Mark mark, org.anchoranalysis.image.core.dimensions.Dimensions dimensions) throws org.anchoranalysis.mpp.bean.points.fitter.PointsFitterExceptionApplies the calculated coefficients to the mark.- Parameters:
matrixV- the matrix of coefficientsmark- theMarkto updatedimensions- theDimensionsof the image- Throws:
org.anchoranalysis.mpp.bean.points.fitter.PointsFitterException- if there's an error applying the coefficients
-
createDesignMatrix
protected abstract cern.colt.matrix.DoubleMatrix2D createDesignMatrix(List<org.anchoranalysis.spatial.point.Point3f> points)Creates the design matrix from the input points.- Parameters:
points- the list ofPoint3fto use for creating the design matrix- Returns:
- the design matrix as a
DoubleMatrix2D
-