Commit Graph

153 Commits

Author SHA1 Message Date
Vighnesh Birodkar 850f835114 Docs formatting 2014-06-19 02:50:24 +05:30
Vighnesh Birodkar 10f91fe8b0 Added docs 2014-06-19 02:50:24 +05:30
Vighnesh Birodkar abcb9cf2ef Added testcase 2014-06-19 02:50:24 +05:30
Vighnesh Birodkar a6c9a5a2a7 Renamed graph.py to rag.py 2014-06-19 02:50:24 +05:30
Vighnesh Birodkar 53077c9f22 Added edge threshold cut 2014-06-19 02:50:24 +05:30
Vighnesh Birodkar 2b10d98179 Added mean color RAG construction code 2014-06-19 02:50:24 +05:30
Johannes Schönberger f4f509fa8d Fix cython compilation warnings 2014-05-05 14:37:15 -04:00
cgohlke b06d160cb7 Fix TypeError: __class__ assignment: 'TestFlexibleMCP' object layout differs from 'UnboundSelf' 2014-03-10 23:40:14 -07:00
Almar Klein 14288e1f1e PEP8 stuff. 2014-01-06 12:39:13 +01:00
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 9113d5a08b update-mcp: add tests for MCP_Flexible 2013-12-15 13:32:15 +01:00
Almar Klein fc90a164fe update-mcp: improvements to docstrings. 2013-12-15 12:44:53 +01:00
Almar Klein 789ade3ca2 update-mcp: added tests for newly added features.
Also fix in existing test related to how the traceback arrays is initialized:
first it was initialized with all -1, now with -2, and -1 at the seed points.
2013-12-15 00:37:27 +01:00
Almar Klein fdd880aa7f update-mcp: add new MCP classes to skimage.graph namespace 2013-12-14 23:58:45 +01:00
Almar Klein 2ebeee2df4 update-mcp: Change when examine_neighbors is called.
Also renamed Mcp_Connect to MCP_Connect.

Makes more sense to call it when the neighbor is frozen. In that
way the method is called exactly once for each pair of neighbours.
Plus the costs and paths are known and fixed.
2013-12-14 23:55:48 +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 32c4a80b32 update-mcp: Add MCP_Flexible subclass.
This class adds a public def-method for the private cdef-method hooks.
This allows users to influence the behavior of the MCP algorithm by
subclassing it in pure Python.
2013-12-13 15:13:24 +01:00
Almar Klein 8fe7416d41 update-mcp: Add MCP_Connect class
This class finds the connections between the given seed points. This is
a bit similar to finding connections between start and end points, except
now start- and endpoints are the same.
2013-12-13 15:13:24 +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
Almar Klein d1329488e6 MCP: add sampling attribute: deal with anisotropic data. 2013-12-13 15:13:24 +01:00
Almar Klein f5c675b8c6 MCP: turn while loop into for loop to prevent infinite looping.
A nice feature during development :)
2013-12-13 15:13:24 +01:00
Almar Klein 8d09300155 Improve speed of MPC by about 30%
Dear diary, I spend a whole day searching for why this implementation
of the MPC was slower then my own implementation. I checked *everything*.
I rewrote the front evolution to match with mine almost exactly. I was
about to give up. And then I saw this... Arg!
2013-12-13 15:13:24 +01:00
Almar Klein 4b2136bc7d Make mcp evolution algorithm a bit more readable.
In particular, distinguish between cost and cumcost, the same
variable name was used for this.
2013-12-13 15:13:24 +01:00
Johannes Schönberger 93e83b347f Improve tests of graph package 2013-08-19 18:37:30 +02:00
François Boulogne b9572e8c68 remove commented lines 2013-06-20 22:47:08 +02:00
François Boulogne 0a4fcdad0a fix imports 2013-06-20 22:46:37 +02:00
Johannes Schönberger 3e278fadb4 Add __all__ to graph package 2013-04-28 23:20:00 +02:00
Josh Warner (Mac) 0eea2a48fe Fix Cython 0.19 build error due to global wraparound=False 2013-04-24 21:47:37 -05:00
Johannes Schönberger 62d83ad42c Globally change np to cnp if cimported 2013-02-24 14:14:14 +01:00
Johannes Schönberger 614023b941 Replace ssize_t with Py_ssize_t globally 2013-02-22 17:05:38 +01:00
Johannes Schönberger 0b99eb68f4 Change type to ssize_t for all index and size variables 2013-02-22 17:05:10 +01:00
Paul Ivanov b4b090271d complete singularization of scikit-image
I've updated references in the code and documentation to the new name.
2012-10-08 16:29:55 -07:00
Andreas Mueller 6c59e04714 MISC remove unused imports, some pep8 corrections. 2012-09-27 20:01:45 +01:00
Tony S Yu a58ce5b571 DOC: Add missing import in doctest 2012-09-11 23:39:08 -04:00
Stefan van der Walt 2949d18247 Merge pull request #295 from tonysyu/doc-cleanups
Doc cleanups
2012-09-02 22:12:13 -07:00
Tony S Yu 427a79fc6a STY: Clean up whitespace 2012-09-02 19:32:45 -04:00
Tony S Yu 27cac73e16 DOC: Fix section titles to match numpy doc standard 2012-09-02 18:33:38 -04:00
Emmanuelle Gouillart 6b86d4beee DOC: docstring of route_through_array 2012-08-27 17:47:34 +02:00
Emmanuelle Gouillart d5710c82ab Example in route_through_array 2012-08-27 17:04:25 +02:00
Johannes Schönberger a08779e06a Use predefined header files from Cython 2012-08-21 15:15:27 +02:00
Andreas Mueller d7f1a3abec COSMIT minor stype improvements, whitespace in error messages 2012-06-29 11:27:23 +02:00
Andreas Mueller ee0fd867da COSMIT fix ugly line breaks. 2012-06-29 11:27:23 +02:00
Andreas Mueller f7b3d8062c COSMIT pep8 2012-06-29 11:27:23 +02:00
Zach Pincus 8f237dbefe ENH: Add tests for boundary-overlapping offsets 2012-06-07 09:02:31 -04:00
Zach Pincus 79972c3013 Indent 4 2012-06-07 08:55:35 -04: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
Stefan van der Walt e99f18be5a BUG: Fix imports for Python 3.2. 2012-03-03 11:18:16 -08:00
Stefan van der Walt bf609dfca0 DOC: Fix some scikits.image mentions. 2011-12-02 10:55:41 -08:00
Zach Pincus 9307bcb5bc fix _spath error 2011-11-08 15:19:12 -05:00