Commit Graph

226 Commits

Author SHA1 Message Date
Guillem Palou Visa 15c2989158 Added deprecation warning 2014-01-17 16:52:44 +01:00
Guillem Palou Visa f461d76004 Fixed minor documentation issues 2014-01-12 17:03:10 +00:00
Guillem Palou Visa 4982b00f0c Labels start at 0, for backward compatibility
Code is PEP8 compliant
2013-12-24 18:45:55 +01:00
Guillem Palou Visa 9178e77aef Changed variable names for readbility, fixed PEP8 compliance 2013-12-24 13:25:48 +01:00
Guillem Palou Visa a50b05eeb8 Fixing some code, minor revision 2013-12-24 12:00:21 +01:00
Guillem Palou Visa 08dc3a33d0 Changed coding style to be compliant with PEP8 2013-12-24 11:35:21 +01:00
Guillem Palou 53a4388e26 Changed tests to begin segment label at 1 instead of 0 2013-12-23 14:44:23 +01:00
Guillem Palou e68ab76b24 Added max_size as a parameter 2013-12-23 01:17:51 +01:00
Guillem Palou 0d6540a82c Changed SLIC superpixels so that connectivity is enforced optionally.
A separate, private function is created that implements the postprocessing step
2013-12-23 00:49:06 +01:00
Guillem Palou 8db9096b20 Enforce SLIC superpixels connectivity 2013-12-20 09:18:14 +01:00
Johannes Schönberger 4033566ae6 Add test for invalid parameter combination 2013-11-22 12:22:10 +01:00
Johannes Schönberger e74db662cb Add test case for *_boundaries functions 2013-11-21 23:58:39 +01:00
Johannes Schönberger b4c190e560 Explicitly set sigma value to 0 to avoid warning 2013-11-12 08:27:14 +01:00
Johannes Schönberger 7f27d5bffb Fix label2rgb bug 2013-11-09 22:04:28 +01:00
Johannes Schönberger 615866ae16 Cast label_field to integer dtype for float intput 2013-11-09 21:56:18 +01:00
Andreas Mueller 96f04ad530 slight performance improvement. 2013-10-20 15:15:55 -07:00
Andreas Mueller 57e37352cb FIX add missing min_size parameter, add regression test. 2013-10-20 15:15:36 -07:00
François Boulogne eb4c5c9ee4 PEP8 2013-10-14 16:14:30 +02:00
Josh Warner (Mac) 961c47e801 DOC: Fix minor typo in docstring 2013-10-13 12:40:00 -05:00
Josh Warner (Mac) 927ba2cd8e FIX: roll back incorrect testing change of gradient order 2013-10-13 12:39:13 -05:00
Josh Warner (Mac) f25ca3a835 ENH: spacing kwarg for random_walker and improved tests 2013-10-13 12:39:13 -05:00
Josh Warner (Mac) e5e1918a2b REBASE: Resolve first conflict 2013-10-13 12:38:35 -05:00
Stefan van der Walt dca255648f Merge pull request #759 from jni/supress-umf
Suppress error message during failed UmfpackContext import.
2013-10-11 09:57:30 -07:00
Juan Nunez-Iglesias bfaf89e2f3 Deprecate default mode 'bf' in random_walker 2013-10-08 13:23:50 +11:00
Juan Nunez-Iglesias fb86bac350 Add comment and links explaining Umfpack import 2013-10-07 13:33:17 +11:00
Juan Nunez-Iglesias 248ac46dae Remove unused imports in random_walker source 2013-10-07 13:25:13 +11:00
Juan Nunez-Iglesias fc15f75f8d Monkey-patch UmfpackContext __del__
By putting the failing statement in a try: except: clause, the
exception is caught and the error message is silenced.

See
https://groups.google.com/d/msg/scikit-image/FrM5IGP6wh4/1hp-FtVZmfcJ
and
http://stackoverflow.com/questions/13977970/ignore-exceptions-printed-to-stderr-in-del/13977992?noredirect=1#comment28386412_13977992
2013-10-05 14:27:51 +10:00
Juan Nunez-Iglesias a15312e3c8 Only raise umfpack warning if cg mode is used 2013-10-04 15:21:50 +10:00
Juan Nunez-Iglesias a9afb241cc Rename deprecated relabel_from_one in docstring example 2013-10-03 16:23:30 +10:00
Juan Nunez-Iglesias a8488bfecd Remove deprecated use of relabel_from_one 2013-10-03 16:14:30 +10:00
Juan Nunez-Iglesias bfab493133 Add new tests for relabel_sequential 2013-10-03 16:11:52 +10:00
Juan Nunez-Iglesias 37f66f769b Add relabel_sequential to __init__ import 2013-10-03 16:09:27 +10:00
Juan Nunez-Iglesias 1843829917 Add relabel_sequential, deprecate relabel_from_one 2013-10-03 16:08:29 +10:00
François Boulogne 628d484942 DOC: no import numpy in doc 2013-10-02 18:14:21 +02:00
Tony S Yu 4ab166bba4 Merge pull request #726 from jni/fix-relabel-doc
Fix errors in relabel_from_one docs; PEP8
2013-09-29 16:03:56 -07:00
Johannes Schönberger 8fb6fd02a0 Scale sigma only in scalar case 2013-09-26 16:52:58 +02:00
Johannes Schönberger 845d083470 Define 1d arrays as contiguous 2013-09-22 07:22:09 +02:00
Juan Nunez-Iglesias 54530d16f6 Update snippets in notes to use double backticks 2013-09-22 13:37:04 +10:00
Juan Nunez-Iglesias e17e7699b3 Add note about (z, y, x) order in slic cython doc 2013-09-21 00:12:12 +10:00
Juan Nunez-Iglesias 05fbc3fbfc Bug fix: typo: wrote spacing instead of sigma 2013-09-16 22:42:48 +10:00
Juan Nunez-Iglesias 00e5ff263b Add spacing descriptions; use np.double
Implement @ahojnnes's comments on pull request. Use `np.double` as
dtype for arrays because in Cython, `float` is not `np.double`. And
add further clarification about the `spacing` parameter.
2013-09-16 21:26:44 +10:00
Juan Nunez-Iglesias 846765e5f9 Add spacing support for new, speeded-up SLIC 2013-09-16 17:52:25 +10:00
Juan Nunez-Iglesias 610a0d1793 Add support for list sigma input in SLIC
Previously, having a different `sigma` for different dimensions
required an array input. This allows the user to use a simple list,
which gets converted to an array internally.

Importantly, it removes a very unhelpful error:

```python
>>> im = np.random.rand(10, 20)
>>> from skimage import segmentation as seg
Exception AttributeError: "'UmfpackContext' object has no attribute '_symbolic'" in <bound method UmfpackContext.__del__ of <scipy.sparse.linalg.dsolve.umfpack.umfpack.UmfpackContext object at 0x1045ff5d0>> ignored

>>> s = seg.slic(im, 2, sigma=[2, 1])
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-689b36a2f0ef> in <module>()
----> 1 s = seg.slic(im, 2, sigma=[2, 1])

/Users/nuneziglesiasj/venv/skimdev2/lib/python2.7/site-packages/scikit_image-0.9dev-py2.7-macosx-10.5-x86_64.egg/skimage/segmentation/slic_superpixels.pyc in slic(image, n_segments, compactness, max_iter, sigma, multichannel, convert2lab, ratio)
    106     if not isinstance(sigma, coll.Iterable):
    107         sigma = np.array([sigma, sigma, sigma])
--> 108     if (sigma > 0).any():
    109         sigma = list(sigma) + [0]
    110         image = ndimage.gaussian_filter(image, sigma)

AttributeError: 'bool' object has no attribute 'any'
```
2013-09-16 17:49:07 +10:00
Juan Nunez-Iglesias 9d86c9a1e1 Ignore convert2lab keyword if not multichannel 2013-09-16 17:33:08 +10:00
Juan Nunez-Iglesias bf5f08e894 Update SLIC docstring to remove deprecated example
The `ratio` keyword has been deprecated but it was still being used in
the example in the SLIC docstring. This replaces that usage by the new
`compactness` keyword.
2013-09-16 17:30:48 +10:00
Johannes Schönberger 88d84c720a Raise warning for sigma parameter and add to TODO for next release 2013-09-16 08:48:46 +02:00
Johannes Schönberger 06e99a537a Merge pull request #5 from jni/slic-speed-fix-dims
Fix image dimension sanitizing at function start
2013-09-15 23:37:25 -07:00
Juan Nunez-Iglesias ea1566fffb Fix image dimension sanitizing at function start
`np.atleast_3d` will add a singleton dimension at the end of an array
if needed. This is not the correct thing to do if `multichannel=False`
based on the subsequent lines. If the input image was 2D with shape
`(40, 50)` and `multichannel=False`, then `np.atleast_3d` gives it
shape `(40, 50, 1)`, and then, because `multichannel=False`, the rest
of the code gives it shape `(40, 50, 1, 1)`. This results in the final
returned array having shape `(40, 50, 1)` instead of the desired
`(40, 50)`.

This commit fixes that and updates the test to detect this failure.
2013-09-16 16:02:24 +10:00
Johannes Schönberger bc2f23d1a8 Revert default value of maximum iterations 2013-09-16 07:59:57 +02:00
Johannes Schönberger 05aaeef5ac Change default value of sigma 2013-09-14 10:08:07 +02:00