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 ofAnnotationLabels available for annotation.intThe weight to use for the width of the description.Creates aGroupedAnnotationLabelsfrom the current labels.voidsetLabels(List<AnnotationLabel> labels) List ofAnnotationLabels available for annotation.voidsetWeightWidthDescription(int weightWidthDescription) The weight to use for the width of the description.intThe 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, setPathAnnotationMethods inherited from class org.anchoranalysis.annotation.io.bean.AnnotatorStrategy
getBackground, getStackReader, setBackground, setStackReaderMethods 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:AnnotatorStrategyA human-friendly textual description of the annotation, orOptional.empty()if no label is available.- Specified by:
annotationLabelForin classAnnotatorStrategy- Parameters:
item- the input to find an annotation label for.context- theOperationContextfor the operation.- Returns:
- the label, if available.
- Throws:
OperationFailedException- if a label cannot be successfully determined.
-
groupedLabels
Creates aGroupedAnnotationLabelsfrom 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
GroupedAnnotationLabelsinstance.
-
weightWidthDescription
public int weightWidthDescription()Description copied from class:AnnotatorStrategyThe 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:
weightWidthDescriptionin classAnnotatorStrategy- Returns:
- the weight indicating the potential length of the description.
-
getLabels
List ofAnnotationLabels available for annotation. -
setLabels
List ofAnnotationLabels 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.
-