Commit Graph
4212 Commits
Author SHA1 Message Date
Luis Pedro Coelho ff0b315110 RFCT Simpler code for initializing array
Also, replaced skimage.measures.histogram by np.bincount.

Both changes were suggested in the pull request discussion by Juan
Nunez-Iglesias (jni):

https://github.com/scikit-image/scikit-image/pull/746
2013-10-01 15:19:42 +02:00
Luis Pedro Coelho f81fbf5b25 ENH Faster perimeter computation
Measured a 30% speedup on a 640x640 image. Fundamentally, this makes
fewer passes over the image; so it should never be worse that the
previous implementation.
2013-10-01 13:07:17 +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
Juan Nunez-Iglesias 477c80d409 Merge pull request #740 from ahojnnes/warp-fix
Fix doc string of warp functions
2013-09-28 06:24:14 -07:00
Johannes Schönberger c01e7c9b10 Fix various doc strings using the warp function 2013-09-28 14:39:40 +02:00
Johannes Schönberger a17a1395c3 Fix doc string of warp functions 2013-09-28 14:25:45 +02:00
Juan Nunez-Iglesias 610b22b4a9 Merge pull request #719 from ahojnnes/slic
This PR:
 - speeds up SLIC while reducing memory usage,
 - closes #717,
 - adds support for a voxel spacing argument for anisotropic images,
 - removes default gaussian blurring,
 - removes "magic" guessing whether input was multichannel.
2013-09-27 04:46:59 -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
Johannes Schönberger d194118766 Merge pull request #733 from riaanvddool/contribution-riaanvddool
Forgotten contribution by riaanvddool: skimage.io plugin - GDAL
2013-09-20 10:48:01 -07:00
Riaan van den Dool c540ef11c9 Forgotten contribution by riaanvddool: skimage.io plugin - GDAL 2013-09-20 19:14:10 +02:00
Johannes Schönberger b3d4409be9 Merge pull request #7 from jni/slic-cython-docstring
Slic cython docstring
2013-09-20 07:55:33 -07:00
Juan Nunez-Iglesias e17e7699b3 Add note about (z, y, x) order in slic cython doc 2013-09-21 00:12:12 +10:00
Johannes Schönberger a086f03f39 Document default value API change 2013-09-19 08:36:56 +02:00
Johannes Schönberger 52f01d1f85 Merge pull request #731 from ankit-maverick/SimilarityTransform
Correcting a bug in SimialarityTransform
2013-09-18 22:57:05 -07:00
Ankit Agrawal 0ed1e22034 Correcting bug in SimialarityTransform 2013-09-19 10:23:03 +05:30
Johannes Schönberger 607ac235af Merge pull request #6 from jni/slic-speed-spacing
Slic speed spacing
2013-09-16 10:00:18 -07: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 1b4a06f5aa Merge pull request #727 from jni/fix-small
Fix type hierarchy check in remove_small_objects
2013-09-14 01:45:18 -07:00
Johannes Schönberger 445dd7e859 Merge pull request #630 from JDWarner/improve_noise
ENH: Improve random_noise with better param names & docfixes
2013-09-14 01:41:08 -07:00
Johannes Schönberger 968206ce39 Merge pull request #704 from alexis-mignon/master
Adding non rotation invariant uniform LBPs
2013-09-14 01:24:36 -07:00
Johannes Schönberger 42eb3e6a35 Merge pull request #686 from radioxoma/yen-threshold
Add Yen threshold method
2013-09-14 01:23:46 -07:00
Johannes Schönberger 05aaeef5ac Change default value of sigma 2013-09-14 10:08:07 +02:00
Juan Nunez-Iglesias 2af5c41571 Fix type hierarchy check in remove_small_objects 2013-09-09 13:53:33 +10:00
radioxomaandradioxoma c8c95c0e63 Fix import list sequence 2013-09-07 19:10:40 +03:00
radioxomaandradioxoma 04804cc81c Logarithm optimisation 2013-09-07 19:10:40 +03:00
radioxomaandradioxoma 9e74f4eb70 Added Yen tests, typo fixed 2013-09-07 19:10:40 +03:00
radioxomaandradioxoma 8beb2ae605 Yen PEP8 and docstrings 2013-09-07 19:10:40 +03:00
radioxomaandradioxoma e41887c66d Codestyle improvement 2013-09-07 19:10:40 +03:00
radioxomaandradioxoma a315ae718d Add Yen threshold method 2013-09-07 18:48:46 +03:00
Josh Warner (Mac) 6f5f6a0a7a DOC: Further improvements to naming conventions. 2013-09-07 00:39:04 -05:00
Juan Nunez-Iglesias 34b1b7b414 Fix errors in relabel_from_one docs; PEP8 2013-09-07 00:51:21 +10:00
Johannes Schönberger 22ca0ae457 Fix indentation 2013-09-03 20:31:24 +02:00
Emmanuelle Gouillart 8ed56abb42 Merge pull request #469 from JDWarner/add_marching_cubes
3D Marching Cubes
2013-09-03 04:55:29 -07:00
Johannes Schönberger 8137c41e22 Add optional description to parameters 2013-09-03 10:48:53 +02:00
Johannes Schönberger 770e28d2bb Rename clusters to segments 2013-09-03 10:47:49 +02:00
Johannes Schönberger d9e64b43e6 Make image C-contiguous 2013-09-03 08:40:18 +02:00
Josh Warner (Mac) d2bc02c10b Credit myself for Marching Cubes 2013-09-02 20:23:00 -05:00
Josh Warner (Mac) abc7a16a80 STYLE: Use np.array instead of np.r_ and import Poly3DCollection 2013-09-02 15:31:51 -05:00
Johannes Schönberger b5806d18ba Merge pull request #722 from stefanv/shape_step
Add skip parameter to `view_as_windows`.
2013-09-02 00:10:32 -07:00