Class ImageCSVLabeller
Labels images based on a CSV file containing image identifiers and corresponding labels.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallLabels
(ImageCSVLabellerInitialization initialization) Returns a set of identifiers for all groups that can be outputted by the labeller.Path to a CSV label file (comma-separated, with header, no quotes).initialize
(Path pathForBinding) Initializes the labeller.labelFor
(ImageCSVLabellerInitialization sharedState, ProvidesStackInput input, InputOutputContext context) Determines a particular group-identifier (label) for an input.void
setPathLabel
(DerivePath pathLabel) Path to a CSV label file (comma-separated, with header, no quotes).Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ImageCSVLabeller
public ImageCSVLabeller()
-
-
Method Details
-
initialize
Description copied from class:ImageLabeller
Initializes the labeller. Should be called once before calling any other methods.- Specified by:
initialize
in classImageLabeller<ImageCSVLabellerInitialization>
- Parameters:
pathForBinding
- aPath
that can be used by the labeller to make file path decisions- Returns:
- the initialized shared-state of type
T
- Throws:
InitializeException
- if initialization fails
-
allLabels
Description copied from class:ImageLabeller
Returns a set of identifiers for all groups that can be outputted by the labeller.This method should be callable at any time.
- Specified by:
allLabels
in classImageLabeller<ImageCSVLabellerInitialization>
- Parameters:
initialization
- the initialized shared-state returned byImageLabeller.initialize(Path)
- Returns:
- a
Set
ofString
labels
-
labelFor
public String labelFor(ImageCSVLabellerInitialization sharedState, ProvidesStackInput input, InputOutputContext context) throws OperationFailedException Description copied from class:ImageLabeller
Determines a particular group-identifier (label) for an input.- Specified by:
labelFor
in classImageLabeller<ImageCSVLabellerInitialization>
- Parameters:
sharedState
- the shared-state returned byImageLabeller.initialize(Path)
input
- theProvidesStackInput
to be labelledcontext
- theInputOutputContext
for the operation- Returns:
- the label as a
String
- Throws:
OperationFailedException
- if the labelling operation fails
-
getPathLabel
Path to a CSV label file (comma-separated, with header, no quotes).The CSV file should have two columns: first column = image id (to match the input-name of an image) second column = a label string
-
setPathLabel
Path to a CSV label file (comma-separated, with header, no quotes).The CSV file should have two columns: first column = image id (to match the input-name of an image) second column = a label string
-