T - the desired type of the pixel labels, for instance Integer
to number objects or String for user-assigned label names.public class LabelingMapping<T> extends Object
intern(Set) function that supplies a canonical object for each set
of labelings in a container, and functions
addLabelToSetAtIndex(Object, int),
removeLabelFromSetAtIndex(Object, int) for efficiently adding and
removing labels to the set at a given index value.| Modifier and Type | Class and Description |
|---|---|
static class |
LabelingMapping.SerialisationAccess<T>
Deprecated.
Use
getLabelSets() or
setLabelSets(List) instead.
Internals. Can be derived for implementing de/serialisation of the
|
| Constructor and Description |
|---|
LabelingMapping(IntegerType<?> indexType)
Create a new
LabelingMapping that maps label sets to the given
integral indexType. |
| Modifier and Type | Method and Description |
|---|---|
Set<T> |
getLabels()
Return the set of all labels defined in this
LabelingMapping. |
List<Set<T>> |
getLabelSets()
Returns a snapshot of the
LabelingMapping represented as a list
of sets. |
Set<T> |
labelsAtIndex(int index)
Returns the (unmodifiable) set of labels for the given index value.
|
int |
numSets()
Returns the number of indexed labeling sets
|
void |
setLabelSets(List<Set<T>> labelSets)
Replaces the current label mapping, with the mapping given as list of
sets.
|
public LabelingMapping(IntegerType<?> indexType)
LabelingMapping that maps label sets to the given
integral indexType.public int numSets()
public Set<T> labelsAtIndex(int index)
public Set<T> getLabels()
LabelingMapping.public List<Set<T>> getLabelSets()
LabelingMapping represented as a list
of sets.
List.get(int) of the returned list will give the same value
labelsAtIndex(int). The size of the return listed
equals numSets().
public void setLabelSets(List<Set<T>> labelSets)
WARNING: Using this method could easily result in a malfunctioning
ImgLabeling. This is certainly the case, if values of the index
image don't map to any value in this list. This is the case, if the index
image contains negative values or values greater than or equal to the
size of the list.
labelSets - The given list must not be empty. The first entry must be the
empty set. All list entries must be unique. If used together
with a ImgLabeling, a pixel in the index image will be
mapped to the set with the given index in the list.getLabelSets()Copyright © 2009–2019 ImgLib2. All rights reserved.