Class ImageMomentsBase
- Direct Known Subclasses:
PrincipalAxisEccentricity
,RatioPrincipalAxisLength
,SpecificAxisBase
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 TypeMethodDescriptiondouble
Calculates a value for some input.protected abstract double
calculateFromAllMoments
(ImageMoments moments) Calculates the feature value from theImageMoments
.protected abstract String
Generates an error message when there are too few pixels to calculate moments.double
A value to return if there are too few voxels (less thanMIN_NUM_VOXELS
) to calculate moments.boolean
If true co-variance is suppressed in z-dimension.void
setSuppressZ
(boolean suppressZ) If true co-variance is suppressed in z-dimension.void
setValueIfTooFewVoxels
(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
inputType
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, descriptionLong, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toString
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized
Methods 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 Description copied from class:Feature
Calculates a value for some input.- Specified by:
calculate
in classFeature<FeatureInputSingleObject>
- Parameters:
input
- the input to the calculation.- Returns:
- the result of the calculation.
- Throws:
FeatureCalculationException
- if the calculation cannot successfully complete.
-
calculateFromAllMoments
protected abstract double calculateFromAllMoments(ImageMoments moments) throws FeatureCalculationException Calculates the feature value from theImageMoments
.- Parameters:
moments
- theImageMoments
to use for calculation- Returns:
- the calculated feature value
- Throws:
FeatureCalculationException
- if the calculation fails
-
errorMessageIfTooFewPixels
Generates an error message when there are too few pixels to calculate moments.- Returns:
- the error message as a
String
- Throws:
FeatureCalculationException
- if generating the error message fails
-
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.
-