medpy.graphcut.graph.Graph.add_tweights¶
-
Graph.
add_tweights
(tweights)[source]¶ Adds t-weights to the current collection of t-weights, overwriting already existing ones.
Parameters: tweights : dict
A dictionary with node_ids as keys and (weight-to-source, weight-to-sink) tuples as values.
Notes
The weights for nodes directly connected to either the source or the sink are best set using
set_source_nodes
orset_sink_nodes
to ensure consistency of their maximum values.