[Eeglablist] problem getting ICA to run properly on data files

Andreas Widmann widmann at uni-leipzig.de
Fri Apr 18 09:27:01 PDT 2014


Hi Javier,

ah, ok, that makes sense! Thanks for the explanation. The newer EEGLAB FIR filters (new basic, windowed sinc, and equiripple) do not use filtfilt and thus do not have the 3*filterorder points-constraint.

Best,
Andreas

Am 18.04.2014 um 00:45 schrieb Javier Lopez-Calderon <javlopez at ucdavis.edu>:

> 
> Hi everyone,
> 
> I just got back to my computer to get an answer for my sister-in-science, Emily. 
> 
> 1) ERPLAB: The problem arose when ERPLAB (high-pass) filtered Emily’s data between boundary events. So, like other filter tools, ERPLAB performs the filtering process over each separated-by-boundary EEG segment (e.g. two boundary events will create three segments of EEG). However, in order to successfully filter these segments their individual length must be more than three times the filter order (filtfilt’s constrain). So, when ERPLAB found this (unique) boundary event at the first sample of Emily’s dataset could not filter “the first out of two EEG segments” because its length was only 1 sample (!). Then, ERPLAB released a warning message at the command window saying:
> 
> WARNING: EEG segment from sample 1 to 1 was not filtered.
> More than 3*filterorder points are required, at least.
> 
> 
> ..and imprudently continues filtering “the second segment”, leaving unfiltered the first sample -of all channels- (as Andreas pointed out). Therefore, since Emily used a DC EEG amplifier, the DC offset of each unfiltered first sample (compared with the filtered neighborhood) was humongous (Sorry for this. We are gonna definitely fix this behavior asap).
> 
> 2) ICA: This “nut" samples seem to behave as a Dirac delta, at each channel, that pork out the ICA’s learning process (by messing up the rank of the data). So, in order to test this, I took an old dataset that had no boundary events at all, and that I have had successfully ICA-ed in the past (it had been 0.1-30Hz bandpass filtered previously). I added a DC offset (5000uV) over the sample 200th to see what happens with ICA. Result? After a couple of hours this is what I got:  runica(): QUITTING - weight matrix may not be invertible!
> 
> 
> 3) The moral:
> 
> - Fix ERPLAB in order to properly deal with boundary events that create too short EEG segments.
> - Be aware of nut samples (high-amplitude lone samples) in your EEG recording if you are planning to run ICA without running a prudent band-pass filter. 
> 
> I hope this helps,
> Javier
> 
> 
> 
> 
> On Apr 17, 2014, at 9:44 AM, Andreas Widmann <widmann at uni-leipzig.de> wrote:
> 
>> Hi Emily,
>> 
>> I had a quick look at the ERPLAB filter code and I can see one potential problem. ERPLAB seems to expect the boundary events at .5-latencies between two samples (as produced by pop_mergeset). However, all raw file formats I’m aware of set the discontinuity/boundary triggers at integer latencies (first sample of new data segment). BVA-IO imports them unmodified. ERPLAB shifts the boundary events at integer latencies by one sample. This results in DC artifacts at segment/epoch ends for interrupted/paused recordings and a single unfiltered sample at the beginning of the dataset.
>> 
>> I would consider this as a potential bug in the ERPLAB filter as boundary events at integer latencies should not be shifted. I do not see a straightforward relation to the described problems with ICA. Are there potentially more „New Segment“ markers in the raw data (do you pause recording during breaks)?
>> 
>> Best,
>> Andreas
>> 
>> Am 17.04.2014 um 18:17 schrieb Emily Kappenman <eskappenman at ucdavis.edu>:
>> 
>>> Hi Andreas,
>>> 
>>> I think the issue had to do with the duration of the first event being recorded as 'NaN,' but I'm not entirely sure.  I've copied Javier Lopez-Calderon who programs/designs ERPLAB and might be able to more thoroughly describe the issue we encountered.  Javier, can you describe why this event code at the beginning of the Brain Products data files was causing issues with the ERPLAB filter?  
>>> 
>>> Thanks!
>>> -Emily
>>> 
>>> 
>>> On Thu, Apr 17, 2014 at 9:10 AM, Andreas Widmann <widmann at uni-leipzig.de> wrote:
>>> Hi Emily,
>>> 
>>>> Thanks for the response!  I think we have resolved this issue (or figured out a work around, at least).  For some reason I was getting a 'boundary' code at the beginning of my imported EEG files (using the File > Import data > Using EEGLAB functions and plugins > From Brain Vis. rec .vhdr file option), with a duration of 'NaN.‘
>>> The boundary event corresponds to the „New segment“ marker (correctly) set by default by BrainVision Recorder for the first sample of each segment (also the first one) of the recording. This event should not cause any problems for filtering. Also other recording software as e.g. Biosemi ActiView sets these markers (unfortunately the EEGLAB bdfimport plugin does not import them at all, even if the marker is not at the beginning of the file).
>>> 
>>>> This was causing errors in the filter I was using in ERPLAB related to aligning the sampling points, and this was causing ICA to not run properly.
>>> What kind of problem causes this in the ERPLAB filter? Could you please describe what you mean by „related to aligning the sampling points“?
>>> 
>>> Thanks,
>>> Andreas
>>> 
>>>> If I remove this code from the beginning of the data file, everything works normally again.  I'm not sure why this code was appearing (there are no event codes at that time point in the EEG data file, and we did not remove any segments in this time range offline either).  I'm also exploring other import methods, using the suggestions people have been providing in response to my other post.
>>>> 
>>>> Please let me know if you have any additional suggestions.
>>>> 
>>>> Thanks!
>>>> -Emily
>>>> 
>>>> 
>>>> On Wed, Apr 16, 2014 at 11:10 AM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:
>>>> Dear Emily,
>>>> 
>>>> I can think of multiple reasons, such as severe rank reduction, huge artifacts, continuous zeros, etc etc... to diagnose it I need to ask you to send me a sample data to reproduce the problem. Are you willing to do it?
>>>> 
>>>> Makoto
>>>> 
>>>> 
>>>> 2014-04-09 16:17 GMT-07:00 Emily Kappenman <eskappenman at ucdavis.edu>:
>>>> Hi all,
>>>> 
>>>> I have been using ICA for some time now to correct eye blink artifacts in EEG data files with lots of success, but I just started using a new EEG system and am running into problems getting ICA to run properly on the files.  I am encountering the following error message: error: runica(): QUITTING - weight matrix may not be invertible!
>>>> 
>>>> This occurs on data files from multiple subjects, of different lengths, with different sampling rates, with different reference sites (both online and offline), etc..  Sometimes ICA will run but will require multiple separate components for eye blinks (5 or 6 out of 31 components).  The number of the components in the list that relate to the eye blinks also seems to correspond to channel numbers in a systematic way (e.g., if FP2 was channel 30 in the data set, component 30 is one of the components, etc.).
>>>> 
>>>> Has anyone encountered anything like this before or have any ideas what might be causing this?  Any suggestions are much appreciated!
>>>> 
>>>> Thanks so much!
>>>> -Emily Kappenman
>>>> 
>>>> --
>>>> --------------------------------------------------------------------
>>>> Emily S. Kappenman, Ph.D.
>>>> UC Davis Center for Mind and Brain
>>>> 267 Cousteau Place
>>>> Davis, CA 95618
>>>> eskappenman at ucdavis.edu
>>>> --------------------------------------------------------------------
>>>> 
>>>> _______________________________________________
>>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>>> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
>>>> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Makoto Miyakoshi
>>>> Swartz Center for Computational Neuroscience
>>>> Institute for Neural Computation, University of California San Diego
>>>> 
>>>> 
>>>> 
>>>> --
>>>> --------------------------------------------------------------------
>>>> Emily S. Kappenman, Ph.D.
>>>> UC Davis Center for Mind and Brain
>>>> 267 Cousteau Place
>>>> Davis, CA 95618
>>>> eskappenman at ucdavis.edu
>>>> --------------------------------------------------------------------
>>>> _______________________________________________
>>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>>> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
>>>> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> --------------------------------------------------------------------
>>> Emily S. Kappenman, Ph.D.
>>> UC Davis Center for Mind and Brain
>>> 267 Cousteau Place
>>> Davis, CA 95618
>>> eskappenman at ucdavis.edu
>>> --------------------------------------------------------------------
>> 
> 




More information about the eeglablist mailing list