Re: [scikit-image] local maxima improvements

2018-04-12 Thread François Boulogne
> Please do that! The plateau handling in our peak finding seems > sub-optimal and confusing. > Stephan: it's done here :) https://github.com/scikit-image/scikit-image/issues/3016 Best -- François Boulogne. http://www.sciunto.org GPG: 32D5F22F ___

Re: [scikit-image] local maxima improvements

2018-04-11 Thread Stefan van der Walt
On Wed, 11 Apr 2018 12:44:45 +1000, Juan Nunez-Iglesias wrote: > In [7]: image > Out[7]: > array([[ 0.,  0.,  0.,  0.,  0.,  0.], >        [ 0.,  1.,  0.,  0.,  0.,  0.], >        [ 0.,  0.,  0.,  0.,  0.,  0.], >        [ 2.,  2.,  2.,  4.,  4.,  2.], >        [ 2.,  2.,  2.,  4.,  4.,  2.], >    

Re: [scikit-image] local maxima improvements

2018-04-11 Thread Stefan van der Walt
On Wed, 11 Apr 2018 16:07:55 +0200, François Boulogne wrote: > Another point I would like to make: recently, a scipy contributor added > a beautiful function to detect peaks. I'm already using this feature in > my code. The first PR is here: https://github.com/scipy/scipy/pull/8264 > Others are for

Re: [scikit-image] local maxima improvements

2018-04-11 Thread François Boulogne
Hi, I haven't tested the difference between both functions, but I can say that peak_local_max and _prominent_peaks are used in several places internally. Another point I would like to make: recently, a scipy contributor added a beautiful function to detect peaks. I'm already using this feature in

Re: [scikit-image] local maxima improvements

2018-04-11 Thread Yann GAVET
Thank you Juan, all my researches from a well-known web search engine gave me peak_local_max as a solution, in particular, the example attached to the watershed function. Sorry about this. Maybe this function should be marked as deprecated in favor of local_maxima. About peak_local_max, th

Re: [scikit-image] local maxima improvements

2018-04-10 Thread Juan Nunez-Iglesias
Hi Yann, and thanks for the interest! We actually already have this algorithm implemented in skimage.morphology.local_maxima. peak_local_max is a bit different and I must admit I don’t understand the logic in it. I *particularly* don’t understand the following result: In [1]: def rmax(I):    .

Re: [scikit-image] local maxima improvements

2018-04-10 Thread Yann GAVET
First mistake, this should work, but the discretization of the 'continuous' values should be handled with care. def rmax(I): """ Own version of regional maximum This avoids plateaus problems of peak_local_max I: original image, int values returns: binary array, with 1 for the maxima """ I