<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi James,<br>
<br>
Sorry for the late reply. I've been trying to do manual rejection on my
files again but still can't reliably produce the shift, will keep you
updated. <br>
<br>
I am not entirely sure of this but looking at one of the files, it
seems my event markers are shifted as well because in this subject the
first marker does not coincide with eye blink in the original data but
after the rejection it does. Also, when I ran the script on my files
which did not have the boundary shift, most of them produced graphs
with a missing bit (picture:
<a class="moz-txt-link-freetext" href="http://www.flickr.com/photos/89964745@N02/8229307918/">http://www.flickr.com/photos/89964745@N02/8229307918/</a>)<br>
<br>
> Is it the case that the boundary shift is only occurring for some
of your data files? <br>
Yes, it only occurred in 10 out of my 52 subjects.<br>
<br>
> And, for these files does the boundary shift only happen on some
manual rejection attempts?<br>
Yes, it happened at different time points in different files. <br>
<br>
Thank you.<br>
<br>
Maria<br>
<br>
<br>
On Sunday 25,November,2012 11:08 AM, James Desjardins wrote:
<blockquote
 cite="mid:8C45914598D47142BD444B23E1A067510194CCD7@MAILSTORE2.campus.brocku.local"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <div
 style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt;">Hi
Maria,<br>
  <br>
The error in issue 1 was probably due to the presence of "boundary"
events in the file that was used (their latency values are not integers
as they are meant to sit between data points). The following script
will not bother placing a square wave at boundary latencies. Also it
will make the square wave 5 points wide so that it can be seen from
behind the black line in the ERPimage figure.<br>
  <br>
** Run this script on a file that has produced the boundary shift. But,
run it on the file before rejecting time periods. Once it saves the new
file with the trigger channel named "trig_test.set" open that file and
perform your manual rejection procedure on it. <br>
  <div><br>
  <font face="Courier New">EEG.nbchan=EEG.nbchan+1;<br>
EEG.data(EEG.nbchan,:)=zeros(size(EEG.data(1,:)));<br>
EEG.chanlocs(EEG.nbchan).labels='trig';<br>
for i=1:length(EEG.event);<br>
    if ~strcmp(EEG.event(i).type,'boundary');<br>
       
EEG.data(EEG.nbchan,[EEG.event(i).latency:EEG.event(i).latency+5])=50;<br>
    end<br>
end<br>
  <br>
EEG=eeg_checkset(EEG);<br>
eeglab redraw<br>
EEG = pop_saveset( EEG, 'filename','trig_test.set', 'filepath',cd);<br>
  </font><br>
  <br>
The error in the second procedure that you mention seems to be an
EEGLab bug that interacts with the ERPimage axis limits. If we specify
the "limits" option in the call to pop_erpimage the error does not
occur. The script below takes care of this issue.<br>
  <br>
** once that you have manually rejected time periods from the
"trig_test.set" file run the following script to see if the trigger
channel is still lined up with the event markers (red vertical line
behind the black vertical line in the ERPimage raster plot).<br>
  <br>
  <br>
  <font face="Courier New">evtlst=unique({EEG.event.type});<br>
evtlst(strmatch('boundary',evtlst))=[];<br>
EEG = pop_epoch( EEG, unique({EEG.event.type}), [-0.4 0.4], ...<br>
    'newname', 'trigLock', ...<br>
    'epochinfo', 'yes');<br>
EEG = eeg_checkset( EEG );<br>
figure;<br>
pop_erpimage(EEG,1, [EEG.nbchan],[[]],'trig',1,1,{},[],'' , ...<br>
    'yerplabel','\muV', ...<br>
    'erp','on', ...<br>
    'cbar','on', ...<br>
    'topo', { [EEG.nbchan] EEG.chanlocs EEG.chaninfo }, ...<br>
    'limits',[-280,280,0,60,NaN,NaN,NaN,NaN,NaN]);<br>
  </font><br>
  <br>
  <br>
Is it the case that the boundary shift is only occurring for some of
your data files?<br>
  <br>
And, for these files does the boundary shift only happen on some manual
rejection attempts?<br>
  <br>
I think that you should open the "trig_test.set" file, perform manual
rejection then plot the ERPimage (script 2 above)... then repeat this
until you can generate the boundary shift reliably... then see if there
is some characteristic of the procedure that relates. <br>
  <br>
In the mean time I am trying to cause the boundary shift to occur (from
manual rejection) on some of my files here.<br>
 <br>
  <div style="font-family: Tahoma; font-size: 13px;">
  <div class="BodyFragment"><font size="2"><span
 style="font-size: 10pt;">
  <div class="PlainText">James Desjardins, MA<br>
Electrophysiology Technologist<br>
Cognitive and Affective Neuroscience Lab, Psychology Department <br>
Jack and Nora Walker Centre for Lifespan Development Research<br>
Brock University<br>
500 Glenridge Ave.<br>
St. Catharines, ON, Canada L2S 3A1<br>
905-688-5550 x4676<br>
--<br>
"'Cause you never can tell What goes on down below!<br>
"This pool might be bigger Than you or I know!"<br>
  <br>
McElligot's Pool<br>
Dr.Seuss 1947</div>
  </span></font></div>
  </div>
  </div>
  <div
 style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
  <hr tabindex="-1">
  <div style="direction: ltr;" id="divRpF293422"><font face="Tahoma"
 color="#000000" size="2"><b>From:</b> Maria Teresa Wijaya
[<a class="moz-txt-link-abbreviated" href="mailto:a0089301@nus.edu.sg">a0089301@nus.edu.sg</a>]<br>
  <b>Sent:</b> November-23-12 3:18 AM<br>
  <b>To:</b> James Desjardins<br>
  <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:eeglablist@sccn.ucsd.edu">eeglablist@sccn.ucsd.edu</a><br>
  <b>Subject:</b> Re: [Eeglablist] Shifted rejection boundaries in
continuous data<br>
  </font><br>
  </div>
  <div>Hi James,<br>
  <br>
I have run your script:<br>
  <br>
1. On the files which have gone through the artifact rejection and had
the rejection boundaries shifted: I did not get the 50µV ERP in the ERP
image. I thought the ERP may be added at the wrong time point (not
coinciding with the events) but I also did not see it in the channel
data scroll at all. I am not sure if this is relevant but I got these
error messages: <br>
  <blockquote><small>>>
EEG.data(EEG.nbchan,[EEG.event.latency])=50;<br>
??? Subscript indices must either be real positive integers or logicals.<br>
    <br>
>> pop_erpimage(EEG,1, [EEG.nbchan],[[]],'trig',1,1,{},[],'' , ...<br>
'yerplabel','\muV', ...<br>
'erp','on', ...<br>
'cbar','on', ...<br>
'topo', { [EEG.nbchan] EEG.chanlocs EEG.chaninfo } );<br>
Command executed by pop_erpimage:<br>
 <br>
 erpimage( mean(EEG.data([72], :),1), ones(1,
EEG.trials)*EEG.xmax*1000, linspace(EEG.xmin*1000, EEG.xmax*1000,
EEG.pnts), 'trig', 1, 1 , 'yerplabel', '\muV', 'erp', 'on', 'cbar',
'on', 'topo', { [72]' EEG.chanlocs EEG.chaninfo });<br>
    <br>
Plotting input data as 683 epochs of 204 frames sampled at 256.0 Hz.<br>
Sorting data on input sortvar.<br>
100.00% of the trials (i.e., 683 out of 683) have the same sortvar
value as at least one other trial.<br>
Distribution of number ties per unique value of sortvar:<br>
Min: 683, 25th ptile: 683, Median: 683, 75th ptile: 683, Max: 683<br>
    <br>
The caxis range will be the sym. abs. data range -> [-0,0].<br>
Data will be plotted between -398.438 and 394.531 ms.<br>
??? Error using ==> set<br>
Bad property value found.<br>
Object Name :  axes<br>
Property Name : 'CLim'<br>
Values must be increasing and non-NaN.<br>
    <br>
Error in ==> imagesc at 47<br>
  set(cax,'CLim',clim)<br>
    <br>
Error in ==> erpimage at 2042<br>
            h_eim=imagesc(times,outtrials,data',[mindat,maxdat]);% plot
time on x-axis<br>
    <br>
Error in ==> pop_erpimage at 668<br>
eval(com)</small><br>
    <br>
  </blockquote>
  <br>
2. On the files from the same subjects which I re-did the the artifact
rejection and now they have the correct boundaries: I got the 50µV ERP
and the vertical stripe (though it's black) in the ERP image. I also
got a slightly different message when running the pop_erpimage command
on these files:<br>
  <blockquote><small>>> pop_erpimage(EEG,1,
[EEG.nbchan],[[]],'trig',1,1,{},[],'' , ...<br>
'yerplabel','\muV', ...<br>
'erp','on', ...<br>
'cbar','on', ...<br>
'topo', { [EEG.nbchan] EEG.chanlocs EEG.chaninfo } );<br>
Command executed by pop_erpimage:<br>
 <br>
 erpimage( mean(EEG.data([72], :),1), ones(1,
EEG.trials)*EEG.xmax*1000, linspace(EEG.xmin*1000, EEG.xmax*1000,
EEG.pnts), 'trig', 1, 1 , 'yerplabel', '\muV', 'erp', 'on', 'cbar',
'on', 'topo', { [72]' EEG.chanlocs EEG.chaninfo });<br>
 <br>
Plotting input data as 791 epochs of 204 frames sampled at 256.0 Hz.<br>
Sorting data on input sortvar.<br>
100.00% of the trials (i.e., 791 out of 791) have the same sortvar
value as at least one other trial.<br>
Distribution of number ties per unique value of sortvar:<br>
Min: 791, 25th ptile: 791, Median: 791, 75th ptile: 791, Max: 791<br>
    <br>
The caxis range will be the sym. abs. data range -> [-50,50].<br>
Data will be plotted between -398.438 and 394.531 ms.<br>
Output data will be 204 frames by 791 smoothed trials.<br>
Outtrials: 1.00 to 791.00<br>
Overplotting sorted sortvar on data.<br>
Plotting the ERP trace below the ERP image<br>
??? Undefined function or variable "l1".<br>
    <br>
Error in ==> erpimage>plot1trace at 3566<br>
plot_handle=[plot_handle l1 l2];<br>
    <br>
Error in ==> erpimage at 2878<br>
            tmph =
plot1trace(ax2,times,erp,limit,erpsig,[],[],erp_grid,erp_vltg_ticks); %
plot ERP and 0+/-alpha threshold<br>
    <br>
Error in ==> pop_erpimage at 668<br>
eval(com)</small><br>
  </blockquote>
I also got similar message when running the scripts on data from
subjects which never have any boundary problem.<br>
  <br>
Do you have any advice as to what I should look at next?<br>
  <br>
Thank you for your help.<br>
  <br>
Regards,<br>
Maria<br>
  <br>
  <br>
  <br>
  <br>
On Thursday 22,November,2012 10:37 PM, James Desjardins wrote:
  <blockquote type="cite">
    <style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
BODY {direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;}P {margin-top:0;margin-bottom:0;}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollba
r-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}</style>
    <div
 style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt;"><br>
Hi Maria,<br>
    <br>
We can check to see if your shift is affecting the event markers other
than the "boundary" events.<br>
    <br>
Load a file like you normally do and copy the following code to the
command line to create a "trig" channel in the EEG.data array (and save
a test file named "trig_test.set" in the current directory):<br>
    <br>
    <font face="Courier New">EEG.nbchan=EEG.nbchan+1;<br>
EEG.data(EEG.nbchan,:)=zeros(size(EEG.data(1,:)));<br>
EEG.chanlocs(EEG.nbchan).labels='trig';<br>
EEG.data(EEG.nbchan,[EEG.event.latency])=50;<br>
    <br>
EEG=eeg_checkset(EEG);<br>
eeglab redraw<br>
    <br>
pop_eegplot( EEG, 1, 0, 1);<br>
    <br>
EEG = pop_saveset( EEG, 'filename','trig_test.set', ... 'filepath',cd);<br>
    </font><br>
    <br>
At this point you can remove a data interval the way that you normally
do (perhaps remove an approximately 1 second data portion following the
10th event marker).<br>
    <br>
Now copy the following code to the command line in order to segment
+/-400ms intervals around all event types and plot an ERPimage figure.<br>
    <br>
    <br>
    <font face="Courier New">EEG = pop_epoch( EEG,
unique({EEG.event.type}), [-0.4 0.4], ...<br>
'newname', 'trigLock', ...<br>
'epochinfo', 'yes');<br>
EEG = eeg_checkset( EEG );<br>
figure;<br>
pop_erpimage(EEG,1, [EEG.nbchan],[[]],'trig',1,1,{},[],'' , ...<br>
'yerplabel','\muV', ...<br>
'erp','on', ...<br>
'cbar','on', ...<br>
'topo', { [EEG.nbchan] EEG.chanlocs EEG.chaninfo } );<br>
    </font><br>
    <br>
If everything is OK there should be a red vertical stripe in the
surface plot at 0 ms and a 50 µV ERP at 0 ms in the bottom waveform.<br>
    <br>
If there is not a vertical stripe at 0 ms we can use the trig_test.set
file to explore the cause of the shift.<br>
    <br>
This will also let us know if the "boundary" shift is a separate issue.<br>
    <br>
James<br>
________________________________________<br>
From: Maria Teresa Wijaya [<a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:a0089301@nus.edu.sg"
 target="_blank">a0089301@nus.edu.sg</a>]<br>
Sent: November-22-12 1:53 AM<br>
To: James Desjardins<br>
Cc: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:mmiyakoshi@ucsd.edu" target="_blank">
mmiyakoshi@ucsd.edu</a>; <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:eeglablist@sccn.ucsd.edu"
 target="_blank">
eeglablist@sccn.ucsd.edu</a><br>
Subject: Re: [Eeglablist] Shifted rejection boundaries in continuous
data<br>
    <br>
Hi James,<br>
    <br>
I did everything using the GUI: plot > channel data (scroll) >
drag and<br>
click to specify the boundaries > reject button > save it as file
. In<br>
my case, my events seem to still be in the right place when I tried<br>
using eeg_eegrej function with overlapping boundaries.<br>
    <br>
Maria<br>
    <br>
    <br>
On Wednesday 21,November,2012 11:41 AM, James Desjardins wrote:<br>
> Hi Maria,<br>
><br>
> What were the exact functions or menu items that you used to
select the periods for rejection?<br>
><br>
> Similarly, what exactly did you use to remove the periods?<br>
><br>
> I am interested in this problem because I have caused such things
to happen while tinkering with the EEG structure from the command line.
The shifting of events from their true position relative to the data
can occur if there is overlap among the latency boundaries specified
for removal in a call to the eeg_eegrej function, but I have never seen
it happen while building latency boundaries or removing continuous data
periods using the EEGLab GUI.<br>
><br>
> For example, If I specify overlapping latency boundaries:<br>
><br>
> rejarr=[10000 11000;10900 11900];<br>
><br>
> Then try to remove both of them with one call to eeg_eegrej:<br>
><br>
> EEG = eeg_eegrej(EEG, rejarr);<br>
><br>
> I find that all of the events following the rejection period are
shifted to the left (relative to their true position) in the data
scroll (with the shift distance being equal to the duration of the
overlap across the rejarr latency boundaries).<br>
><br>
> If you are building latency boundaries outside of the EEGLab GUI
and using eeg_eegrej to purge them it is crucial that you merge the
overlapping latency boundaries.<br>
><br>
> Again, I am very interested in this topic. I look forward to
exploring this further if you have more to add.<br>
><br>
><br>
> James<br>
><br>
> ________________________________________<br>
> From: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:eeglablist-bounces@sccn.ucsd.edu" target="_blank">
eeglablist-bounces@sccn.ucsd.edu</a> [<a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:eeglablist-bounces@sccn.ucsd.edu" target="_blank">eeglablist-bounces@sccn.ucsd.edu</a>]
on behalf of Maria Teresa Wijaya [<a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:a0089301@nus.edu.sg"
 target="_blank">a0089301@nus.edu.sg</a>]<br>
> Sent: November-18-12 11:07 PM<br>
> To: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:mmiyakoshi@ucsd.edu" target="_blank">
mmiyakoshi@ucsd.edu</a><br>
> Cc: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">
eeglablist@sccn.ucsd.edu</a><br>
> Subject: Re: [Eeglablist] Shifted rejection boundaries in
continuous data<br>
><br>
> Dear Makoto,<br>
><br>
> I recorded my data using Biosemi Active two system with 64
electrodes at<br>
> 256Hz. Data were band pass filtered at 0.1-20 Hz and re-referenced<br>
> offline first to nose reference to remove bad channels. Removed
channels<br>
> were interpolated and the data were re-referenced to average
reference.<br>
> I then checked the continuous data for non-typical artifacts,
removed<br>
> them, and saved the data with a new name. The shifted rejection<br>
> boundaries problem appeared in this new data set.<br>
><br>
> Kindly let me know if I need to provide any other information.<br>
><br>
> Thank you.<br>
><br>
> Regards,<br>
> Maria<br>
><br>
><br>
><br>
> On Saturday 17,November,2012 01:33 PM, Makoto Miyakoshi wrote:<br>
><br>
>> Dear Maria,<br>
>><br>
>> We need more information to identify what caused this.<br>
>> Could you tell me more detail?<br>
>><br>
>> Makoto<br>
>><br>
>> 2012/11/12 Maria Teresa Wijaya<a moz-do-not-send="true"
 class="moz-txt-link-rfc2396E" href="mailto:a0089301@nus.edu.sg"
 target="_blank"><a0089301@nus.edu.sg></a>:<br>
>><br>
>><br>
>>> Dear list,<br>
>>><br>
>>> I did rejection on continuous data and noticed that the
rejection<br>
>>> boundaries shifted from where they are supposed to be
(picture here:<br>
>>> <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://www.flickr.com/photos/89964745@N02/8178303896/in/photostream"
 target="_blank">
http://www.flickr.com/photos/89964745@N02/8178303896/in/photostream</a>).<br>
>>> This happened to several of my subjects, and it also
happened to someone<br>
>>> else in our lab before. My questions are:<br>
>>><br>
>>> - What are the possible reasons of this shift?<br>
>>> - Is there any way I can know if any of my event triggers
have also been<br>
>>> shifted or if only the rejection boundaries are shifted?<br>
>>><br>
>>> Thank you for your help.<br>
>>><br>
>>> Regards,<br>
>>> Maria<br>
>>> _______________________________________________<br>
>>> Eeglablist page: <a moz-do-not-send="true"
 class="moz-txt-link-freetext"
 href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">
http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
>>> To unsubscribe, send an empty email to <a
 moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">
eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
>>> For digest mode, send an email with the subject "set
digest mime" to <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">
eeglablist-request@sccn.ucsd.edu</a><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
> _______________________________________________<br>
> Eeglablist page: <a moz-do-not-send="true"
 class="moz-txt-link-freetext"
 href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">
http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
> To unsubscribe, send an empty email to <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">
eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
> For digest mode, send an email with the subject "set digest mime"
to <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">
eeglablist-request@sccn.ucsd.edu</a><br>
><br>
    <br>
    </div>
  </blockquote>
  <br>
  </div>
  </div>
  </div>
</blockquote>
<br>
</body>
</html>