public class NeighborGraph extends Object
ObjectMask
and edges between indicate
that two objects neighbor each other.
The weight associated with the edge, indicates the number of neighbvoring voxels, which is always a positive integer.
Modifier and Type | Method and Description |
---|---|
static <V> GraphWithPayload<V,Integer> |
create(List<V> vertices,
java.util.function.Function<V,ObjectMask> vertexToObject,
Extent sceneExtent,
boolean preventObjectIntersection,
boolean do3D)
Like
create(ObjectCollection, Extent, boolean, boolean) but extracts objects from a
list of elements which form the vertices. |
static GraphWithPayload<ObjectMask,Integer> |
create(ObjectCollection objects,
Extent sceneExtent,
boolean preventObjectIntersection,
boolean do3D)
Create the graph with object-masks as vertices, where edges represent the number of
neighboring voxels between objects.
|
public static GraphWithPayload<ObjectMask,Integer> create(ObjectCollection objects, Extent sceneExtent, boolean preventObjectIntersection, boolean do3D) throws CreateException
objects
- objects to create a graph of neighbors for, and who become the vertices in the
graph.sceneExtent
- the size of the image, the object-masks exist in.preventObjectIntersection
- iff true, objects can only be neighbors, if they have no
intersecting voxels.do3D
- if true, the Z-dimension is also considered for neighbors. Otherwise, only the X
and Y dimensions.CreateException
- if any objects are not fully contained in the scene.public static <V> GraphWithPayload<V,Integer> create(List<V> vertices, java.util.function.Function<V,ObjectMask> vertexToObject, Extent sceneExtent, boolean preventObjectIntersection, boolean do3D) throws CreateException
create(ObjectCollection, Extent, boolean, boolean)
but extracts objects from a
list of elements which form the vertices.V
- vertex-type from which an object-mask must be derivable.vertices
- the elements to construct graph from, each which maps uniquely to an ObjectMask
.vertexToObject
- converts the vertex to a unique object-mask. This function is called
repeatedly so should have low computational-cost to call.sceneExtent
- the size of the image, the object-masks exist in.preventObjectIntersection
- iff true, objects can only be neighbors, if they have no
intersecting voxels.do3D
- if true, the Z-dimension is also considered for neighbors. Otherwise, only the X
and Y dimensions.CreateException
- if any objects are not fully contained in the scene.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.