Class ImageLabeller<T>
Object
org.anchoranalysis.bean.AnchorBean<ImageLabeller<T>>
org.anchoranalysis.plugin.image.task.bean.labeller.ImageLabeller<T>
- Type Parameters:
T- the type of shared-state used by the labeller
- Direct Known Subclasses:
BinaryOutcomeImageLabeller,ImageCSVLabeller,ImageLabellerStringMap
public abstract class ImageLabeller<T> extends org.anchoranalysis.bean.AnchorBean<ImageLabeller<T>>
Associates a label with an image.
This can be used to associate labels with images for training or evaluation in a machine-learning problem.
-
Constructor Summary
Constructors Constructor Description ImageLabeller() -
Method Summary
Modifier and Type Method Description abstract Set<String>allLabels(T initialization)Returns a set of identifiers for all groups that can be outputted by the labeller.abstract Tinitialize(Path pathForBinding)Initializes the labeller.abstract StringlabelFor(T sharedState, org.anchoranalysis.image.io.stack.input.ProvidesStackInput input, org.anchoranalysis.io.output.outputter.InputOutputContext context)Determines a particular group-identifier (label) for an input.
-
Constructor Details
-
ImageLabeller
public ImageLabeller()
-
-
Method Details
-
initialize
public abstract T initialize(Path pathForBinding) throws org.anchoranalysis.core.exception.InitializeExceptionInitializes the labeller. Should be called once before calling any other methods.- Parameters:
pathForBinding- aPaththat can be used by the labeller to make file path decisions- Returns:
- the initialized shared-state of type
T - Throws:
org.anchoranalysis.core.exception.InitializeException- if initialization fails
-
allLabels
Returns a set of identifiers for all groups that can be outputted by the labeller.This method should be callable at any time.
- Parameters:
initialization- the initialized shared-state returned byinitialize(Path)- Returns:
- a
SetofStringlabels
-
labelFor
public abstract String labelFor(T sharedState, org.anchoranalysis.image.io.stack.input.ProvidesStackInput input, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.core.exception.OperationFailedExceptionDetermines a particular group-identifier (label) for an input.- Parameters:
sharedState- the shared-state returned byinitialize(Path)input- theProvidesStackInputto be labelledcontext- theInputOutputContextfor the operation- Returns:
- the label as a
String - Throws:
org.anchoranalysis.core.exception.OperationFailedException- if the labelling operation fails
-