.indexes doesn't work for uint?
Issue #6
resolved
Hi! ' Thanks for this code! As a Matlab user this is very intuitive. I encountered a problem when I wanted to find the peaks of a signal. My signal (or rather image) consists of uint16. When I try to find peaks .indexes returns an empty array. When I try the same by manually 'making' the same signal/array with int32 it returns the correct peaks. Is this intentional?
Cheers!
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Fixed on HEAD (raises an exception when called with unsigned data).
- Log in to comment
Hello,
peakutils.indexes() should work only on signed types, as it relies on computing the first difference of the data to check for peaks. Instead of automatically converting to a signed type, I've changed it to be explicit: specify this on the documentation and raise an exception if called with an unsigned type.
You can convert it to a signed type before calling indexes, that is:
Beware that peakutils will not report plateaus for now (and they are more probable of occurring in integer data).