Class FeatureCalculationContext<S>

Object
org.anchoranalysis.plugin.image.task.feature.FeatureCalculationContext<S>
Type Parameters:
S - encapsulation of the features that provide the calculation.

public class FeatureCalculationContext<S>
extends Object
The context in which features are calculated, so as to be later exported as a CSV.
  • Constructor Details

    • FeatureCalculationContext

      public FeatureCalculationContext​(FeatureResultsAndThumbnails results, S rowSource, org.anchoranalysis.feature.name.FeatureNameList featureNames, Optional<String> groupGeneratorName, org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder, boolean suppressErrors, org.anchoranalysis.io.output.outputter.InputOutputContext context)
      Parameters:
      results - the stored results and thumbnail writer
      rowSource - the source of features to be calculated
      featureNames - the names of features to be calculated
      groupGeneratorName - the optional name of the group generator
      executionTimeRecorder - records execution time of operations
      suppressErrors - if true, exceptions during calculation are suppressed
      context - the input-output context for the operation
  • Method Details

    • getModelDirectory

      public Path getModelDirectory()
      Gets the model directory path.
      Returns:
      the Path to the model directory
    • getLogger

      public org.anchoranalysis.core.log.Logger getLogger()
      Gets the logger for the context.
      Returns:
      the Logger instance
    • getOperationContext

      public org.anchoranalysis.core.time.OperationContext getOperationContext()
      Gets the operation context.
      Returns:
      the OperationContext instance
    • getResults

      public FeatureResultsAndThumbnails getResults()
      The stored results and thumbnail writer.
    • getFeatureSource

      public S getFeatureSource()
      The features that are calculated, encapsulated in some object.
    • getFeatureNames

      public org.anchoranalysis.feature.name.FeatureNameList getFeatureNames()
      The name of each feature being calculated, in identical order, as that is placed in the exported CSV.
    • getGroupGeneratorName

      public Optional<String> getGroupGeneratorName()
      The optional name of the group generator.
    • getExecutionTimeRecorder

      public org.anchoranalysis.core.time.ExecutionTimeRecorder getExecutionTimeRecorder()
      Records the execution-time of particular operations.
    • getContext

      public org.anchoranalysis.io.output.outputter.InputOutputContext getContext()
      The input-output context for the operation.
    • isSuppressErrors

      public boolean isSuppressErrors()
      When false, an image is reported as errored, if any exception is thrown during calculation. When true, then a value of Double.NaN is returned, and a message is written to the error-log.
    • isThumbnailsEnabled

      public boolean isThumbnailsEnabled()
      Whether thumbnails are enabled for output.