Class DefineOutputter

Object
AnchorBean<DefineOutputter>
DefineOutputter
Direct Known Subclasses:
DefineOutputterWithEnergy

public class DefineOutputter extends AnchorBean<DefineOutputter>
Applies a Define on inputs and outputs produced entities (images, histograms, objects etc.).

The following outputs are produced:

Output NameDefault?Description
stacksyesImage-stacks that are produced.
objectsyesCollections of ObjectMasks that are produced as HDF5
histogramsyesHistograms that are produced as CSV.
marksyesCollections of Marks that are produced as serialized XML.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Functional interface for processing an ImageInitialization.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAllOutputNamesTo(OutputEnabledMutable outputEnabled)
    Adds all possible output-names to a OutputEnabledMutable.
    protected ImageInitialization
    createInitialization(InitializationContext context, Optional<SharedObjects> sharedObjects, Optional<Dictionary> dictionary)
    Creates an ImageInitialization from the given context, shared objects, and dictionary.
    protected ImageInitialization
    createInitialization(InitializationContext context, ExportSharedObjects input)
    Creates an ImageInitialization from the given context and input.
    Define
    The Define to be applied on inputs.
    boolean
    If true, suppresses the creation of subfolders for outputs.
    protected void
    outputSharedObjects(SharedObjects sharedObjects, Optional<EnergyStack> energyStack, Outputter outputter)
    Outputs shared objects and optionally an energy stack.
    <S> void
    process(InputBound<MultiInput, S> input, DefineOutputter.Processor<ImageInitialization> operation)
    Processes the input using the provided operation.
    void
    setDefine(Define define)
    The Define to be applied on inputs.
    void
    setSuppressSubfolders(boolean suppressSubfolders)
    If true, suppresses the creation of subfolders for outputs.

    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

    • DefineOutputter

      public DefineOutputter()
  • Method Details

    • addAllOutputNamesTo

      public void addAllOutputNamesTo(OutputEnabledMutable outputEnabled)
      Adds all possible output-names to a OutputEnabledMutable.
      Parameters:
      outputEnabled - where to add all possible output-names
    • process

      public <S> void process(InputBound<MultiInput, S> input, DefineOutputter.Processor<ImageInitialization> operation) throws OperationFailedException
      Processes the input using the provided operation.
      Type Parameters:
      S - the type of the input
      Parameters:
      input - the input to process
      operation - the operation to apply on the initialization
      Throws:
      OperationFailedException - if the operation fails
    • createInitialization

      protected ImageInitialization createInitialization(InitializationContext context, ExportSharedObjects input) throws CreateException
      Creates an ImageInitialization from the given context and input.
      Parameters:
      context - the initialization context
      input - the input to create the initialization from
      Returns:
      the created ImageInitialization
      Throws:
      CreateException - if the initialization creation fails
    • createInitialization

      protected ImageInitialization createInitialization(InitializationContext context, Optional<SharedObjects> sharedObjects, Optional<Dictionary> dictionary) throws CreateException
      Creates an ImageInitialization from the given context, shared objects, and dictionary.
      Parameters:
      context - the initialization context
      sharedObjects - optional shared objects
      dictionary - optional dictionary
      Returns:
      the created ImageInitialization
      Throws:
      CreateException - if the initialization creation fails
    • outputSharedObjects

      protected void outputSharedObjects(SharedObjects sharedObjects, Optional<EnergyStack> energyStack, Outputter outputter) throws OutputWriteFailedException
      Outputs shared objects and optionally an energy stack.
      Parameters:
      sharedObjects - the shared objects to output
      energyStack - optional energy stack to output
      outputter - the outputter to use
      Throws:
      OutputWriteFailedException - if the output operation fails
    • getDefine

      public Define getDefine()
      The Define to be applied on inputs.
    • setDefine

      public void setDefine(Define define)
      The Define to be applied on inputs.
    • isSuppressSubfolders

      public boolean isSuppressSubfolders()
      If true, suppresses the creation of subfolders for outputs.
    • setSuppressSubfolders

      public void setSuppressSubfolders(boolean suppressSubfolders)
      If true, suppresses the creation of subfolders for outputs.