Class FromDictionaryBase

Object
AnchorBean<VoxelScore>
InitializableBean<VoxelScore, ImageInitialization>
ImageBean<VoxelScore>
VoxelScore
SingleChannel
FromDictionaryBase

public abstract class FromDictionaryBase extends SingleChannel
An abstract base class for features that require a Dictionary for initialization.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 class VoxelScore
      Parameters:
      histograms - a list of Histograms
      dictionary - an optional Dictionary
      Throws:
      InitializeException - if the dictionary is not present or initialization fails
    • setupDictionary

      protected abstract void setupDictionary(Dictionary dictionary) throws InitializeException
      Sets up the feature using the provided dictionary.
      Parameters:
      dictionary - the Dictionary 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 - the Dictionary to extract from
      key - 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