51 Commits

Author SHA1 Message Date
Steven Silvester b710bd21d2 Use a stacklevel of 2 by default for all warnings 2016-01-30 08:57:46 -06:00
Juan Nunez-Iglesias 0d134987f9 Harmonize all ndimage usage across the library
Only two forms remain in use:

- `from scipy import ndimage as ndi`
- `from scipy.ndimage import function`
2015-06-09 15:18:37 +10:00
Johannes Schönberger 3a1079a180 Misc PEP8 fixes 2014-12-14 02:56:14 +01:00
Stefan van der Walt 78a7b7307a Rename and deprecate filter module to prevent shadowing of built-in keyword 2014-11-10 12:53:50 +02:00
blink1073 caaf75ebd1 Fix failing doctests 2014-07-19 19:16:46 -05:00
blink1073 5677dafe41 Move away from random.random in favor of random.rand 2014-07-19 18:18:23 -05:00
Josh Warner (Mac) 4aa162fc78 FIX: Remove unnecessary .transpose introduced in PR #984 2014-05-07 22:10:27 -05:00
Josh Warner (Mac) 0d775c3aab Remove check for non-numeric values in spacing. 2014-05-07 02:42:38 -05:00
Josh Warner (Mac) 0ac86b3e96 STY: More elegant and maintainable style per code review 2014-05-06 02:16:45 -05:00
Josh Warner (Mac) 7847287f46 FIX: Shortcut output or catch trivial cases in random_walker
Also:
* New tests to cover these new checks
* Improvements to docstrings and user warnings
* Generalize handling of `sampling` in accordance with docstring
* Some extra whitespace to improve readability
2014-04-18 18:47:20 -05:00
Josh Warner (Mac) 7161175e43 DOC: Clarify UMFPACK warning; use if statements instead of assert 2014-04-18 16:52:19 -05:00
Juan Nunez-Iglesias 264ca6ebd9 Remove deprecated depth parameter in random_walker
This has been supplanted by the `spacing` parameter.
2014-04-09 23:41:37 +10:00
Juan Nunez-Iglesias 0af070b92f Change default mode cascade in random_walker seg 2014-04-09 23:35:42 +10: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
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 13e83be692 Update PyAMG URL (no longer in Google Code) 2013-08-25 12:44:19 +02:00
Josh Warner (Mac) 8e0eb4a2b1 fix: remove unnecessary forced copy 2013-04-14 20:15:19 -05:00
Josh Warner (Mac) 28c7d8afd3 Use force_copy argument of img_as_float
Also three PEP8 fixes
2013-04-12 10:02:33 -05:00
Josh Warner (Mac) 1edbf3e6f4 fix to preserve input image shape upon executing random_walker 2013-04-11 11:49:10 -05:00
Tony S Yu 17e7ba3de7 DOC: Fix Sphinx errors. 2013-03-02 17:22:10 -06:00
Johannes Schönberger 33c58ad854 Fix some doc string formatting issues of random walker 2012-12-09 23:19:42 +01:00
Johannes Schönberger a410f1c47e UmfPack warning is now only raised if random walker is explicitly called 2012-12-09 23:17:06 +01:00
Stefan van der Walt 03a701c831 Merge pull request #323 from emmanuelle/bug_rw
BUG: Correct a newly appeared bug in the random walker.
2012-09-19 17:53:25 -07:00
Emmanuelle Gouillart 6635cf16db [BUG] Corrected a bug in the random walker that appeared
* when returning the full probability instead of the segmentation
    * for three or more labels (two was OK)
2012-09-18 19:56:52 +02:00
JDWarner ee2092c6fa Documentation fix for labels input in random_walker.
This fix was needed because `labels` claimed it should be "of same
shape as `data`", but this is no longer always the case. When
multichannel=True, `labels` should be shaped like a SINGLE channel
of `data`, i.e. without the final dimension denoting channels.
2012-09-17 16:38:59 -05:00
Tony S Yu 7134a2609f DOC: Fix array formatting in doctest 2012-09-11 23:37:07 -04:00
JDWarner e8ddcefae3 PEP8 compliance, removed scaling, different data parsing.
This commit represents all recommended changes since the last
commit, notably:

* PEP8 compliance (in new sections; a few old ones still
  noncompliant w/indentations)

* Moved `depth` kwarg to end of list and in docstring.
  Clarified `depth` docstring, and added section in Notes
  further explaining this parameter.

* Added section in Notes warning that for multichannel inputs,
  all channels are combined during scaling.  The user must
  separately normalize each channel prior to calling
  random_walker()

* New method for parsing data, allowing more elegant gradient
  calculation code. Probably also more extensible. The 2D
  multispectral case forced this change.

* New test: `test_multispectral_2d()`
2012-08-31 14:14:46 -05:00
JDWarner 99238c44a5 sqrt(gradients) line removed 2012-08-29 17:07:13 -05:00
JDWarner 61320957eb Changes based on PR review recommendations: input format, scaling, and bugfix.
In this new version, all instances of 'spectrum' have been replaced with 'channel'.  The documentation also reflects this change, and the new multichannel kwarg used to indicate multichannel input is named appropriately.

New boolean multichannel kwarg added, which controls if the input has multiple channels or not.  Input 'data' is now array_like for both gray-level and multichannel.  This kwarg is needed mainly because a 3-D array could be either 3 spatial dimensions or a set of different 2-D channels.

New scaling kwarg added (may be removed in future), controlling if data scaling is applied to ALL channels or each channel individually, if multichannel=True. No effect for gray-level data.

Removed np.sqrt(gradients) in _compute_weights_3d(), which was a bug. Tests now pass consistently.

New method for maintaining shape from input to output, where dims = data.shape prior to np.atleast_3d().  A theoretical (70,100,1) array passed should now result in a (70,100,1) shaped output, for example.

Updated and fixed multispectral test script to work with new version.  TODO: Additional test(s) likely needed to cover code branches from new kwargs.
2012-08-29 16:33:56 -05:00
JDWarner feca48cc49 Added return_full_prob kwarg to solve call if pyamg not present. 2012-08-27 11:48:32 -05:00
JDWarner 8955dad32e Multispectral modifications applied to random walker. 2012-08-27 11:42:30 -05:00
Stefan van der Walt 8d54380dc0 Merge pull request #259 from emmanuelle/fix_random_walker
ENH: Fix random walker.
2012-08-27 02:40:56 -07:00
Emmanuelle Gouillart 9d29d5df78 PEP8: indentation in random_walker_segmentation 2012-08-27 11:26:11 +02:00
Emmanuelle Gouillart 28161eaee6 ENH: better handling of labels that need to be reordered
(this is now done automatically)
2012-08-24 15:09:46 +02:00
Emmanuelle Gouillart aa92d5f0bd Better handling of labeled pixels in random walker segmentation when we
return the whole probability.
2012-07-24 23:01:15 +02:00
Andreas Mueller f7c56202d0 COSMIT no spaces around power `**`. Fun: https://gist.github.com/1671995 2012-06-29 11:27:23 +02:00
Emmanuelle Gouillart 4ab7d0a4fa Modifications to random walker segmentation algorithm:
* returning the probability to belong to a label instead of only the most
  likely label is now possible

* fixing some type issues

* handling non-consecutive label values
2012-06-24 19:35:27 +02:00
cgohlke faf92e1a6d Fix TypeError on 64 bit platforms 2012-02-25 21:01:27 -08:00
Andreas Mueller 2b6208cf3e DOC some sphinx and rst fixes 2012-02-21 18:01:22 +01:00
emmanuelle 46d330591f ENH Tony's comments on random walker 2012-01-23 19:47:16 +01:00
emmanuelle 6559b8f31d ENH Removed unused argument in random_walker_segmentation 2012-01-21 12:34:34 +01:00
emmanuelle 528187c2b0 ENH: addressed Tony's comments (renaming of functions, doc) 2012-01-21 11:43:53 +01:00
emmanuelle b9d6090c5e Cross-See also in watershed and random walker 2012-01-17 22:17:15 +01:00