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 double extractAsDouble​(org.anchoranalysis.core.value.Dictionary dictionary, String key)
    Extracts a double value from the dictionary for a given key.
    void initialize​(List<org.anchoranalysis.math.histogram.Histogram> histograms, Optional<org.anchoranalysis.core.value.Dictionary> dictionary)
    Initializes the feature with histograms and a dictionary.
    protected abstract void setupDictionary​(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, 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

  • 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
      Initializes the feature with histograms and a dictionary.
      Overrides:
      initialize in class org.anchoranalysis.image.feature.bean.VoxelScore
      Parameters:
      histograms - a list of Histograms
      dictionary - an optional Dictionary
      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.InitializeException
      Sets up the feature using the provided dictionary.
      Parameters:
      dictionary - the Dictionary to 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.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:
      org.anchoranalysis.core.exception.InitializeException - if the key does not exist in the dictionary