Class AnnotatorStrategy
- Direct Known Subclasses:
SinglePathStrategy
How an input is associated with annotations on the file-system, and how this is presented
visually.
This class gives instructions on how to present the annotations process visually.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionannotationLabelFor
(ProvidesStackInput input, OperationContext context) A human-friendly textual description of the annotation, orOptional.empty()
if no label is available.The visual background to use while annotating.How to read rasterStack
s from the file-system.abstract Path
pathFor
(ProvidesStackInput input) The path to where an annotation file for a particular input would be located.void
setBackground
(AnnotationBackground background) The visual background to use while annotating.void
setStackReader
(StackReader stackReader) How to read rasterStack
s from the file-system.abstract int
The degree as to how lengthy the labels fromannotationLabelFor(ProvidesStackInput, OperationContext)
can be.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
AnnotatorStrategy
public AnnotatorStrategy()
-
-
Method Details
-
pathFor
The path to where an annotation file for a particular input would be located.If the annotation is stored on multiple files, this refers to the principle file that must be unique.
- Parameters:
input
- the input to find an annotation file for.- Returns:
- the path to where the annotation would be expected to be.
- Throws:
OperationFailedException
- if the path cannot be successfully determined.
-
annotationLabelFor
public abstract Optional<String> annotationLabelFor(ProvidesStackInput input, OperationContext context) throws OperationFailedException A human-friendly textual description of the annotation, orOptional.empty()
if no label is available.- Parameters:
input
- the input to find an annotation label for.context
- theOperationContext
for the operation.- Returns:
- the label, if available.
- Throws:
OperationFailedException
- if a label cannot be successfully determined.
-
weightWidthDescription
public abstract int weightWidthDescription()The degree as to how lengthy the labels fromannotationLabelFor(ProvidesStackInput, OperationContext)
can be.The higher the number, the lengthier
annotationLabelFor(ProvidesStackInput, OperationContext)
can be.- Returns:
- the weight indicating the potential length of the description.
-
getBackground
The visual background to use while annotating. -
setBackground
The visual background to use while annotating. -
getStackReader
How to read rasterStack
s from the file-system. -
setStackReader
How to read rasterStack
s from the file-system.
-