public interface UnionFind
Modifier and Type | Method and Description |
---|---|
long |
findRoot(long id) |
long |
join(long root1,
long root2)
Join two sets represented by
root1 and root2 |
static <B extends BooleanType<B>,L extends IntegerType<L>> |
relabel(RandomAccessibleInterval<B> mask,
RandomAccessibleInterval<L> labeling,
UnionFind unionFind,
ToLongBiFunction<Localizable,L> idForPixel,
LongUnaryOperator idForSet)
Relabel all mask pixels into the representative id of their containing
sets as defined by
unionFind . |
default <L extends IntegerType<L>> |
relabel(RandomAccessibleInterval<L> labeling)
Relabel all pixels into the representative id of their containing
sets as defined by
unionFind . |
default <B extends BooleanType<B>,L extends IntegerType<L>> |
relabel(RandomAccessibleInterval<L> labeling,
ToLongBiFunction<Localizable,L> idForPixel,
LongUnaryOperator idForSet)
Relabel all pixels into the representative id of their containing
sets as defined by
unionFind . |
long |
setCount() |
long |
size() |
long findRoot(long id)
id
- id
long join(long root1, long root2)
root1
and root2
root1
- root2
- long size()
long setCount()
static <B extends BooleanType<B>,L extends IntegerType<L>> void relabel(RandomAccessibleInterval<B> mask, RandomAccessibleInterval<L> labeling, UnionFind unionFind, ToLongBiFunction<Localizable,L> idForPixel, LongUnaryOperator idForSet)
unionFind
.mask
- Boolean mask to distinguish foreground (true
) from
background (false
).labeling
- Output parameter to store labeling: background pixels are
labeled zero, foreground pixels are greater than zero: 1, 2,
..., N. Note that this is expected to be zero as background
values will not be written.unionFind
- UnionFind
idForPixel
- Create id from pixel location and value. Multiple calls with
the same argument should always return the same result.idForSet
- Create id for a set from the root id of a set. Multiple calls
with the same argument should always return the same result.default <B extends BooleanType<B>,L extends IntegerType<L>> void relabel(RandomAccessibleInterval<L> labeling, ToLongBiFunction<Localizable,L> idForPixel, LongUnaryOperator idForSet)
unionFind
.labeling
- Output parameter to store labeling: background pixels are
labeled zero, foreground pixels are greater than zero: 1, 2,
..., N. Note that this is expected to be zero as background
values will not be written.idForPixel
- Create id from pixel location and value. Multiple calls with
the same argument should always return the same result.idForSet
- Create id for a set from the root id of a set. Multiple calls
with the same argument should always return the same result.default <L extends IntegerType<L>> void relabel(RandomAccessibleInterval<L> labeling)
unionFind
.labeling
- Output parameter to store labeling: background pixels are
labeled zero, foreground pixels are greater than zero: 1, 2,
..., N. Note that this is expected to be zero as background
values will not be written.Copyright © 2015–2022 ImgLib2. All rights reserved.