Class FromDictionaryBase
An abstract base class for features that require a
Dictionary
for initialization.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static double
extractAsDouble
(Dictionary dictionary, String key) Extracts a double value from the dictionary for a given key.void
initialize
(List<Histogram> histograms, Optional<Dictionary> dictionary) Initializes the feature with histograms and a dictionary.protected abstract void
setupDictionary
(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, setEnergyChannelIndex
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
Methods 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:
initialize
in classVoxelScore
- Parameters:
histograms
- a list ofHistogram
sdictionary
- an optionalDictionary
- Throws:
InitializeException
- if the dictionary is not present or initialization fails
-
setupDictionary
Sets up the feature using the provided dictionary.- Parameters:
dictionary
- theDictionary
to 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
- theDictionary
to 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
-