Class ImageMomentsBase
Object
AnchorBean<Feature<FeatureInputSingleObject>>
InitializableBean<Feature<FeatureInputSingleObject>, FeatureInitialization>
Feature<FeatureInputSingleObject>
FeatureSingleObject
ImageMomentsBase
- Direct Known Subclasses:
PrincipalAxisEccentricity,RatioPrincipalAxisLength,SpecificAxisBase
public abstract class ImageMomentsBase
extends FeatureSingleObject
A base class for features that are calculated using image-moments.
If there are too few voxels, then a constant value is returned.
- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculate(FeatureCalculationInput<FeatureInputSingleObject> input) protected abstract doublecalculateFromAllMoments(ImageMoments moments) Calculates the feature value from theImageMoments.protected abstract StringGenerates an error message when there are too few pixels to calculate moments.doubleA value to return if there are too few voxels (less thanMIN_NUM_VOXELS) to calculate moments.booleanIf true co-variance is suppressed in z-dimension.voidsetSuppressZ(boolean suppressZ) If true co-variance is suppressed in z-dimension.voidsetValueIfTooFewVoxels(double valueIfTooFewVoxels) A value to return if there are too few voxels (less thanMIN_NUM_VOXELS) to calculate moments.Methods 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
-
ImageMomentsBase
public ImageMomentsBase()
-
-
Method Details
-
calculate
public double calculate(FeatureCalculationInput<FeatureInputSingleObject> input) throws FeatureCalculationException - Specified by:
calculatein classFeature<FeatureInputSingleObject>- Throws:
FeatureCalculationException
-
calculateFromAllMoments
protected abstract double calculateFromAllMoments(ImageMoments moments) throws FeatureCalculationException Calculates the feature value from theImageMoments.- Parameters:
moments- theImageMomentsto use for calculation- Returns:
- the calculated feature value
- Throws:
FeatureCalculationException- if the calculation fails
-
errorMessageIfTooFewPixels
-
isSuppressZ
public boolean isSuppressZ()If true co-variance is suppressed in z-dimension. -
setSuppressZ
public void setSuppressZ(boolean suppressZ) If true co-variance is suppressed in z-dimension. -
getValueIfTooFewVoxels
public double getValueIfTooFewVoxels()A value to return if there are too few voxels (less thanMIN_NUM_VOXELS) to calculate moments.A warning message is also written to the log.
-
setValueIfTooFewVoxels
public void setValueIfTooFewVoxels(double valueIfTooFewVoxels) A value to return if there are too few voxels (less thanMIN_NUM_VOXELS) to calculate moments.A warning message is also written to the log.
-