Class SharedStateFilteredImageOutput<T>

Object
org.anchoranalysis.plugin.image.task.labeller.SharedStateFilteredImageOutput<T>
Type Parameters:
T - type of initialization for the ImageLabeller.

public class SharedStateFilteredImageOutput<T>
extends Object
Manages filtered image output with shared state across multiple images.
  • Constructor Details

    • SharedStateFilteredImageOutput

      public SharedStateFilteredImageOutput​(org.anchoranalysis.io.output.outputter.Outputter baseOutputter, ImageLabeller<T> filter, String outputNameMapping, String outputNameImages) throws org.anchoranalysis.core.exception.CreateException
      Parameters:
      baseOutputter - the base Outputter for writing results
      filter - the ImageLabeller to use (must not be initialized yet)
      outputNameMapping - the output name for the CSV file mapping inputs to labels
      outputNameImages - the output name for the labels sub-directory
      Throws:
      org.anchoranalysis.core.exception.CreateException - if there's an error during creation
  • Method Details

    • writeRow

      public void writeRow​(String name, String groupIdentifier)
      Writes a row to the CSV file with image name and group identifier.
      Parameters:
      name - the name of the image
      groupIdentifier - the group identifier for the image
    • close

      public void close()
      Closes the CSV writer.
    • labelFor

      public String labelFor​(org.anchoranalysis.image.io.stack.input.ProvidesStackInput input, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.core.exception.OperationFailedException
      Determines a particular group-identifier for an input.
      Parameters:
      input - the ProvidesStackInput to label
      context - the InputOutputContext for the operation
      Returns:
      the label for the input
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if the labelling operation fails
    • getOutputterFor

      public Optional<org.anchoranalysis.io.output.outputter.Outputter> getOutputterFor​(String groupIdentifier)
      Gets the outputter for a specific group identifier.
      Parameters:
      groupIdentifier - the group identifier
      Returns:
      an Optional containing the Outputter for the group, if it exists
    • getFilterInitialization

      public T getFilterInitialization​(Path pathForBinding) throws org.anchoranalysis.core.exception.InitializeException
      Gets the filter initialization, initializing it if necessary.
      Parameters:
      pathForBinding - the Path to use for initialization
      Returns:
      the initialization data
      Throws:
      org.anchoranalysis.core.exception.InitializeException - if initialization fails