public class OutputManager extends AnchorBean<OutputManager>
An output prefix (with directory and/or file-path components) is calculated for each input.
Rules can be specified in outputsEnabled
as to which outputs occur or do not occur
(from the available outputs in an experiment) when an experiment is run.
Constructor and Description |
---|
OutputManager() |
Modifier and Type | Method and Description |
---|---|
OutputWriteContext |
createContextForWriting(Optional<ImageFileFormat> suggestedFormatToWrite,
ExecutionTimeRecorder executionTimeRecorder)
Creates the
OutputWriteContext needed for writing files. |
OutputterChecked |
createExperimentOutputter(Optional<String> experimentIdentifier,
MultiLevelOutputEnabled outputsEnabled,
Optional<MultiLevelRecordedOutputs> recordedOutputs,
OutputWriteContext writeContext,
PathPrefixerContext prefixerContext,
Optional<java.util.function.Consumer<Path>> callUponDirectoryCreation,
Optional<Logger> logger)
Creates an outputter for the experiment in general.
|
MultiLevelOutputEnabled |
determineEnabledOutputs(RecordedOutputsWithRules recordedOutputs)
Determines which outputs are enabled or not.
|
OutputEnabledRules |
getOutputsEnabled()
Which outputs are enabled or not enabled.
|
OutputWriteSettings |
getOutputWriteSettings()
General settings (default file extensions, colors etc.) for outtping files.
|
PathPrefixer |
getPrefixer()
Determines a prefix to use when outputting a file based upon an input-path.
|
boolean |
isSilentlyDeleteExisting()
Whether to silently first delete any existing output at the intended path, or rather throw an
error.
|
void |
setOutputsEnabled(OutputEnabledRules outputsEnabled)
Which outputs are enabled or not enabled.
|
void |
setOutputWriteSettings(OutputWriteSettings outputWriteSettings)
General settings (default file extensions, colors etc.) for outtping files.
|
void |
setPrefixer(PathPrefixer prefixer)
Determines a prefix to use when outputting a file based upon an input-path.
|
void |
setSilentlyDeleteExisting(boolean silentlyDeleteExisting)
Whether to silently first delete any existing output at the intended path, or rather throw an
error.
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public MultiLevelOutputEnabled determineEnabledOutputs(RecordedOutputsWithRules recordedOutputs)
recordedOutputs
- where output-names are recorded as used/tested.MultiLevelOutputEnabled
which indicates which outputs are enabled or not.public OutputWriteContext createContextForWriting(Optional<ImageFileFormat> suggestedFormatToWrite, ExecutionTimeRecorder executionTimeRecorder)
OutputWriteContext
needed for writing files.suggestedFormatToWrite
- a suggestion on what file-format to write.executionTimeRecorder
- for recording the execution-times of operations.public OutputterChecked createExperimentOutputter(Optional<String> experimentIdentifier, MultiLevelOutputEnabled outputsEnabled, Optional<MultiLevelRecordedOutputs> recordedOutputs, OutputWriteContext writeContext, PathPrefixerContext prefixerContext, Optional<java.util.function.Consumer<Path>> callUponDirectoryCreation, Optional<Logger> logger) throws BindFailedException
i.e. this is not an outputter for a specific job.
experimentIdentifier
- if defined, an identifier for the experiment, to be included in
the directory root.outputsEnabled
- which outputs are enabled. This is typically provided via a call to
determineEnabledOutputs(RecordedOutputsWithRules)
.writeContext
- context needed for writing. This is typically provided via a call to
createContextForWriting(Optional, ExecutionTimeRecorder)
.prefixerContext
- parameters for the file-path prefixer.callUponDirectoryCreation
- when defined, this consumer
is called (with the
directory path) when the directory is first created, as it is created lazily only when
first needed.logger
- logger for warning for information messages when outputting.BindFailedException
public PathPrefixer getPrefixer()
This method is called with a binding path from the input to determine a output prefix for each input to an experiment.
public void setPrefixer(PathPrefixer prefixer)
This method is called with a binding path from the input to determine a output prefix for each input to an experiment.
public boolean isSilentlyDeleteExisting()
If true, if an existing output folder (at intended path) is deleted If false, an error is thrown if the folder already exists
public void setSilentlyDeleteExisting(boolean silentlyDeleteExisting)
If true, if an existing output folder (at intended path) is deleted If false, an error is thrown if the folder already exists
public OutputWriteSettings getOutputWriteSettings()
public void setOutputWriteSettings(OutputWriteSettings outputWriteSettings)
public OutputEnabledRules getOutputsEnabled()
public void setOutputsEnabled(OutputEnabledRules outputsEnabled)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.