Class SharedStateFilteredImageOutput<T>
Object
SharedStateFilteredImageOutput<T>
- Type Parameters:
T- type of initialization for theImageLabeller.
Manages filtered image output with shared state across multiple images.
-
Constructor Summary
ConstructorsConstructorDescriptionSharedStateFilteredImageOutput(Outputter baseOutputter, ImageLabeller<T> filter, String outputNameMapping, String outputNameImages) Creates a newSharedStateFilteredImageOutput. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the CSV writer.getFilterInitialization(Path pathForBinding) Gets the filter initialization, initializing it if necessary.Optional<Outputter> getOutputterFor(String groupIdentifier) Gets the outputter for a specific group identifier.labelFor(ProvidesStackInput input, InputOutputContext context) Determines a particular group-identifier for an input.voidWrites a row to the CSV file with image name and group identifier.
-
Constructor Details
-
SharedStateFilteredImageOutput
public SharedStateFilteredImageOutput(Outputter baseOutputter, ImageLabeller<T> filter, String outputNameMapping, String outputNameImages) throws CreateException Creates a newSharedStateFilteredImageOutput.- Parameters:
baseOutputter- the baseOutputterfor writing resultsfilter- theImageLabellerto use (must not be initialized yet)outputNameMapping- the output name for the CSV file mapping inputs to labelsoutputNameImages- the output name for the labels sub-directory- Throws:
CreateException- if there's an error during creation
-
-
Method Details
-
writeRow
-
close
public void close()Closes the CSV writer. -
labelFor
public String labelFor(ProvidesStackInput input, InputOutputContext context) throws OperationFailedException Determines a particular group-identifier for an input.- Parameters:
input- theProvidesStackInputto labelcontext- theInputOutputContextfor the operation- Returns:
- the label for the input
- Throws:
OperationFailedException- if the labelling operation fails
-
getOutputterFor
-
getFilterInitialization
-