class neuroglancer.EquivalenceMap

Union-find data structure.

Public members

EquivalenceMap(existing=None_readonly=False)

Create a new empty union-find structure.

__getitem__(obj: int-> int

Returns the minimum element in the set containing the specified element.

__iter__(-> Iterator[int]

Iterates over all elements known to this equivalence map.

items(-> ItemsView[int, int]
keys(-> KeysView[int]
clear()
union(*elements: int-> int | None

Unions the equivalence classes containing the specified elements.

members(element: int-> Iterator[int]

Yields the members of the equivalence class containing the specified element.

sets(-> frozenset[frozenset[int]]

Returns the equivalence classes as a set of sets.

to_json(-> list[list[int]]

Returns the equivalence classes a sorted list of sorted lists.

__copy__(-> EquivalenceMap

Does not preserve _readonly attribute.

__deepcopy__(memo-> EquivalenceMap

Does not preserve _readonly attribute.

copy(-> EquivalenceMap

Returns a copy of the equivalence map.

delete_set(element: int)

Removes the equivalence class containing the specified element.

isolate_element(element: int)

Isolates the specified element from its equivalence class.