[Mne_analysis] Epoch() classifies all epochs as "bad" (Alexandre Gramfort)

Alexandre Gramfort alexandre.gramfort at inria.fr
Tue Jun 5 03:27:04 EDT 2018
Search archives:

        External Email - Use Caution        

hi,

you wrote:

tmin=-500, tmax=2000

so 500s before stim and 2000s after.

Use:

tmin=-0.5, tmax=2.

and it should work.

Best,
Alex


On Mon, Jun 4, 2018 at 4:45 PM, d p <aglasis at gmail.com> wrote:
>         External Email - Use Caution
>
> Dear Alex & list,
>
> Following Alex G. recommendation (thanks, by the way) I checked the plot
> with events (raw.plot(events=events); which perfectly displays all the
> events at the correct timing), the sampling frequency (which is correctly
> identified from raw.info['sfreq'] as 2048.0) and the first sample (also
> correctly identifying the index of the first sample in the raw data file).
>
> So, I am still stuck: the Epochs command still correctly detects the events
> by the event_ids (epoch count is correct), but when the epochs are read it
> sets them all as 'IGNORED', and occasionally  'NO_DATA' or 'TOO_SHORT'.
>
> I put some sample data and a simplified version of the code that fails to
> produce epochs on the following dropbox folder:
> https://www.dropbox.com/sh/09b71oumga8xm4y/AABg04xw-cCiCnn9FMSSqODca?dl=0
>
> Thanks in advance for your help!
> Best,
> Daniel
>
>
> On 30 May 2018 at 18:00, <mne_analysis-request at nmr.mgh.harvard.edu> wrote:
>>
>> Send Mne_analysis mailing list submissions to
>>         mne_analysis at nmr.mgh.harvard.edu
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>> or, via email, send a message with subject or body 'help' to
>>         mne_analysis-request at nmr.mgh.harvard.edu
>>
>> You can reach the person managing the list at
>>         mne_analysis-owner at nmr.mgh.harvard.edu
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Mne_analysis digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: Epoch() classifies all epochs as "bad" (d p)
>>    2. Re: Epoch() classifies all epochs as "bad" (Alexandre Gramfort)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 30 May 2018 14:36:12 +0200
>> From: d p <aglasis at gmail.com>
>> Subject: Re: [Mne_analysis] Epoch() classifies all epochs as "bad"
>> To: mne_analysis at nmr.mgh.harvard.edu
>> Message-ID:
>>
>> <CAED_QJc1kJ+FFzkXSPMgHBZDvtFCntNe7-1iK_BNHpJDo57rdg at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>>         External Email - Use Caution
>>
>> Dear Marijn & List
>>
>> Thanks for your suggestion about  drop_log. I tried that and also
>> plot_drop_log, and according to that all epochs are either "IGNORED" or
>> "NO_DATA"  according to dropped_log. Also, in the plot_drop_log, 100%
>> events are either "NO_DATA" or "TOO_SHORT".
>>
>> I saw in the documentation that " ?NO_DATA? or ?TOO_SHORT? if epoch didn?t
>> contain enough data", but I don't understand what does "didn't contain
>> enough data" mean? I have a 64-channel eeg recording, epochs are ~3seconds
>> long, and epoch markers, timing, amount of epochs, etc. is identified
>> perfectly by the find_events calls. Also, all other pre-processing steps
>> (filtering, bad channel interpolation, re-referencing, etc.) worked just
>> fine.
>>
>> Thanks in advance for any comments and suggestions,
>> Daniel
>>
>> PS: Sorry about writing from different emails. I'll make sure that in the
>> future I only use the registered one.
>>
>> Date: Tue, 29 May 2018 20:01:33 +0300
>> From: Marijn van Vliet <w.m.vanvliet at gmail.com>
>> Subject: Re: [Mne_analysis] Epoch() classifies all epochs as "bad"
>> To: Discussion and support Software <mne_analysis at nmr.mgh.harvard.edu>
>> Message-ID: <3E3699E3-BEAC-40BD-BB15-B9141C4A96F3 at gmail.com>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Dear Daniel,
>>
>> you can try looking at epochs.drop_log after all epochs are dropped. The
>> drop_log contains for each dropped epoch the reason why it was dropped.
>>
>> best,
>> Marijn.
>> > On 29 May 2018, at 18:34, Daniel Preciado <daniel.preciadov at gmail.com>
>> wrote:
>> >
>> >         External Email - Use Caution
>> >
>> >
>> > Dear list,
>> >
>> > I am having trouble with epoching eeg data. For some reason, the epoch()
>> call classifies all epochs as bad, and I always end up with an empty
>> Epochs
>> object.
>> >
>> > If I try epoching with "preload=False", it reads correctly the epochs,
>> and the detected epochs perfectly matching the amount of trials and other
>> experiment parameters. But whenever I try to do anything with the Epochs
>> object (e.g. plotting), all events are deleted, and thus everything else
>> throws zeroDivisionErrors. And if I call back the epochs object after
>> this,
>> it is empty (epoch counts are set to 0).
>> >
>> > I have tried all types of combinations of arguments, but the result is
>> always the same: It seems to correctly recognize the epochs if the data is
>> not Preloaded, but everything is discarded if the data is preloade, or if
>> I
>> try to do anything with the epochs object. I have tried different things
>> with the arguments, including reject=None, Baseline=(None, None),
>> preload=False, reject=None, flat=None, reject_tmin=None, reject_tmax=None,
>> detrend=None, on_missing='error', metadata=None, verbose=None. I have also
>> tried creating the epochs with the minimum arguments necessary (Data,
>> Event_data, Event_id), but it is always the same result.
>> >
>> > I have also tried the same code on different datasets, but it always
>> discards all epochs, no matter what.
>> >
>> > I do not understand why Epoch() classifies all data (from different
>> people, different sessions) as bad, can anyone help me to figure this out,
>> and hopefully fix it?
>> >
>> > Thanks!
>> >
>> > _______________________________________________
>> > Mne_analysis mailing list
>> > Mne_analysis at nmr.mgh.harvard.edu
>> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>> >
>> >
>> > The information in this e-mail is intended only for the person to whom
>> > it
>> is
>> > addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> > contains patient information, please contact the Partners Compliance
>> HelpLine at
>> > http://www.partners.org/complianceline . If the e-mail was sent to you
>> > in
>> error
>> > but does not contain patient information, please contact the sender and
>> properly
>> > dispose of the e-mail.
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180530/d9c7a3b8/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Wed, 30 May 2018 14:47:41 +0200
>> From: Alexandre Gramfort <alexandre.gramfort at inria.fr>
>> Subject: Re: [Mne_analysis] Epoch() classifies all epochs as "bad"
>> To: Discussion and support forum for the users of MNE Software
>>         <mne_analysis at nmr.mgh.harvard.edu>
>> Message-ID:
>>
>> <CADeotZrEDFQRQvyc1EY23qd3g899uzrePgu8vyWCPGYq4zoqFQ at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>>         External Email - Use Caution
>>
>> you can check your events with:
>>
>> raw.plot(events=events)
>>
>> also check the sfreq and raw.first_samp.
>>
>> if you're stuck please share a file and a script with dropbox.
>>
>> Alex
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>> End of Mne_analysis Digest, Vol 124, Issue 42
>> *********************************************
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>



More information about the Mne_analysis mailing list