Class ImageLabellerStringMap<T>
- Type Parameters:
T
- the init-param-type of filter that is the delegate
public class ImageLabellerStringMap<T>
extends ImageLabeller<ImageLabellerStringMapInitialization<T>>
Maps one set of labels to another
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallLabels
(ImageLabellerStringMapInitialization<T> initialization) Returns a set of identifiers for all groups that can be outputted by the labeller.getMap()
initialize
(Path pathForBinding) Initializes the labeller.labelFor
(ImageLabellerStringMapInitialization<T> sharedState, ProvidesStackInput input, InputOutputContext context) Determines a particular group-identifier (label) for an input.void
setFilter
(ImageLabeller<T> filter) void
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ImageLabellerStringMap
public ImageLabellerStringMap()
-
-
Method Details
-
initialize
public ImageLabellerStringMapInitialization<T> initialize(Path pathForBinding) throws InitializeException Description copied from class:ImageLabeller
Initializes the labeller. Should be called once before calling any other methods.- Specified by:
initialize
in classImageLabeller<ImageLabellerStringMapInitialization<T>>
- Parameters:
pathForBinding
- aPath
that can be used by the labeller to make file path decisions- Returns:
- the initialized shared-state of type
T
- Throws:
InitializeException
- if initialization fails
-
allLabels
Description copied from class:ImageLabeller
Returns a set of identifiers for all groups that can be outputted by the labeller.This method should be callable at any time.
- Specified by:
allLabels
in classImageLabeller<ImageLabellerStringMapInitialization<T>>
- Parameters:
initialization
- the initialized shared-state returned byImageLabeller.initialize(Path)
- Returns:
- a
Set
ofString
labels
-
labelFor
public String labelFor(ImageLabellerStringMapInitialization<T> sharedState, ProvidesStackInput input, InputOutputContext context) throws OperationFailedException Description copied from class:ImageLabeller
Determines a particular group-identifier (label) for an input.- Specified by:
labelFor
in classImageLabeller<ImageLabellerStringMapInitialization<T>>
- Parameters:
sharedState
- the shared-state returned byImageLabeller.initialize(Path)
input
- theProvidesStackInput
to be labelledcontext
- theInputOutputContext
for the operation- Returns:
- the label as a
String
- Throws:
OperationFailedException
- if the labelling operation fails
-
getFilter
-
setFilter
-
getMap
-