T - value type of the input image.public final class PixelListComponentTree<T extends Type<T>> extends Object implements ComponentTree<PixelListComponent<T>>, Iterable<PixelListComponent<T>>, PartialComponent.Handler<net.imglib2.algorithm.componenttree.pixellist.PixelListPartialComponent<T>>
PixelListComponents.
This class is used both to represent and build the tree.
TODO Add support for non-zero-min RandomAccessibleIntervals. (Currently, we assume that the input image is a zero-min interval.)
| Modifier and Type | Method and Description |
|---|---|
static <T extends RealType<T>> |
buildComponentTree(RandomAccessibleInterval<T> input,
T type,
boolean darkToBright)
Build a component tree from an input image.
|
static <T extends Type<T>> |
buildComponentTree(RandomAccessibleInterval<T> input,
T maxValue,
Comparator<T> comparator)
Build a component tree from an input image.
|
static <T extends Type<T>> |
buildComponentTree(RandomAccessibleInterval<T> input,
T maxValue,
Comparator<T> comparator,
ImgFactory<LongType> imgFactory)
Build a component tree from an input image.
|
static <T extends RealType<T>> |
buildComponentTree(RandomAccessibleInterval<T> input,
T type,
ImgFactory<LongType> imgFactory,
boolean darkToBright)
Build a component tree from an input image.
|
void |
emit(net.imglib2.algorithm.componenttree.pixellist.PixelListPartialComponent<T> partialComponent)
BuildComponentTree calls this for every completed component. |
Iterator<PixelListComponent<T>> |
iterator()
Returns an iterator over all connected components in the tree.
|
PixelListComponent<T> |
root()
Get the root component.
|
Set<PixelListComponent<T>> |
roots()
Get the root component.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static <T extends RealType<T>> PixelListComponentTree<T> buildComponentTree(RandomAccessibleInterval<T> input, T type, boolean darkToBright)
buildComponentTree(RandomAccessibleInterval, RealType, ImgFactory, boolean)
using an ArrayImgFactory or CellImgFactory depending on
input image size.input - the input image.type - a variable of the input image type.darkToBright - whether to apply thresholds from dark to bright (true) or
bright to dark (false)public static <T extends RealType<T>> PixelListComponentTree<T> buildComponentTree(RandomAccessibleInterval<T> input, T type, ImgFactory<LongType> imgFactory, boolean darkToBright)
input - the input image.type - a variable of the input image type.imgFactory - used for creating the PixelList image (see
PixelListPartialComponentGenerator).darkToBright - whether to apply thresholds from dark to bright (true) or
bright to dark (false)public static <T extends Type<T>> PixelListComponentTree<T> buildComponentTree(RandomAccessibleInterval<T> input, T maxValue, Comparator<T> comparator)
buildComponentTree(RandomAccessibleInterval, Type, Comparator, ImgFactory)
using an ArrayImgFactory or CellImgFactory depending on
input image size.input - the input image.maxValue - a value (e.g., grey-level) greater than any occurring in the
input image.comparator - determines ordering of threshold values.public static <T extends Type<T>> PixelListComponentTree<T> buildComponentTree(RandomAccessibleInterval<T> input, T maxValue, Comparator<T> comparator, ImgFactory<LongType> imgFactory)
input - the input image.maxValue - a value (e.g., grey-level) greater than any occurring in the
input image.comparator - determines ordering of threshold values.imgFactory - used for creating the PixelList image
PixelListPartialComponentGenerator.public void emit(net.imglib2.algorithm.componenttree.pixellist.PixelListPartialComponent<T> partialComponent)
PartialComponent.HandlerBuildComponentTree calls this for every completed component.
NOTE THAT THE COMPONENT IS RE-USED BY BuildComponentTree!
That is, after calling emit() new pixels may be added, etc. Do not
store the component object but rather copy the relevant data!emit in interface PartialComponent.Handler<net.imglib2.algorithm.componenttree.pixellist.PixelListPartialComponent<T extends Type<T>>>partialComponent - a completed componentpublic Iterator<PixelListComponent<T>> iterator()
public PixelListComponent<T> root()
root in interface ComponentTree<PixelListComponent<T extends Type<T>>>public Set<PixelListComponent<T>> roots()
roots in interface ComponentForest<PixelListComponent<T extends Type<T>>>Copyright © 2015–2022 ImgLib2. All rights reserved.