morphology.is_local_maximum --> feature.peak_local_max

Johannes Schönberger jsch at demuc.de
Fri Sep 6 06:34:57 EDT 2013


Could you file a bug report on github?

Am 06.09.2013 um 11:13 schrieb Guillaume Gay <guillaume at mitotic-machine.org>:

> Ok so **1D** is not supported...
> 
> I guess if you just do:
> 
> a = np.atleast_2D(a) before calling is_local_maximum it will be correct...
> 
> Cheers
> 
> Guillaume
> On 06/09/2013 10:39, Sigmund wrote:
>> I'm using the Enthough Canopy 2.7.3 distribution. 
>> 
>> >>> import skimage
>> >>> skimage.version.version
>> '0.8.2'
>> >>>
>> 
>> 
>> the is_local_maximum function
>> >>> import numpy as np
>> >>> from skimage.morphology import is_local_maximum
>> >>> a = np.zeros(5)
>> >>> a[2] = 2
>> >>> is_local_maximum(a)
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "c:\users\neher\appdata\local\enthought\canopy\user\lib\site-packages\skimage\_shared\utils.py", line 41, in wrapped
>>     return func(*args, **kwargs)
>>   File "c:\users\neher\appdata\local\enthought\canopy\user\lib\site-packages\skimage\morphology\watershed.py", line 297, in is_local_maximum
>>     indices=False, exclude_border=False)
>>   File "c:\users\neher\appdata\local\enthought\canopy\user\lib\site-packages\skimage\feature\peak.py", line 153, in peak_local_max
>>     out[coordinates[:, 0], coordinates[:, 1]] = True
>> IndexError: index 1 is out of bounds for axis 1 with size 1
>> >>>
>> 
>> the peak_local_max function
>> 
>> >>> import numpy as np
>> >>> from skimage.feature import peak_local_max
>> >>> a = np.zeros(5)
>> >>> a[2]= 2
>> >>>
>> >>> a
>> array([ 0.,  0.,  2.,  0.,  0.])
>> >>> peak_local_max(a)
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "c:\users\neher\appdata\local\enthought\canopy\user\lib\site-packages\skimage\feature\peak.py", line 136, in peak_local_max
>>     image[:, :min_distance] = 0
>> IndexError: too many indices
>> >>>
>> 
>> Thank you for your help!
>> -- 
>> You received this message because you are subscribed to the Google Groups "scikit-image" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.




More information about the scikit-image mailing list