nbara / python-meegkit

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

Questions about TSPCA #70

Closed JD-Zhu closed 1 year ago

JD-Zhu commented 1 year ago

Hi @nbara ,

Thanks for this cool package.

We have some MEG data recorded from a KIT system (160 channels of data + 3 reference channels) and would like to try using your TSPCA implementation for reducing environmental noise in the data. We perform our analyses in MNE so it's nice to be able to do this in python. @larsoner

I just had a couple of questions: 1) In the README document, it says that "TSCPA may give inaccurate results due to insufficient testing (contributions welcome!)" I was wondering if there had been any updates about this? 2) Are there any recommended parameters when using the meegkit.tspca.tsr() function (e.g. for the shifts and weights)?

Thank you very much!

nbara commented 1 year ago

Hey @JD-Zhu ,

Yes, I'm afraid this is still very much accurate. I haven't been working with MEG in some years, and even when I was I never ended up using TSCPA for my manuscripts.

I'm happy to help with bug fixes if you're still willing to give it a shot.

nbara commented 1 year ago

Have you had a look at what is available in MNE for sensor noise suppression?

I'm thinking of https://mne.tools/stable/auto_tutorials/preprocessing/60_maxwell_filtering_sss.html in particular, which seems to be super well documented and tested

JD-Zhu commented 1 year ago

Have you had a look at what is available in MNE for sensor noise suppression?

I'm thinking of https://mne.tools/stable/auto_tutorials/preprocessing/60_maxwell_filtering_sss.html in particular, which seems to be super well documented and tested

Thanks a lot @nbara !

We would like to try both this and TSPCA if possible - would be nice to make use of the reference channel data. Would you recommend just calling the meegkit.tspca.tsr() function with the default parameters? And for testing purpose, what would be some ways to assess whether the TSPCA is working well?

larsoner commented 1 year ago

@JD-Zhu in principle I would try denoising the data using tsPCA in both MATLAB and using meegkit and see if the results are similar (ideally the same to numerical precision!) when using the same parameters. If they're not, I can look into the differences if you can share a script in both languages and some data that show the problem!

JD-Zhu commented 1 year ago

Thanks @larsoner. We have done a rough comparison of the tsPCA results from MEG160 (the acquisition software for KIT system) and meegkit, and the results seemed quite similar!

nbara commented 1 year ago

Would you recommend just calling the meegkit.tspca.tsr() function with the default parameters?

Yes I would definitely start with that. But I don't really have additional recommendations beyond what is given in the original paper, TSCPA is definitely the method I used the least myself in the toolbox...

Maybe experiment with it on a known dataset that uses the same MEG scanner, to check that the results look as they should and that you did not remove any useful information.

Keep me posted if you experience bugs in my code, I'll look into it 👍

JD-Zhu commented 1 year ago

Thanks @nbara !

On Mon, 24 July 2023, 8:13 pm Nicolas Barascud, @.***> wrote:

Would you recommend just calling the meegkit.tspca.tsr() function with the default parameters?

Yes I would definitely start with that. But I don't really have additional recommendations beyond what is given in the original paper, TSCPA is definitely the method I used the least myself in the toolbox...

Maybe experiment with it on a known dataset that uses the same MEG scanner, to check that the results look as they should and that you did not remove any useful information.

Keep me posted if you experience bugs in my code, I'll look into it 👍

— Reply to this email directly, view it on GitHub https://github.com/nbara/python-meegkit/issues/70#issuecomment-1647620398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE5HU7ZAJTLENIBQM45FRTXRZDFNANCNFSM6AAAAAAZHGB5CE . You are receiving this because you were mentioned.Message ID: @.***>