Commit Graph

8 Commits

Author SHA1 Message Date
Almar Klein 3cb5a19479 Update MCP: Put back the traceback() method.
I initially changed it to allow faster (flat) tracebacks *during*
front evolution, but it turned out not to be necessary. Putting back
to minimize the changes of this PR.
2014-01-03 15:09:06 +01:00
Almar Klein f7416507fa update-mcp: Small fix.
Need _start and _end attributes for the MCP class.
It worked for my own tests because I overloaded the MCP class.
2013-12-13 16:37:36 +01:00
Almar Klein 798bea7251 update-mcp: Refactor MCP algorithm in prep for MCP subclasses
Installed a few hooks to allow more flexibility in subclasses, refactored
traceback() to allow obtaining tracebacks fast during front evolution, and
moved some initializations to reset().

Full list:
* integer division in calculating indices
* traceback_offsets use -2 for uninitialized, -1 for seed point. In that
  we we can distinguish between these two cases in traceback()
* Clearing of traceback_offset, cumulative_costs, pushing start positions
  into the heap, are now all done in reset()
* Reset is called every time that find_cost is called.
* Add hook _goal_reached()
* Add hook _examine_neighbor()
* Add hook _update_node()
* Replace while loop with a for-loop to prevent infinite looping in case of a bug.
* Split traceback() in two functions to allow getting a flat traceback fast.
  traceback() calles these two private functions and behaves as just before.
2013-12-13 15:13:24 +01:00
Almar Klein 280fadff39 MCP: refactored to use typed memoryviews
The arrays are stored on the mcp object, so that they can
be used in methods as well. Will use that to make MCP more
flexibel.
2013-12-13 15:13:24 +01:00
Johannes Schönberger 62d83ad42c Globally change np to cnp if cimported 2013-02-24 14:14:14 +01:00
Zach Pincus ffff4a3077 BUG: MCP could segfault in places where both positive and negative moves would go out of bounds.
Previous assumption was that no location in the array would be one move from both upper and lower boundaries. This assumption is now removed.
2012-06-06 23:52:33 -04:00
Zach Pincus ea63e7d709 use 64-bit safe types 2011-11-07 15:51:39 -05:00
Nelle Varoquaux 114cf44c77 Renamed scikits.image to skimage 2011-10-18 21:12:27 +02:00