Class FeatureSource<T extends org.anchoranalysis.io.input.InputFromManager,S,U extends org.anchoranalysis.feature.input.FeatureInput>
Object
org.anchoranalysis.bean.AnchorBean<FeatureSource<T,S,U>>
org.anchoranalysis.plugin.image.task.bean.feature.source.FeatureSource<T,S,U>
- Type Parameters:
T- input-type from which one or more rows of features are derivedS- row-source that is duplicated for each new thread (to prevent any concurrency issues)U- feature-input type forfeaturesbean-field
- Direct Known Subclasses:
SingleRowPerInput
public abstract class FeatureSource<T extends org.anchoranalysis.io.input.InputFromManager,S,U extends org.anchoranalysis.feature.input.FeatureInput> extends org.anchoranalysis.bean.AnchorBean<FeatureSource<T,S,U>>
Extracts features from some kind of inputs to produce one or more rows in a feature-table.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description FeatureSource() -
Method Summary
Modifier and Type Method Description abstract voidcalculateAndOutput(T input, FeatureCalculationContext<S> context)Processes one input to calculate feature-results and output them to the file-system.abstract FeatureExporter<S>createExporter(org.anchoranalysis.feature.io.csv.metadata.LabelHeaders metadataHeaders, List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<U>>> features, org.anchoranalysis.feature.io.results.FeatureOutputNames outputNames, Optional<org.anchoranalysis.io.input.grouper.InputGrouper> grouper, FeatureExporterContext context)Creates theFeatureExporterto be used for calculating and exporting feature-results.abstract org.anchoranalysis.feature.io.csv.metadata.LabelHeadersheaders(boolean groupsEnabled)Generates label-headers for the non-feature-result columns in the CSV.abstract booleanincludeGroupInExperiment(boolean groupGeneratorDefined)Determines if group columns should be added to the CSV exports and other group exports may occur in sub-directories.abstract org.anchoranalysis.experiment.task.InputTypesExpectedinputTypesExpected()Specifies the highest class(es) that will function as a valid input.
-
Constructor Details
-
FeatureSource
public FeatureSource()
-
-
Method Details
-
createExporter
public abstract FeatureExporter<S> createExporter(org.anchoranalysis.feature.io.csv.metadata.LabelHeaders metadataHeaders, List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<U>>> features, org.anchoranalysis.feature.io.results.FeatureOutputNames outputNames, Optional<org.anchoranalysis.io.input.grouper.InputGrouper> grouper, FeatureExporterContext context) throws org.anchoranalysis.core.exception.CreateExceptionCreates theFeatureExporterto be used for calculating and exporting feature-results.- Parameters:
metadataHeaders- headers to use for additional "metadata" before feature-results.features- the features to calculate.outputNames- the names of various kind of outputs.grouper- when defined, assigns each input to a group.context- IO-context.- Returns:
- a newly created
FeatureExporteras matches this source of features. - Throws:
org.anchoranalysis.core.exception.CreateException- if it cannot be created.
-
includeGroupInExperiment
public abstract boolean includeGroupInExperiment(boolean groupGeneratorDefined)Determines if group columns should be added to the CSV exports and other group exports may occur in sub-directories.- Parameters:
groupGeneratorDefined- has a group-generator been defined for this experiment?- Returns:
- true if a group-generator has been defined, false otherwise
-
headers
public abstract org.anchoranalysis.feature.io.csv.metadata.LabelHeaders headers(boolean groupsEnabled)Generates label-headers for the non-feature-result columns in the CSV.- Parameters:
groupsEnabled- whether groups are enabled- Returns:
- a
LabelHeadersobject for the non-feature-result columns
-
calculateAndOutput
public abstract void calculateAndOutput(T input, FeatureCalculationContext<S> context) throws org.anchoranalysis.core.exception.OperationFailedExceptionProcesses one input to calculate feature-results and output them to the file-system.- Parameters:
input- one particular input that will create one or more "rows" in a feature-tablecontext- theFeatureCalculationContextfor calculation- Throws:
org.anchoranalysis.core.exception.OperationFailedException- if the operation fails
-
inputTypesExpected
public abstract org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()Specifies the highest class(es) that will function as a valid input.This is usually the class of T (or sometimes the absolute base class
InputFromManager)- Returns:
- an
InputTypesExpectedobject specifying the expected input types
-