Class CalculateLevelBase
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<T,org.anchoranalysis.image.bean.nonbean.init.ImageInitialization>
org.anchoranalysis.image.bean.ImageBean<org.anchoranalysis.image.feature.bean.VoxelScore>
org.anchoranalysis.image.feature.bean.VoxelScore
org.anchoranalysis.plugin.image.feature.bean.score.SingleChannel
org.anchoranalysis.plugin.image.feature.bean.score.CalculateLevelBase
- Direct Known Subclasses:
CalculateLevel,DifferenceCalculateLevelStandardDeviation
public abstract class CalculateLevelBase extends SingleChannel
Base class for calculating a score based on a threshold level derived from a histogram.
-
Constructor Summary
Constructors Constructor Description CalculateLevelBase() -
Method Summary
Modifier and Type Method Description protected abstract voidbeforeCalcSetup(org.anchoranalysis.math.histogram.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.org.anchoranalysis.image.bean.threshold.CalculateLevelgetCalculateLevel()The method to calculate the threshold level.intgetHistogramChannelIndex()The index of the histogram channel to use for calculations.voidinitialize(List<org.anchoranalysis.math.histogram.Histogram> histograms, Optional<org.anchoranalysis.core.value.Dictionary> dictionary)voidsetCalculateLevel(org.anchoranalysis.image.bean.threshold.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, onInitialization
-
Constructor Details
-
CalculateLevelBase
public CalculateLevelBase()
-
-
Method Details
-
initialize
public void initialize(List<org.anchoranalysis.math.histogram.Histogram> histograms, Optional<org.anchoranalysis.core.value.Dictionary> dictionary) throws org.anchoranalysis.core.exception.InitializeException- Overrides:
initializein classorg.anchoranalysis.image.feature.bean.VoxelScore- Throws:
org.anchoranalysis.core.exception.InitializeException
-
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(org.anchoranalysis.math.histogram.Histogram histogram, int level) throws org.anchoranalysis.core.exception.OperationFailedExceptionPerforms setup operations before calculation.- Parameters:
histogram- theHistogramto use for setuplevel- the calculated threshold level- Throws:
org.anchoranalysis.core.exception.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
public org.anchoranalysis.image.bean.threshold.CalculateLevel getCalculateLevel()The method to calculate the threshold level. -
setCalculateLevel
public void setCalculateLevel(org.anchoranalysis.image.bean.threshold.CalculateLevel calculateLevel)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.
-