Hi all.
I am performing a ERP study and am extracting my amplitude values. Although I have set mode to positive in the get_peak function, I still get negative values (14% for P1, 40% for N1, 17% for P2). Is this a bug? Or do my peaks just not fall into my time window? This is my code:
Looking at the MNE code, getting negative values when passing mode='pos' should be impossible, but maybe there’s a bug somewhere … can you share a minimal working example that reproduces the problem?
@richard
The percentage means; the amount of data that is negative while I set mode to pos. e.g. in my selected P1 timewindow, my selected amplitudes are in 17% of all evoked data negative.
I did a convert density source conversion, maybe this causes this issue?
Thanks for the clarification! It would be helpful if you could share a minimal reproducible example that demonstrated the issue, otherwise we’re tapping a bit in the dark here
Hello @Evelyne_Fraats, this is a bug and we’re working on a fix here:
As a workaround, what you can do for now is explicitly crop the data to the desired time period before running get_peak(), e.g. by doing something like:
Please mind the include_tmax=False parameter; without it, tmax will be included in the evoked data, while when passing tmax to get_peak() as you did before, tmax may not be included!
Maybe this is another reason to crop before running get_peak()