<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div><span>Hi Jan-</span><font face="Arial" size="2">mathijs,</font></div>
<div><br>
</div>
<div><font face="Arial" size="2">Did you get a chance to look at the problem described about neuroscan CNT file.</font></div><div><font face="Arial" size="2"><br></font></div><div><font face="Arial" size="2">Thanks</font></div><div><font face="Arial" size="2"><br></font></div><div><font face="Arial" size="2">Omoniyi Segun  <br></font></div><div><br></div><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Omoniyi Segun <omoniyi_s@yahoo.com><br><b><span style="font-weight: bold;">To:</span></b> jan-mathijs schoffelen <jan.schoffelen@donders.ru.nl>; Email discussion list for the FieldTrip project <fieldtrip@donders.ru.nl><br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, October 5, 2011 10:46
 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [FieldTrip] Problems detecting Artifacts in Neuroscan EEG file<br></font><br>
<div id="yiv98087206"><div><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt;"><div><span>Thanks for your response.</span></div><div><br><span></span></div><div><span>I am passing a 'subject' structure which contains the file location and file name to the </span>do_reject_artifacts function which i wrote. Inside the function i have inserted the code I got from the tutorial.</div><div><br></div><div>The structure is created in a do_preprocess function, i read all the files in a directory structure and create the subject stucture in this function.</div><div><br></div><div>The files are Neuroscan .cnt files</div><div><br></div><div><br></div><div>Thanks for your help</div><div><br></div><div>Omoniyi Segun<br></div><div><br></div><div><br></div><div>snippet from : do_preprocess</div><div><br></div><div>        clear
 subject;<br>        if ( reply == 'Y' || reply == 'y')<br>            %token = strtok(subjectdata.filename{i}, '.');<br>            token = strtok(files(i).name, '.');<br>            subject.datafile = [subjectdata.datadir filesep subjectdata.taskdir filesep subjectdata.subjectdir filesep files(i).name];<br>            subject.datafilename = token;<br>            subject.datafiledir = [subjectdata.datadir filesep subjectdata.taskdir filesep subjectdata.subjectdir];<br>            subject.artifactdir = subjectdata.artifactdir;<br></div><div><br></div><div>snippet from :
 do_reject_artifacts</div><div><br></div><div>cfg.dataset            = 'subject.datafile;       % name of EEG dataset  <br>cfg.trialdef.eventtype      = 'trigger';<br>cfg.trialdef.prestim        = 1;<br>cfg.trialdef.poststim       = 2;<br>cfg.trialdef.eventvalue     = [1 2];                                    <br>cfg = ft_definetrial(cfg);            <br>data= ft_preprocessing(cfg)<br>trl = cfg.trl;<br><br><br>%
 jump<br>cfg                    = [];<br>cfg.trl = trl;<br>cfg.padding = 0;<br><br><br>cfg.datafile   = subject.datafile;<br>cfg.headerfile = subject.datafile;<br>cfg.continuous = 'yes';<br><br>cfg.memory = 'low';<br><br>% channel selection, cutoff and padding<br>cfg.artfctdef.zvalue.channel    = 'EEG';<br>cfg.artfctdef.zvalue.cutoff     = 20;<br>cfg.artfctdef.zvalue.trlpadding = 0.5*cfg.padding;<br>cfg.artfctdef.zvalue.artpadding = 0.5*cfg.padding;<br>cfg.artfctdef.zvalue.fltpadding = 0;<br> <br>% algorithmic parameters<br>cfg.artfctdef.zvalue.cumulative    = 'yes';<br>cfg.artfctdef.zvalue.medianfilter  = 'yes';<br>cfg.artfctdef.zvalue.medianfiltord = 9;<br>cfg.artfctdef.zvalue.absdiff       = 'yes';<br> <br>% make the process
 interactive<br>cfg.artfctdef.zvalue.interactive   = 'yes';<br> <br>[cfg, artifact_jump] = ft_artifact_zvalue(cfg,data);<br></div><div><br></div><div><br></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> jan-mathijs schoffelen <jan.schoffelen@donders.ru.nl><br><b><span style="font-weight:bold;">To:</span></b> Omoniyi Segun <omoniyi_s@yahoo.com>; Email discussion list for the FieldTrip project <fieldtrip@donders.ru.nl><br><b><span style="font-weight:bold;">Sent:</span></b> Tuesday, October 4, 2011 8:15 AM<br><b><span style="font-weight:bold;">Subject:</span></b> Re: [FieldTrip] Problems detecting Artifacts in Neuroscan EEG file<br></font><br>
<div id="yiv98087206"><div>Hi Omoniyi,<div><br></div><div>What kind of data are you passing to the function? </div><div><br></div><div>BW,</div><div><br></div><div>JM</div><div><br></div><div><br></div><div><br><div><div>On Oct 3, 2011, at 4:49 PM, Omoniyi Segun wrote:</div><br class="yiv98087206Apple-interchange-newline"><blockquote type="cite"><div><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt;">Hi,<div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div id="yiv98087206"><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt;"><div><br></div><div>I am new to fieldtrip and have been struggling with it for the past four weeks. <br></div><div><br></div><div>I am trying to do artifact
 detection using the Automatic Artifact detection tutorial on the Site. The first issue I am having is when i set <span class="yiv98087206Apple-style-span" style="border-collapse:separate;color:rgb(0, 0, 0);font-family:'Times New
 Roman';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:16px;"><span class="yiv98087206Apple-style-span" style="color:rgb(51, 51, 51);font-family:Calibri, Geneva, Arial, Verdana, sans-serif;font-size:12px;line-height:18px;text-align:justify;"><pre class="yiv98087206code
 yiv98087206matlab" style="padding-top:0.5em;padding-right:0.5em;padding-bottom:0.5em;padding-left:0.5em;margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;font-size:12px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:dashed;border-right-style:dashed;border-bottom-style:dashed;border-left-style:dashed;border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);color:rgb(51, 51, 51);font-family:Consolas, Menlo, Monaco, monospace;background-color:rgb(247, 249, 250);white-space:pre-wrap;width:640px;"><span class="yiv98087206co1" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(128, 128, 128);font-style:italic;">% make the process interactive</span>
cfg.<span class="yiv98087206me1" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(0, 102, 0);">artfctdef</span>.<span class="yiv98087206me1" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(0, 102, 0);">zvalue</span>.<span class="yiv98087206me1" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(0, 102, 0);">interactive</span> = <span class="yiv98087206co2" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(128, 128, 128);font-style:italic;">'yes'</span>;</pre></span></span></div><div>I see nothing in the figure that is
 plotted. I see the data plotted when i use the sample data provided but not when i use my Neuroscan EEG data.</div><div><br></div><div>Secondly when i click on stop I get the error pasted below.<br></div><div><br></div><div><img alt="" height="204" width="403"></div><div><br></div><div>??? Reference to non-existent field 'dimord'.<br><br>Error in ==> dimlength at 74<br>      elseif strcmp(data.(fld), 'rpt_pos')<br><br>Error in ==> fixsampleinfo at 31<br>  ntrial = dimlength(data, 'rpt');<br><br>Error in ==> ft_checkdata at 579<br>  data = fixsampleinfo(data);<br><br>Error in ==> ft_rejectartifact at 203<br>  data = ft_checkdata(data, 'hassampleinfo', 'yes');<br><br>Error in ==> do_reject_artifacts at 70<br>data_no_artifact_jump = ft_rejectartifact(cfg,artifact_jump);<br><br>Error in ==> do_preprocess at
 45<br>                do_reject_artifacts(subject);</div><div><br></div><div>I am comfortable making changes to the code and would like some
 pointers in the right direction. I am not sure if this is an issue with Neuroscan data.</div><div><br></div><div>Thanks</div><div><br></div><div>Omoniyi Segun</div></div></div><br><br></div></div></div></div>_______________________________________________<br>fieldtrip mailing list<br><a rel="nofollow" ymailto="mailto:fieldtrip@donders.ru.nl" target="_blank" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br><div>
<span class="yiv98087206Apple-style-span" style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:medium;"><span class="yiv98087206Apple-style-span" style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:medium;"><div style="word-wrap:break-word;"><span class="yiv98087206Apple-style-span" style="border-collapse:separate;color:rgb(0, 0,
 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:medium;"><div style="word-wrap:break-word;"><span class="yiv98087206Apple-style-span" style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;"><div style="word-wrap:break-word;"><div>Jan-Mathijs Schoffelen, MD PhD </div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><a rel="nofollow" ymailto="mailto:J.Schoffelen@donders.ru.nl" target="_blank"
 href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: +31-24-3614793</div></div></span></div></span></div></span></span>
</div>
<br></div></div></div><br><br></div></div></div></div></div><br><br></div></div></div></body></html>