Class CalculateLevelBase
- Direct Known Subclasses:
CalculateLevel,DifferenceCalculateLevelStandardDeviation
Base class for calculating a score based on a threshold level derived from a histogram.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbeforeCalcSetup(Histogram histogram, int level) Performs setup operations before calculation.protected abstract doublecalculateForVoxel(int voxelIntensity, int level) Calculates a score for a single voxel based on its intensity and the threshold level.protected doublederiveScoreFromVoxel(int voxelIntensity) Derives a score from a single voxel intensity.The method to calculate the threshold level.intThe index of the histogram channel to use for calculations.voidinitialize(List<Histogram> histograms, Optional<Dictionary> dictionary) Initializes the voxels-score.voidsetCalculateLevel(CalculateLevel calculateLevel) The method to calculate the threshold level.voidsetHistogramChannelIndex(int histogramChannelIndex) The index of the histogram channel to use for calculations.Methods inherited from class org.anchoranalysis.plugin.image.feature.bean.score.SingleChannel
calculate, getEnergyChannelIndex, setEnergyChannelIndexMethods 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
-
CalculateLevelBase
public CalculateLevelBase()
-
-
Method Details
-
initialize
public void initialize(List<Histogram> histograms, Optional<Dictionary> dictionary) throws InitializeException Description copied from class:VoxelScoreInitializes the voxels-score.Must be called before
VoxelScore.calculate(int[]).- Overrides:
initializein classVoxelScore- Parameters:
histograms- one or more histograms associated with this calculationdictionary- optionalDictionaryassociated with this calculation- Throws:
InitializeException- if anything goes wrong
-
deriveScoreFromVoxel
protected double deriveScoreFromVoxel(int voxelIntensity) Description copied from class:SingleChannelDerives a score from a single voxel intensity.- Specified by:
deriveScoreFromVoxelin classSingleChannel- Parameters:
voxelIntensity- the intensity of the voxel in the specified energy channel- Returns:
- the calculated score for the voxel
-
beforeCalcSetup
protected abstract void beforeCalcSetup(Histogram histogram, int level) throws OperationFailedException Performs setup operations before calculation.- Parameters:
histogram- theHistogramto use for setuplevel- the calculated threshold level- Throws:
OperationFailedException- if the setup operation fails
-
calculateForVoxel
protected abstract double calculateForVoxel(int voxelIntensity, int level) Calculates a score for a single voxel based on its intensity and the threshold level.- Parameters:
voxelIntensity- the intensity of the voxellevel- the threshold level- Returns:
- a score for the voxel
-
getCalculateLevel
The method to calculate the threshold level. -
setCalculateLevel
The method to calculate the threshold level. -
getHistogramChannelIndex
public int getHistogramChannelIndex()The index of the histogram channel to use for calculations. -
setHistogramChannelIndex
public void setHistogramChannelIndex(int histogramChannelIndex) The index of the histogram channel to use for calculations.
-