Class PrincipalAxisEccentricity
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<org.anchoranalysis.feature.bean.Feature<T>,org.anchoranalysis.feature.initialization.FeatureInitialization>
org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>
org.anchoranalysis.image.feature.bean.object.single.FeatureSingleObject
org.anchoranalysis.plugin.image.feature.bean.object.single.moments.ImageMomentsBase
org.anchoranalysis.plugin.image.feature.bean.object.single.moments.PrincipalAxisEccentricity
public class PrincipalAxisEccentricity extends ImageMomentsBase
Calculates the eccentricity of the Principal Axes (as defined by Image Moments).
Specifically, this is:
sqrt( 1 - eigenvalue2/eigenvalue1)where
eigenvalue1 is the eigen-value with first highest-magnitude, and
eigenvalue2 is second-highest etc.
See Image moment on Wikipedia for the precise calculation.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description PrincipalAxisEccentricity() -
Method Summary
Modifier and Type Method Description static doublecalculateEccentricity(double eigenvalSmaller, double eigenvalLarger)Calculates the eccentricity from two eigenvalues.protected doublecalculateFromAllMoments(org.anchoranalysis.math.statistics.moment.ImageMoments moments)Calculates the feature value from theImageMoments.protected StringerrorMessageIfTooFewPixels()Generates an error message when there are too few pixels to calculate moments.Methods inherited from class org.anchoranalysis.plugin.image.feature.bean.object.single.moments.ImageMomentsBase
calculate, getValueIfTooFewVoxels, isSuppressZ, setSuppressZ, setValueIfTooFewVoxelsMethods inherited from class org.anchoranalysis.image.feature.bean.object.single.FeatureSingleObject
inputTypeMethods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, descriptionLong, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toStringMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized
-
Constructor Details
-
PrincipalAxisEccentricity
public PrincipalAxisEccentricity()
-
-
Method Details
-
calculateEccentricity
public static double calculateEccentricity(double eigenvalSmaller, double eigenvalLarger)Calculates the eccentricity from two eigenvalues.- Parameters:
eigenvalSmaller- the smaller eigenvalueeigenvalLarger- the larger eigenvalue- Returns:
- the calculated eccentricity as a
Double
-
calculateFromAllMoments
protected double calculateFromAllMoments(org.anchoranalysis.math.statistics.moment.ImageMoments moments) throws org.anchoranalysis.feature.calculate.FeatureCalculationExceptionDescription copied from class:ImageMomentsBaseCalculates the feature value from theImageMoments.- Specified by:
calculateFromAllMomentsin classImageMomentsBase- Parameters:
moments- theImageMomentsto use for calculation- Returns:
- the calculated feature value
- Throws:
org.anchoranalysis.feature.calculate.FeatureCalculationException- if the calculation fails
-
errorMessageIfTooFewPixels
Description copied from class:ImageMomentsBaseGenerates an error message when there are too few pixels to calculate moments.- Specified by:
errorMessageIfTooFewPixelsin classImageMomentsBase- Returns:
- the error message as a
String
-