Class SingleTableCalculator
Object
SingleTableCalculator
- All Implemented Interfaces:
FeatureCalculatorMulti<FeatureInputSingleObject>,FeatureTableCalculator<FeatureInputSingleObject>
public class SingleTableCalculator
extends Object
implements FeatureTableCalculator<FeatureInputSingleObject>
A feature table calculator for single objects.
This class implements the FeatureTableCalculator interface for FeatureInputSingleObject, providing methods to calculate features for single objects and manage
the feature calculation process.
-
Constructor Summary
ConstructorsConstructorDescriptionSingleTableCalculator(NamedFeatureStore<FeatureInputSingleObject> namedFeatureStore) Creates a newSingleTableCalculatorinstance. -
Method Summary
Modifier and TypeMethodDescriptioncalculate(FeatureInputSingleObject input, FeatureList<FeatureInputSingleObject> featuresSubset) calculateSuppressErrors(FeatureInputSingleObject input, ErrorReporter errorReporter) Creates a list of names for each feature (columns of the table).Makes a copy of the feature-store for a new thread.intvoidstart(ImageInitialization initialization, Optional<EnergyStack> energyStack, Logger logger) Initializes a feature store that has the same structure as that previously created by createFeatures() from the same object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.anchoranalysis.feature.calculate.bound.FeatureCalculatorMulti
calculate
-
Constructor Details
-
SingleTableCalculator
Creates a newSingleTableCalculatorinstance.- Parameters:
namedFeatureStore- The named feature store containing features for single objects.
-
-
Method Details
-
start
public void start(ImageInitialization initialization, Optional<EnergyStack> energyStack, Logger logger) throws InitializeException Description copied from interface:FeatureTableCalculatorInitializes a feature store that has the same structure as that previously created by createFeatures() from the same object.- Specified by:
startin interfaceFeatureTableCalculator<FeatureInputSingleObject>- Parameters:
initialization- the image initialization contextenergyStack- an optional energy stack for feature calculationlogger- a logger for reporting initialization progress or errors- Throws:
InitializeException- if initialization fails
-
duplicateForNewThread
Description copied from interface:FeatureTableCalculatorMakes a copy of the feature-store for a new thread.Deep-copies the features. Shallow-copies everything else.
- Specified by:
duplicateForNewThreadin interfaceFeatureTableCalculator<FeatureInputSingleObject>- Returns:
- the copied feature-store
-
calculate
public ResultsVector calculate(FeatureInputSingleObject input) throws NamedFeatureCalculateException - Specified by:
calculatein interfaceFeatureCalculatorMulti<FeatureInputSingleObject>- Throws:
NamedFeatureCalculateException
-
calculate
public ResultsVector calculate(FeatureInputSingleObject input, FeatureList<FeatureInputSingleObject> featuresSubset) throws NamedFeatureCalculateException - Specified by:
calculatein interfaceFeatureCalculatorMulti<FeatureInputSingleObject>- Throws:
NamedFeatureCalculateException
-
calculateSuppressErrors
public ResultsVector calculateSuppressErrors(FeatureInputSingleObject input, ErrorReporter errorReporter) - Specified by:
calculateSuppressErrorsin interfaceFeatureCalculatorMulti<FeatureInputSingleObject>
-
sizeFeatures
public int sizeFeatures()- Specified by:
sizeFeaturesin interfaceFeatureCalculatorMulti<FeatureInputSingleObject>
-
createFeatureNames
Description copied from interface:FeatureTableCalculatorCreates a list of names for each feature (columns of the table).- Specified by:
createFeatureNamesin interfaceFeatureTableCalculator<FeatureInputSingleObject>- Returns:
- the list of feature names
-