automatic EOG rejection
Lars Meyer
lmeyer at CBS.MPG.DE
Mon Aug 10 15:58:16 CEST 2009
dear ingrid,
i tried this now, works fine for the rejection (success!). but now, i'd have to find a way to:
- get the events from the raw data (definetrial, okay)
- keep only those in which there is no artifact (i have the list as output from the rejection, so far, so good)
but, in the way you suggest, would fieldtrip not get the rejected trials again from the raw data, according to the triggers? right now i don't see how redefinetrial can both:
- get real triggers from raw data and define trials (write a trl according to triggers)
- only search those segments of the raw data that result from the rejection process (write a trl according to clean segments)
i.e. what needs to be done is to check entries in the 'trigger-trial trl' for identity or overlap with entries in the 'rejection-trial trl'.
can redefinetrial solve my problem? how? thank you so much, again!
lars
Lars Meyer | MSc
Max Planck Institute for Human Cognitive & Brain Sciences
Department of Neuropsychology
Stephanstraße 1a
04103 Leipzig | Germany
Office | +49 (0)341 99 40 22 66
Fax | +49 (0)341 99 40 22 60
Mobile | +49 (0)175 113 76 65
Home | +49 (0)341 974 26 49
Mail | lmeyer at cbs.mpg.de
Web | www.cbs.mpg.de/~lmeyer
----- Ursprüngliche Mail -----
Von: "Ingrid Nieuwenhuis" <ingrid.nieuwenhuis at donders.ru.nl>
An: FIELDTRIP at NIC.SURFNET.NL
Gesendet: Freitag, 7. August 2009 16:20:18 GMT +01:00 Amsterdam/Berlin/Bern/Rom/Stockholm/Wien
Betreff: Re: [FIELDTRIP] automatic EOG rejection
Dear Lars,
Don't understand what is wrong with your data_org trial. The trl definition
has 3 columns per trial: first sample of trial, last sample of trial and
offset, did your data_org.cfg.trl have that?
Anyways you can "epoch" your data to one long single trial
trl = [1 last_sample 0]
or use trialfun_general in definetrial with cfg.ntrials = 1; and
cfg.triallength = inf;
Then do artifact detection/rejection and then redefine trial to real epochs
based on triggers. Would that work?
Have a nice weekend too,
Best Ingrid
> -----Original Message-----
> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On
> Behalf Of Lars Meyer
> Sent: Friday, August 07, 2009 4:00 PM
> To: FIELDTRIP at NIC.SURFNET.NL
> Subject: Re: [FIELDTRIP] automatic EOG rejection
>
> dear ingrid,
>
> thanks a lot, I greatly appreciate your immediate response!
> what you suggest was what I was trying next :-). I already had suspected
> the padding to be my problem.
> however, 'artifact_eog' always tries to fetch 'trl' >> error:
>
> ??? Reference to non-existent field 'trl'.
> Error in ==> artifact_eog at 165
> tmpcfg.trl = cfg.trl;
>
>
> as soon as i declare
>
> cfg.trl = data_org.cfg.trl
>
>
> i.e. get 'trl' from the original, continuous data structure in memory
> (data_org), matlab errors
>
> Input must be a row vector of characters
>
>
> thanks a lot in advance, and have a good weekend,
> lars
>
>
> Lars Meyer | MSc
> Max Planck Institute for Human Cognitive & Brain Sciences
> Department of Neuropsychology
> Stephanstraße 1a
> 04103 Leipzig | Germany
>
> Office | +49 (0)341 99 40 22 66
> Fax | +49 (0)341 99 40 22 60
> Mobile | +49 (0)175 113 76 65
> Home | +49 (0)341 974 26 49
> Mail | lmeyer at cbs.mpg.de
> Web | www.cbs.mpg.de/~lmeyer
>
> ----- Ursprüngliche Mail -----
> Von: "Ingrid Nieuwenhuis" <ingrid.nieuwenhuis at donders.ru.nl>
> An: FIELDTRIP at NIC.SURFNET.NL
> Gesendet: Freitag, 7. August 2009 15:08:06 GMT +01:00
> Amsterdam/Berlin/Bern/Rom/Stockholm/Wien
> Betreff: Re: [FIELDTRIP] automatic EOG rejection
>
> Dear Lars,
>
> The error message means that fetch_data tries to fetch data outside of
> your
> trials where there is no data supplied in the input data file. Fetch_data
> was recently changed and now puts NaNs where there is no data. But
> filtering
> data with NaNs is not a good idea, therefore the warning.
>
> What happens is in artifact_eog is that the data is padded, or better
> said,
> there is an attempt to pad the data. This is done to avoid filter artifact
> at the edges, and for optimal artifact detections at/just over the border
> (which can influence filtering). This padding doesn't work because in the
> input data you supplied there is no extra data which can be used for
> padding. Therefore the NaN's or the error that not all samples are present
> in the data.
>
> Would you can do is epoch the data into trials after artifact detection.
> So
> first detect and reject artifacts, and then use redefinetrial (give the
> trl
> you have now) to epoch the data.
>
> Hope this helps,
> Best Ingrid
>
> > -----Original Message-----
> > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On
> > Behalf Of Lars Meyer
> > Sent: Friday, August 07, 2009 2:23 PM
> > To: FIELDTRIP at NIC.SURFNET.NL
> > Subject: [FIELDTRIP] automatic EOG rejection
> >
> > dear all,
> >
> > (newest fieldtrip, newest matlab)
> >
> > trying automatic EOG artifact rejection, i get the following error:
> >
> > In fetch_data at 111
> > In artifact_zvalue at 213
> > In artifact_eog at 179
> > Warning: data contains NaNs, no filtering applied
> >
> >
> > workflow was (these all worked):
> >
> > - reading continous data to memory
> > - merging EOG channels (from V+/V_ / H+/H_ to eogv and eogh)
> > - appending EOG channels
> > - re-refercing
> > - filtering
> > - epoching according to triggers
> >
> >
> > while trying automatic rejection comes the error; visual rejection just
> > works fine. in the olf fieldtrip version, the error message said "not
> all
> > samples are present in the data". i checked the data structure; the
> merged
> > EOG channels have been correctly appended and labelled. attached is my
> > code, thanks a lot in advance!
> >
> >
> > all best,
> > lars
> >
> >
> > Lars Meyer | MSc
> > Max Planck Institute for Human Cognitive & Brain Sciences
> > Department of Neuropsychology
> > Stephanstraße 1a
> > 04103 Leipzig | Germany
> >
> > Office | +49 (0)341 99 40 22 66
> > Fax | +49 (0)341 99 40 22 60
> > Mobile | +49 (0)175 113 76 65
> > Home | +49 (0)341 974 26 49
> > Mail | lmeyer at cbs.mpg.de
> > Web | www.cbs.mpg.de/~lmeyer
> >
> > ----------------------------------
> > The aim of this list is to facilitate the discussion between users of
> the
> > FieldTrip toolbox, to share experiences and to discuss new ideas for
> MEG
> > and EEG analysis. See also
> > http://listserv.surfnet.nl/archives/fieldtrip.html and
> > http://www.ru.nl/neuroimaging/fieldtrip.
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
More information about the fieldtrip
mailing list