Class FromDictionaryBase
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.FromDictionaryBase
public abstract class FromDictionaryBase extends SingleChannel
An abstract base class for features that require a
Dictionary for initialization.-
Constructor Summary
Constructors Constructor Description FromDictionaryBase() -
Method Summary
Modifier and Type Method Description protected static doubleextractAsDouble(org.anchoranalysis.core.value.Dictionary dictionary, String key)Extracts a double value from the dictionary for a given key.voidinitialize(List<org.anchoranalysis.math.histogram.Histogram> histograms, Optional<org.anchoranalysis.core.value.Dictionary> dictionary)Initializes the feature with histograms and a dictionary.protected abstract voidsetupDictionary(org.anchoranalysis.core.value.Dictionary dictionary)Sets up the feature using the provided dictionary.Methods inherited from class org.anchoranalysis.plugin.image.feature.bean.score.SingleChannel
calculate, deriveScoreFromVoxel, getEnergyChannelIndex, setEnergyChannelIndexMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
-
Constructor Details
-
FromDictionaryBase
public FromDictionaryBase()
-
-
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.InitializeExceptionInitializes the feature with histograms and a dictionary.- Overrides:
initializein classorg.anchoranalysis.image.feature.bean.VoxelScore- Parameters:
histograms- a list ofHistogramsdictionary- an optionalDictionary- Throws:
org.anchoranalysis.core.exception.InitializeException- if the dictionary is not present or initialization fails
-
setupDictionary
protected abstract void setupDictionary(org.anchoranalysis.core.value.Dictionary dictionary) throws org.anchoranalysis.core.exception.InitializeExceptionSets up the feature using the provided dictionary.- Parameters:
dictionary- theDictionaryto use for setup- Throws:
org.anchoranalysis.core.exception.InitializeException- if setup fails
-
extractAsDouble
protected static double extractAsDouble(org.anchoranalysis.core.value.Dictionary dictionary, String key) throws org.anchoranalysis.core.exception.InitializeExceptionExtracts a double value from the dictionary for a given key.- Parameters:
dictionary- theDictionaryto extract fromkey- the key to look up in the dictionary- Returns:
- the double value associated with the key
- Throws:
org.anchoranalysis.core.exception.InitializeException- if the key does not exist in the dictionary
-