Class ImageCSVLabeller
Object
org.anchoranalysis.bean.AnchorBean<ImageLabeller<T>>
org.anchoranalysis.plugin.image.task.bean.labeller.ImageLabeller<ImageCSVLabellerInitialization>
org.anchoranalysis.plugin.image.task.bean.labeller.ImageCSVLabeller
public class ImageCSVLabeller extends ImageLabeller<ImageCSVLabellerInitialization>
Labels images based on a CSV file containing image identifiers and corresponding labels.
-
Constructor Summary
Constructors Constructor Description ImageCSVLabeller() -
Method Summary
Modifier and Type Method Description Set<String>allLabels(ImageCSVLabellerInitialization initialization)Returns a set of identifiers for all groups that can be outputted by the labeller.org.anchoranalysis.io.input.bean.path.DerivePathgetPathLabel()Path to a CSV label file (comma-separated, with header, no quotes).ImageCSVLabellerInitializationinitialize(Path pathForBinding)Initializes the labeller.StringlabelFor(ImageCSVLabellerInitialization 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.voidsetPathLabel(org.anchoranalysis.io.input.bean.path.DerivePath pathLabel)Path to a CSV label file (comma-separated, with header, no quotes).
-
Constructor Details
-
ImageCSVLabeller
public ImageCSVLabeller()
-
-
Method Details
-
initialize
public ImageCSVLabellerInitialization initialize(Path pathForBinding) throws org.anchoranalysis.core.exception.InitializeExceptionDescription copied from class:ImageLabellerInitializes the labeller. Should be called once before calling any other methods.- Specified by:
initializein classImageLabeller<ImageCSVLabellerInitialization>- 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
Description copied from class:ImageLabellerReturns a set of identifiers for all groups that can be outputted by the labeller.This method should be callable at any time.
- Specified by:
allLabelsin classImageLabeller<ImageCSVLabellerInitialization>- Parameters:
initialization- the initialized shared-state returned byImageLabeller.initialize(Path)- Returns:
- a
SetofStringlabels
-
labelFor
public String labelFor(ImageCSVLabellerInitialization sharedState, org.anchoranalysis.image.io.stack.input.ProvidesStackInput input, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.core.exception.OperationFailedExceptionDescription copied from class:ImageLabellerDetermines a particular group-identifier (label) for an input.- Specified by:
labelForin classImageLabeller<ImageCSVLabellerInitialization>- Parameters:
sharedState- the shared-state returned byImageLabeller.initialize(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
-
getPathLabel
public org.anchoranalysis.io.input.bean.path.DerivePath 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
public void setPathLabel(org.anchoranalysis.io.input.bean.path.DerivePath pathLabel)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
-