Giter VIP home page Giter VIP logo

Comments (9)

yjmantilla avatar yjmantilla commented on May 25, 2024 1

@sappelhoff next week's tuesday I will get rid of an university exam and by then I will probably have the time to make the PR.

from pyprep.

yjmantilla avatar yjmantilla commented on May 25, 2024

My intuition is that this comes from the multitaper (The ransac would throw another error ). Please refer to #18 . Specifically you need a patch for the multitaper described in there or alternatively apply another filtering method for the line noise while passing an empty list to the line_freqs parameter.

from pyprep.

sappelhoff avatar sappelhoff commented on May 25, 2024

We basically need MNE-Python master with the window-wise spectrum filter (see mne-tools/mne-python#7609) and then @christian-oreilly's patch to include that in pyprep.

from pyprep.

guishuyunye-lyw avatar guishuyunye-lyw commented on May 25, 2024

How to make it happen? Could you offer some specific alternative codes or example for us to imitate temporarily.

from pyprep.

guishuyunye-lyw avatar guishuyunye-lyw commented on May 25, 2024

My intuition is that this comes from the multitaper (The ransac would throw another error ). Please refer to #18 . Specifically you need a patch for the multitaper described in there or alternatively apply another filtering method for the line noise while passing an empty list to the line_freqs parameter.

I just made the line_freqs=[0], but it still broken off. Could you give me an example how to achieve what you described. THX so much!

from pyprep.

yjmantilla avatar yjmantilla commented on May 25, 2024

@guishuyunye-lyw rather than making line_freqs = [0], make it empty (line_freqs = []) . That will skip the line noise filtering.

Now if you do have line_noise you have two options. Either make a notch filter with mne for the line noise (https://mne.tools/stable/auto_tutorials/preprocessing/plot_30_filtering_resampling.html?highlight=notch) outside of the pyprep (preferably before) or use the patch of #18 .

I havent implemented the patch myself but I think it is already merged in MNE so you would need to install mne from the latest code ( https://github.com/mne-tools/mne-python for instructions). I think that would be enough along with passing the line_freqs you want. We are still unsure how much it actually attenuates the line noise but at least it wont explode in ram consumption.

There is another patch made by @christian-oreilly that (as far as i know) helps in case you want to keep non eeg channels in your data (ie ocular channels).

I don't really have time to provide code from scratch but if you post yours here we may be able to indicate to you what changes to make.

from pyprep.

yjmantilla avatar yjmantilla commented on May 25, 2024

@guishuyunye-lyw were you able to do it? can we close this?

from pyprep.

sappelhoff avatar sappelhoff commented on May 25, 2024

@yjmantilla now that MNE-Python 0.21 is out, do you have time to make a PR against pyprep to set the spectrum filter to default to work in windowed mode (with 10s windows by default)? And perhaps test whether that'd a good idea?

We could also add a new parameter filter_kwargs which would be a dictionary that, if supplied, gets passed on the the spectrum filter call. that way, users could tweak the spectrum filter to their own liking more completely ... and if they don't do that, the default values should be reasonable.

WDYT?

from pyprep.

sappelhoff avatar sappelhoff commented on May 25, 2024

okay cool, note also this (from the changelog of mne 0.21):

The default window size set by filter_length when method='spectrum_fit' in mne.io.Raw.notch_filter() will change from None (use whole file) to '10s' in 0.22, by Eric Larson

https://mne.tools/stable/whats_new.html#whats-new

from pyprep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.