bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / graph / _rag / RAG / merge_nodes
function
skimage.graph._rag:RAG.merge_nodes
source: /dev/scikit-image/src/skimage/graph/_rag.py :157
Signature
def merge_nodes ( self , src , dst , weight_func = <function min_weight at 0x0000> , in_place = True , extra_arguments = None , extra_keywords = None ) Summary
Merge node src and dst.
Extended Summary
The new combined node is adjacent to all the neighbors of src and dst. weight_func is called to decide the weight of edges incident on the new node.
Parameters
src, dst: intNodes to be merged.
weight_func: callable, optionalFunction to decide the attributes of edges incident on the new node. For each neighbor
nforsrcanddst,weight_funcwill be called as follows:weight_func(src, dst, n, *extra_arguments, **extra_keywords).src,dstandnare IDs of vertices in the RAG object which is in turn a subclass ofnetworkx.Graph. It is expected to return a dict of attributes of the resulting edge.in_place: bool, optionalIf set to
True, the merged node has the iddst, else merged node has a new id which is returned.extra_arguments: Sequence, optionalThe sequence of extra positional arguments passed to
weight_func.extra_keywords: dictionary, optionalThe dict of keyword arguments passed to the
weight_func.
Returns
id: intThe id of the new node.
Notes
If in_place is False the resulting node has a new id, rather than dst.
Aliases
-
skimage.graph.RAG.merge_nodes