Class FeatureResultsAndThumbnails

Object
org.anchoranalysis.plugin.image.task.feature.FeatureResultsAndThumbnails

public class FeatureResultsAndThumbnails
extends Object
A collection of results from feature calculation, and associated thumbnails.

It supports concurrent access by multiple threads.

The following outputs are produced:

Output NameDefault?Description
thumbnailsyesa small picture for each row in the features CSV illustrating its content.
Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    FeatureResultsAndThumbnails​(org.anchoranalysis.feature.io.results.FeatureOutputMetadata outputMetadata, FeatureExporterContext context)
  • Method Summary

    Modifier and Type Method Description
    void add​(org.anchoranalysis.core.functional.checked.CheckedSupplier<org.anchoranalysis.feature.io.results.LabelledResultsVector,​org.anchoranalysis.core.exception.OperationFailedException> resultToAdd, org.anchoranalysis.core.functional.checked.CheckedSupplier<Optional<org.anchoranalysis.image.core.stack.DisplayStack>,​org.anchoranalysis.core.exception.OperationFailedException> thumbnail)
    Adds results, together with a thumbnail.
    void closeAnyOpenIO()
    Closes any open IO and removes redundant structures stored in memory.
    void writeGroupedResults​(Optional<org.anchoranalysis.feature.store.NamedFeatureStore<org.anchoranalysis.feature.input.FeatureInputResults>> featuresAggregate, boolean includeGroups, Function<org.anchoranalysis.io.output.outputter.InputOutputContext,​org.anchoranalysis.feature.io.csv.results.FeatureCSVWriterFactory> csvWriterCreator, org.anchoranalysis.io.output.outputter.InputOutputContext context)
    Writes all the results that have been collected as a CSV file.

    Methods inherited from class java.lang.Object

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

    • FeatureResultsAndThumbnails

      public FeatureResultsAndThumbnails​(org.anchoranalysis.feature.io.results.FeatureOutputMetadata outputMetadata, FeatureExporterContext context) throws org.anchoranalysis.io.output.error.OutputWriteFailedException
      Parameters:
      outputMetadata - metadata for feature output.
      context - the context for feature exporting operations.
      Throws:
      org.anchoranalysis.io.output.error.OutputWriteFailedException - if there's an error setting up the output.
  • Method Details

    • add

      public void add​(org.anchoranalysis.core.functional.checked.CheckedSupplier<org.anchoranalysis.feature.io.results.LabelledResultsVector,​org.anchoranalysis.core.exception.OperationFailedException> resultToAdd, org.anchoranalysis.core.functional.checked.CheckedSupplier<Optional<org.anchoranalysis.image.core.stack.DisplayStack>,​org.anchoranalysis.core.exception.OperationFailedException> thumbnail) throws org.anchoranalysis.core.exception.OperationFailedException
      Adds results, together with a thumbnail.

      Note that in order for the sequence numbers to match the order in the feature table, a thumbnail should be present for all results, or for no results, but never partially.

      The results are only calculated if any of the relevant outputs are enabled. Similarly with the thumbnails.

      Parameters:
      resultToAdd - supplies the results to add, which may or may not be called, depending on what outputs are enabled.
      thumbnail - supplies the thumbnail to write, which may or may not be called, depending on what outputs are enabled.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if the operation cannot be successfully completed.
    • writeGroupedResults

      public void writeGroupedResults​(Optional<org.anchoranalysis.feature.store.NamedFeatureStore<org.anchoranalysis.feature.input.FeatureInputResults>> featuresAggregate, boolean includeGroups, Function<org.anchoranalysis.io.output.outputter.InputOutputContext,​org.anchoranalysis.feature.io.csv.results.FeatureCSVWriterFactory> csvWriterCreator, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.io.output.error.OutputWriteFailedException
      Writes all the results that have been collected as a CSV file.
      Parameters:
      featuresAggregate - features that can be used for generating additional "aggregated" exports.
      includeGroups - if true a group-column is included in the CSV file and the group exports occur, otherwise not.
      csvWriterCreator - creates a FeatureCSVWriterFactory for a particular InputOutputContext.
      context - the InputOutputContext for input/output operations.
      Throws:
      org.anchoranalysis.io.output.error.OutputWriteFailedException - if there's an error writing the output.
    • closeAnyOpenIO

      public void closeAnyOpenIO() throws IOException
      Closes any open IO and removes redundant structures stored in memory.
      Throws:
      IOException - if the close operation cannot successfully complete.