Class ImageLabelStrategy
Assigns a single label per image, as a whole.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionannotationLabelFor
(ProvidesStackInput item, OperationContext context) A human-friendly textual description of the annotation, orOptional.empty()
if no label is available.List ofAnnotationLabel
s available for annotation.int
The weight to use for the width of the description.Creates aGroupedAnnotationLabels
from the current labels.void
setLabels
(List<AnnotationLabel> labels) List ofAnnotationLabel
s available for annotation.void
setWeightWidthDescription
(int weightWidthDescription) The weight to use for the width of the description.int
The degree as to how lengthy the labels fromAnnotatorStrategy.annotationLabelFor(ProvidesStackInput, OperationContext)
can be.Methods inherited from class org.anchoranalysis.plugin.annotation.bean.strategy.SinglePathStrategy
getPathAnnotation, pathFor, setPathAnnotation
Methods inherited from class org.anchoranalysis.annotation.io.bean.AnnotatorStrategy
getBackground, getStackReader, setBackground, setStackReader
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ImageLabelStrategy
public ImageLabelStrategy()
-
-
Method Details
-
annotationLabelFor
public Optional<String> annotationLabelFor(ProvidesStackInput item, OperationContext context) throws OperationFailedException Description copied from class:AnnotatorStrategy
A human-friendly textual description of the annotation, orOptional.empty()
if no label is available.- Specified by:
annotationLabelFor
in classAnnotatorStrategy
- Parameters:
item
- 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.
-
groupedLabels
Creates aGroupedAnnotationLabels
from the current labels.This is actually called twice during a typical opening of an annotation. But overhead is minor (assuming not very many labels).
- Returns:
- a new
GroupedAnnotationLabels
instance.
-
weightWidthDescription
public int weightWidthDescription()Description copied from class:AnnotatorStrategy
The degree as to how lengthy the labels fromAnnotatorStrategy.annotationLabelFor(ProvidesStackInput, OperationContext)
can be.The higher the number, the lengthier
AnnotatorStrategy.annotationLabelFor(ProvidesStackInput, OperationContext)
can be.- Specified by:
weightWidthDescription
in classAnnotatorStrategy
- Returns:
- the weight indicating the potential length of the description.
-
getLabels
List ofAnnotationLabel
s available for annotation. -
setLabels
List ofAnnotationLabel
s available for annotation. -
getWeightWidthDescription
public int getWeightWidthDescription()The weight to use for the width of the description. -
setWeightWidthDescription
public void setWeightWidthDescription(int weightWidthDescription) The weight to use for the width of the description.
-