Class DecodeLabels<T>
Object
DecodeLabels<T>
- Type Parameters:
T
- element-type (an object-mask, or some class containing an object-mask).
Decodes a labelled raster into derived objects or object-like elements.
- Author:
- Owen Feehan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Creates an element from the scaled-object and its index. -
Constructor Summary
ConstructorsConstructorDescriptionDecodeLabels
(Voxels<?> voxels, int minLabelInclusive, int maxLabelInclusive, DecodeLabels.CreateElementFromScaledObject<T> createScaledElement) Creates a newDecodeLabels
instance. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(int smallVolumeThreshold) Creates a list of elements from voxels that are labelled with unique integers (sequentially increasing).Creates a map of elements to other elements that are labelled with unique integers (sequentially increasing) in voxels.
-
Constructor Details
-
DecodeLabels
public DecodeLabels(Voxels<?> voxels, int minLabelInclusive, int maxLabelInclusive, DecodeLabels.CreateElementFromScaledObject<T> createScaledElement) Creates a newDecodeLabels
instance.- Parameters:
voxels
- Voxels each labelled with an integer (sequentially increasing from 1) to represent an object.minLabelInclusive
- Minimum label-value inclusive.maxLabelInclusive
- Maximum label-value inclusive.createScaledElement
- Create scaled element from a scaled-object and corresponding index.
-
-
Method Details
-
create
public Map<T,T> create(Map<Integer, T> labelMap, UnaryOperator<T> operationAfterScaling) throws CreateExceptionCreates a map of elements to other elements that are labelled with unique integers (sequentially increasing) in voxels.- Parameters:
labelMap
- a map from a label to what becomes the key in the output map (each label should map to a unique key).operationAfterScaling
- an operation to apply after labelling, but before the element is placed in the map.- Returns:
- a map constructed key from
labelMap
and value as the element is derived from the label - for each label. - Throws:
CreateException
- if bounding-boxes cannot be derived.
-
create
Creates a list of elements from voxels that are labelled with unique integers (sequentially increasing).- Parameters:
smallVolumeThreshold
- minimum volume of bounding-box otherwise a label is ignored.- Returns:
- a list of respective elements, one for each label.
- Throws:
CreateException
- if bounding-boxes cannot be derived.
-