nbara / python-meegkit

🔧🧠 MEEGkit: MEG & EEG processing toolkit in Python
https://nbara.github.io/python-meegkit/
BSD 3-Clause "New" or "Revised" License
186 stars 51 forks source link

ZapLine improvements #50

Open nbara opened 3 years ago

nbara commented 3 years ago

Todo:

maciekszul commented 3 years ago

i'm refactoring and improving the algo right now as it was a quick and dirty way to do the job. i should push something ready to use soon. my implementation of fitting relies on psd calculation. currently my code uses the psd_array_multitaper from mne. any suggestions how to go about that issue? not really keen on implementing a new psd calculation.

nbara commented 3 years ago

Awesome !

currently my code uses the psd_array_multitaper from mne. any suggestions how to go about that issue? not really keen on implementing a new psd calculation.

Mmh not sure I want to add a dependency to MNE-python.

That said, computing a PSD is easy enough and I'm sure we can find an easy replacement with scipy. I suggest you go ahead and open an pull request, and we can find a solution then.

maciekszul commented 3 years ago

Mmh not sure I want to add a dependency to MNE-python.

i thought so :smile: i'll use scipy.signal.welch then.

nbara commented 3 years ago

That would be great thanks. But I can also code that bit myself if you're short on time.

maciekszul commented 3 years ago

I can also code that bit myself if you're short on time.

no worries. i can put together a quick bodge.

malcolmudeozor commented 1 year ago

Hi! Thanks so much for bringing ZapLine to Python. Super great tool. I see in your Todo checklist, you have a note about ZapLine-plus. Have you or are you planning to implement this update into Meegkit?

nbara commented 1 year ago

Hey @malcolmudeozor , no I haven't got around to implementing it.

To be honest, I'm not sure I ever will because dss_line_iter() does the job for me.

malcolmudeozor commented 1 year ago

Thats great. I also enjoy using DSS iter because of its simplicity. However, I don't quite understand why it's not performing multiple iterations with my current data set. Do you mind me sending my example? Thank you!

maciekszul commented 1 year ago

Hi malcolmudeozor you need to look at the PSD of your data. On noisy data, infant EEG for example, the window for the target frequency had to be widen. Look at the appropriate arguments in the function win_sz=10, spot_sz=2.5. From my experience, spot_sz has to be widen because the e.g. line noise is wider. Default values were suitable for best quality MEG.