Package org.anchoranalysis.annotation.io
Class AnnotationWithStrategy<T extends AnnotatorStrategy>
Object
org.anchoranalysis.io.input.InputFromManagerDelegate<ProvidesStackInput>
org.anchoranalysis.annotation.io.AnnotationWithStrategy<T>
- Type Parameters:
T- type of annotation-strategy.
- All Implemented Interfaces:
org.anchoranalysis.io.input.InputFromManager
public class AnnotationWithStrategy<T extends AnnotatorStrategy> extends org.anchoranalysis.io.input.InputFromManagerDelegate<ProvidesStackInput>
One particular annotation, associated with its strategy.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description AnnotationWithStrategy(ProvidesStackInput input, T strategy)Creates for a particular input and associated annotation strategy. -
Method Summary
Modifier and Type Method Description Optional<File>associatedFile()The file associated with the annotation, if such a file exists.PathgetPath()Path to annotation.TgetStrategy()The strategy on how annotation occurs.Optional<String>label(org.anchoranalysis.core.time.OperationContext context)A human-friendly textual description of the annotation, orOptional.empty()if no label is available.org.anchoranalysis.image.core.stack.named.NamedStacksSupplierstacks(org.anchoranalysis.core.log.Logger logger)All stacks associated with the input, lazily evaluated.Methods inherited from class org.anchoranalysis.io.input.InputFromManagerDelegate
close, getDelegate, identifier, pathForBinding, toString
-
Constructor Details
-
AnnotationWithStrategy
public AnnotationWithStrategy(ProvidesStackInput input, T strategy) throws org.anchoranalysis.core.exception.OperationFailedExceptionCreates for a particular input and associated annotation strategy.- Parameters:
input- the input.strategy- the strategy.- Throws:
org.anchoranalysis.core.exception.OperationFailedException- if a path cannot be determined bystrategyfor the respectiveinput.
-
-
Method Details
-
associatedFile
The file associated with the annotation, if such a file exists.- Returns:
- the file, if it exists.
-
label
public Optional<String> label(org.anchoranalysis.core.time.OperationContext context) throws org.anchoranalysis.core.exception.OperationFailedExceptionA human-friendly textual description of the annotation, orOptional.empty()if no label is available.- Parameters:
context- context for reading a stack from the file-system.- Returns:
- the label, if available.
- Throws:
org.anchoranalysis.core.exception.OperationFailedException- if a label cannot be successfully determined.
-
stacks
public org.anchoranalysis.image.core.stack.named.NamedStacksSupplier stacks(org.anchoranalysis.core.log.Logger logger)All stacks associated with the input, lazily evaluated.The stacks are cached the first time they are evaluated, to avoid repeated computation.
- Parameters:
logger- a logger for any non-fatal errors. Fatal errors throw an exception.- Returns:
- a supplier of the stacks.
-
getStrategy
The strategy on how annotation occurs. -
getPath
Path to annotation.
-