Comments (9)
@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.
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.
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.
How to make it happen? Could you offer some specific alternative codes or example for us to imitate temporarily.
from pyprep.
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.
@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.
@guishuyunye-lyw were you able to do it? can we close this?
from pyprep.
@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.
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)
- Use the MNE logger to set the verbosity HOT 6
- Make pyprep load MNE raw data for object, if not already loaded HOT 3
- filt vs filtfilt (MATLAB implementation)
- Add a "reject_by_annotation" parameter for finding bad channels HOT 1
- pyprep.utils._filter_design throws error for large sampling rates HOT 4
- Passing a custom montage to the PrepPipeline(raw, montage=?)? HOT 5
- Saving prep.raw give error " ValueError: Measurement infos are inconsistent for dig" HOT 4
- List of channel names causes TypeError in find_bad_by_ransac HOT 2
- migrate from `.zenodo.json` to `CITATION.cff` HOT 1
- update issue/pr templates HOT 1
- Computation of window size based on cutoff frequency in local detrend method HOT 1
- Question: using pyprep.NoisyChannels on numpy arrays HOT 1
- Issue with RawBrainVision HOT 2
- find_all_bads throws inf/nan error after filtering/detrending? HOT 12
- Documentation for Noisy Channels Algorithms' stand-alone use HOT 1
- [Feature suggestion] Allow for relevant annotation selection during processing.
- How to include the prep output in my preprocessing pipeline? HOT 1
- New release? HOT 4
- Possible to add an argument in find_bad_by_nan_flat() to change FLAT_THRESHOLD ? HOT 2
- Add to NoisyChannel a bad_by_psd method to tackle low-frequency artefacts HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyprep.