mcp-flexible

MCP_Flexible

class skimage.graph.MCP_Flexible(costs, offsets=None, fully_connected=True)

Bases: skimage.graph._mcp.MCP

Find minimum cost paths through an N-d costs array.

See the documentation for MCP for full details. This class differs from MCP in that several methods can be overloaded (from pure Python) to modify the behavior of the algorithm and/or create custom algorithms based on MCP. Note that goal_reached can also be overloaded in the MCP class.

__init__(costs, offsets=None, fully_connected=True, sampling=None)

See class documentation.

examine_neighbor(index, new_index, offset_length)

This method is called once for every pair of neighboring nodes, as soon as both nodes are frozen.

This method can be overloaded to obtain information about neightboring nodes, and/or to modify the behavior of the MCP algorithm. One example is the MCP_Connect class, which checks for meeting fronts using this hook.

travel_cost(old_cost, new_cost, offset_length)

This method calculates the travel cost for going from the current node to the next. The default implementation returns new_cost. Overload this method to adapt the behaviour of the algorithm.

update_node(index, new_index, offset_length)

This method is called when a node is updated, right after new_index is pushed onto the heap and the traceback map is updated.

This method can be overloaded to keep track of other arrays that are used by a specific implementation of the algorithm. For instance the MCP_Connect class uses it to update an id map.

doc_scikit_image
2017-01-12 17:21:59
Comments
Leave a Comment

Please login to continue.