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.DerivePath getPathLabel()
    Path to a CSV label file (comma-separated, with header, no quotes).
    ImageCSVLabellerInitialization initialize​(Path pathForBinding)
    Initializes the labeller.
    String labelFor​(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.
    void setPathLabel​(org.anchoranalysis.io.input.bean.path.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • initialize

      public ImageCSVLabellerInitialization initialize​(Path pathForBinding) throws org.anchoranalysis.core.exception.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:
      org.anchoranalysis.core.exception.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, org.anchoranalysis.image.io.stack.input.ProvidesStackInput input, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.core.exception.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:
      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