Class FromDictionaryBase
An abstract base class for features that require a
Dictionary for initialization.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static doubleextractAsDouble(Dictionary dictionary, String key) Extracts a double value from the dictionary for a given key.voidinitialize(List<Histogram> histograms, Optional<Dictionary> dictionary) Initializes the feature with histograms and a dictionary.protected abstract voidsetupDictionary(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, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
FromDictionaryBase
public FromDictionaryBase()
-
-
Method Details
-
initialize
public void initialize(List<Histogram> histograms, Optional<Dictionary> dictionary) throws InitializeException Initializes the feature with histograms and a dictionary.- Overrides:
initializein classVoxelScore- Parameters:
histograms- a list ofHistogramsdictionary- an optionalDictionary- Throws:
InitializeException- if the dictionary is not present or initialization fails
-
setupDictionary
Sets up the feature using the provided dictionary.- Parameters:
dictionary- theDictionaryto use for setup- Throws:
InitializeException- if setup fails
-
extractAsDouble
protected static double extractAsDouble(Dictionary dictionary, String key) throws InitializeException Extracts 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:
InitializeException- if the key does not exist in the dictionary
-