Class RatioPrincipalAxisLength
Calculates the ratio of prinicpal-axis length using Image Moments.
Specifically this is the highest-magnitude eigen-value (normalized) to second-highest (normalized) eigen-value.
See Image moment on Wikipedia for the precise calculation.
See Stack overflow post for the normalization procedure.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecalculateFromAllMoments(ImageMoments moments) Calculates the feature value from theImageMoments.protected StringGenerates 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, isInitializedMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
RatioPrincipalAxisLength
public RatioPrincipalAxisLength()
-
-
Method Details
-
calculateFromAllMoments
Description 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:
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
-