Commit Graph

22 Commits

Author SHA1 Message Date
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
emmanuelle 09e3a43f58 More explanations about the algorithm
Also: removed copyright
      changed module name
2012-01-17 21:32:08 +01:00