Code Monkey home page Code Monkey logo

meeg-preprocessing's People

Contributors

cmoutard avatar dengemann avatar kingjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meeg-preprocessing's Issues

Example plot_preprocess_filter_ica.py doesn't work

Hi,
I tried to launch the example script plot_preprocess_filter_ica.py but I got the following error at the check_apply_filter function line: " 'RawFIFF' object has no attribute 'plot_psd' ". Indeed you cannot apply this function to the raw file... Could it be a version problem (I'm using 0.9.dev)?
By the way, I'm wondering if this example is doing the same thing than the example in mne-python (Compute ICA components on raw data). I saw that here you're doing some supplementary filtering, why is it for?
Thanks,
Laetitia

EHN: compute_ica add decimation parameter to test

@dengemann we were speaking of adding a parameter to the run_ica function, so as to decimate the epoched ecg and eog.

Would it not be more efficient to decimate the raw data before passing it to compute data (and redecimate it one more time for the ica.fit)?

Pick mismatch between raw and ecg_epochs in compute_ica()

Pick mismatch between raw and ecg_epochs

raw is used to create ecp_epochs (see first line of code below).
raw could include all the channels (i.e. STI, MISC,...), contrary to the output of create_ecg_epochs() (here ecg_epochs) which only includes MAG, GRAD and EEG.
Because of this, a mismatch may appear between the argumtant picks (based on raw) in compute_ica() used in the bottom line of the code below and the actual channels of ecg_epochs.

For instance :
len(raw.ch_names) = 405
len(ecp_epochs.ch_names) = 306
raw.ch_names[405] = 'EEG60'
ecp_epochs.ch_names[306] = 'EEG60'
So for the channel EEG60, the "picks" would point to index 405 according to raw which is out of the bound for ecg_epochs.

def compute_ica(raw, subject, n_components=0.99, picks=None, decim=None,
                reject=None, ecg_tmin=-0.5, ecg_tmax=0.5, eog_tmin=-0.5,
                eog_tmax=0.5, n_max_ecg=3, n_max_eog=1,
                n_max_ecg_epochs=200, img_scale=1.0,
                report=None):

...

    ecg_epochs = create_ecg_epochs(raw, tmin=ecg_tmin, tmax=ecg_tmax,
                                   picks=None, reject={'mag': 5e-12})
    n_ecg_epochs_found = len(ecg_epochs.events)
    n_max_ecg_epochs = min(n_max_ecg_epochs, n_ecg_epochs_found)
    sel_ecg_epochs = np.arange(n_ecg_epochs_found)
    rng = np.random.RandomState(42)
    rng.shuffle(sel_ecg_epochs)
    ecg_epochs = ecg_epochs[sel_ecg_epochs[:n_max_ecg_epochs]]

    ecg_inds, scores = ica.find_bads_ecg(ecg_epochs, method='ctps')
    if len(ecg_inds) > 0:
        ecg_evoked = ecg_epochs.average(picks=picks)

EHN: add created_file.log

I'm writing a home made little script that save the fname of each file I create. For instance if I save some epochs: epochs.save(fname), I add logfiles.add(fname), so that I can easily upload the necessary files between EC2 and S3. Do you think it'd be worth adding this kind of option to the report directly?

python 3.6 seaborn incompatibility

I get an init error when I use meeg_preprocessing with python 3.6 and seaborn

import seaborn
from meeg_preprocessing.utils import get_versions, sys
get_versions(sys)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-8d49af5e3bc8> in <module>()
      6         continue
      7     print(name)
----> 8     module_version = LooseVersion(getattr(module, '__version__', None))

~/anaconda3/lib/python3.6/distutils/version.py in __init__(self, vstring)
    302     def __init__ (self, vstring=None):
    303         if vstring:
--> 304             self.parse(vstring)
    305 
    306 

~/anaconda3/lib/python3.6/distutils/version.py in parse(self, vstring)
    310         # use by __str__
    311         self.vstring = vstring
--> 312         components = [x for x in self.component_re.split(vstring)
    313                               if x and x != '.']
    314         for i, obj in enumerate(components):

TypeError: cannot use a string pattern on a bytes-like object

This issue comes from LooseVersion and the module _curse

import seaborn as sns
import sys
from distutils.version import LooseVersion
for name, module in sys.modules.items():
    if '.' in name:
        continue
    print(name)
    module_version = LooseVersion(getattr(module, '__version__', None))

I reckon we skip packages that start with '_'

ENH: better run-id strings

instead of using the hex, we could do

YYYY-MM-DD_HH-MM-SS based on the time stamp. This would be more human readable and garuanteed to be sorted in the file system.

cc @cmoutard @kingjr

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.