Class ImageCSVLabeller


public class ImageCSVLabeller extends ImageLabeller<ImageCSVLabellerInitialization>
Labels images based on a CSV file containing image identifiers and corresponding labels.
  • Constructor Details

    • ImageCSVLabeller

      public ImageCSVLabeller()
  • Method Details

    • initialize

      public ImageCSVLabellerInitialization initialize(Path pathForBinding) throws InitializeException
      Description copied from class: ImageLabeller
      Initializes the labeller. Should be called once before calling any other methods.
      Specified by:
      initialize in class ImageLabeller<ImageCSVLabellerInitialization>
      Parameters:
      pathForBinding - a Path 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

      public Set<String> allLabels(ImageCSVLabellerInitialization initialization)
      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 class ImageLabeller<ImageCSVLabellerInitialization>
      Parameters:
      initialization - the initialized shared-state returned by ImageLabeller.initialize(Path)
      Returns:
      a Set of String 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 class ImageLabeller<ImageCSVLabellerInitialization>
      Parameters:
      sharedState - the shared-state returned by ImageLabeller.initialize(Path)
      input - the ProvidesStackInput to be labelled
      context - the InputOutputContext for the operation
      Returns:
      the label as a String
      Throws:
      OperationFailedException - if the labelling operation fails
    • getPathLabel

      public 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(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