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 Summary
Constructors Constructor Description 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)Creates a newFeatureCalculationContext. -
Method Summary
Modifier and Type Method Description org.anchoranalysis.io.output.outputter.InputOutputContextgetContext()The input-output context for the operation.org.anchoranalysis.core.time.ExecutionTimeRecordergetExecutionTimeRecorder()Records the execution-time of particular operations.org.anchoranalysis.feature.name.FeatureNameListgetFeatureNames()The name of each feature being calculated, in identical order, as that is placed in the exported CSV.SgetFeatureSource()The features that are calculated, encapsulated in some object.Optional<String>getGroupGeneratorName()The optional name of the group generator.org.anchoranalysis.core.log.LoggergetLogger()Gets the logger for the context.PathgetModelDirectory()Gets the model directory path.org.anchoranalysis.core.time.OperationContextgetOperationContext()Gets the operation context.FeatureResultsAndThumbnailsgetResults()The stored results and thumbnail writer.booleanisSuppressErrors()When false, an image is reported as errored, if any exception is thrown during calculation.booleanisThumbnailsEnabled()Whether thumbnails are enabled for output.
-
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)Creates a newFeatureCalculationContext.- Parameters:
results- the stored results and thumbnail writerrowSource- the source of features to be calculatedfeatureNames- the names of features to be calculatedgroupGeneratorName- the optional name of the group generatorexecutionTimeRecorder- records execution time of operationssuppressErrors- if true, exceptions during calculation are suppressedcontext- the input-output context for the operation
-
-
Method Details
-
getModelDirectory
Gets the model directory path.- Returns:
- the
Pathto the model directory
-
getLogger
public org.anchoranalysis.core.log.Logger getLogger()Gets the logger for the context.- Returns:
- the
Loggerinstance
-
getOperationContext
public org.anchoranalysis.core.time.OperationContext getOperationContext()Gets the operation context.- Returns:
- the
OperationContextinstance
-
getResults
The stored results and thumbnail writer. -
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
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 ofDouble.NaNis returned, and a message is written to the error-log. -
isThumbnailsEnabled
public boolean isThumbnailsEnabled()Whether thumbnails are enabled for output.
-