Dr. Holle,<div><br></div><div>In initially learning to use FieldTrip I set up a script to do artifact detection/rejection on continuous data, but I have since switched to segmented processing because, as you say, it is just easier to deal with segmented trials.  The way I coded it is as follows, but I cannot be sure that it is correct because I did not extensively compare continuous to segmented preprocessing. </div>

<div><br></div><div>This does artifact detection before epoching (which is the time consuming part, especially on continuous data), and the actual rejection occurs after defining events.  Playing around with different epochs does not sound as easy as you describe for EEProbe, but I think the nature of the FT data structure prevents what you are looking for from happening (i.e., the actual data is stored in the struct and is not just referencing a continuous file).  If anyone has suggestions or corrections, I would like to hear them as well.</div>

<div><br></div><div>1. Read in the continuous data.</div><div>2. Read in electrode locations.</div><div>3. Set up EOG vertical and horizontal channels and append them to the data.</div><div>4. Lowpass and line noise (DFT) filter.</div>

<div>5. Use eventtype = '?' and trialfun =<span class="Apple-style-span" style="font-family: Courier; font-size: 12px; color: rgb(160, 32, 240); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial; font-size: small; "> 'trialfun_general' in ft_definetrial, and then define 1 big trial by manually set the resulting cfg's trl field to be [1 length(data.time{1}) 0]; then run ft_preprocessing with the cfg that has the modified trl field.</span></span></div>

<div>6. Detect artifacts across the continuous data using whichever functions are appropriate. Note: Use a unique name for the resulting cfg as it is used later; do not reject artifacts yet.</div><div><br></div><div>I start a for loop here for each event type; this contains steps 7–10.</div>

<div><br></div><div>7. Use ft_definetrial with your own trialfun to get a cfg and then ft_redefinetrial to get the data in trial format.</div><div>8. Use ft_rejectartifact with the cfg from step 6, and then ft_preprocessing to get the trials without artifacts.</div>

<div>9. Finish with any remaining preprocessing (rereference, baseline correction, etc.).</div><div>10. Store this event type in a struct, indexed by the number of event types for this subject.</div><div><br></div><div>I hope that helps. Again, any improvements on this would be interesting to hear. Maybe a FT wiki page could be made describing this process.</div>

<div><br></div><div>Matt</div><div><br clear="all">--<br>Univ. of Colorado at Boulder<br>Dept. of Psychology and Neuroscience<br><a href="mailto:matthew.mollison@colorado.edu">matthew.mollison@colorado.edu</a><br><a href="http://psych.colorado.edu/~mollison/">http://psych.colorado.edu/~mollison/</a><br>


<br><br><div class="gmail_quote">On Thu, Mar 18, 2010 at 11:58 AM, Henning Holle <span dir="ltr"><<a href="mailto:h.holle@sussex.ac.uk">h.holle@sussex.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Dear list members,<br>
<br>
I have a more general question about how continuous data is treated in fieldtrip. After playing around with the package for a bit, I noticed that although using continuous data is in principle supported, sooner or later one always runs into a dead-end, because most functions assume that trials are defined very early on in the processing tree (i.e., they don't work without a cfg.trl present). For instance, most artifact rejection functions seem to work only on epoched data.<br>


<br>
I have used EEProbe previously, and what I quite liked about that program was that is was possible to do artifact rejection once for the continuous data set, and subsequently one was free to define trials however one wanted to. In contrast, in fieldtrip one is forced to do a new artifact rejection (which is very time-consuming!), when one chooses to analyse the ERPs time-locked to a different event. Or am I missing something here?<br>


<br>
Is there a possibility to do an artifact rejction before the data is cut into epochs?<br>
<br>
Best wishes<br>
<br>
Henning<br>
<br>
-- <br>
*************************<br>
Dr. Henning Holle,<br>
Department of Psychology,<br>
University of Sussex,<br>
Falmer, Brighton,<br>
BN1 9QH, U.K.<br>
Tel. : +44 (0)1273 877240<br>
Fax. : +44 (0)1273 678058<br>
<br>
----------------------------------<br>
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 <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and <a href="http://www.ru.nl/neuroimaging/fieldtrip" target="_blank">http://www.ru.nl/neuroimaging/fieldtrip</a>.<br>


</blockquote></div><br></div>
<p>----------------------------------</p>
<p>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.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>