Page 1 of 1

Trigger problems revisited

Posted: Wed Oct 25, 2006 11:21 pm
by Erin McMullen
Hello!

I posted here some time ago and got a very helpful response about trigger problems using BESA to analyze BDF files. Now I am trying to analyze a bigger set of BDF data using EEGLab, and am having different, though possibly related, trigger difficulties. Instead of seeing a string of identical trigger numbers like 62850, I am seeing much larger trigger numbers, on the order of 6570209. They vary across trials, so it is not the same problem -- but I can't help but think that the trigger logic may be related somehow. Unfortunately, I could not view an exhaustive list of triggers in EEGLab, so determining the mapping was not possible.

I then downloaded LabView and BDFReader so that I could at least view the datafile properly, where trigger numbers are easy to read, hoping to "work backward" by determining the real trigger value for the first, second, etc triggers. However, this program's default trigger display is in the "colored dot" format rather than the decimal format. Is there a way to change this setting?

I apologize if this matter would better be taken up with EEGLab folk; I have tried numerous times to contact their support system and have failed each time, I'm afraid... but I am hopeful that someone here has seen this problem before and can help, either on the EEGLab side or the BDFReader side.

Thanks very much in advance!

Posted: Fri Oct 27, 2006 4:21 pm
by Coen
I have a special version of the BDF reader available, which displays the trigger values as arrays of numbers. Please email me directly for such a special version of the BDF reader.

Best regards, Coen (BioSemi)

Posted: Tue Jan 30, 2007 7:06 pm
by stephane dufau
Hi Erin,
Here is the matlab function I use to change the condition code. I had a similar problem :? (condition code were read as -7045842). On my system, good information was hold in the last 8 bits of the 24 BIOSEMI uses in bdf files. To use the function, launch EEGLAB, read your bdf data. Once you have saved a '.set' file, run the function. The EEGLAB version I use is 4.515.
Hope it will help :wink: .
Stephane

-----------------------------------------------------------
%change the condition codes into decimal numbers
% condition codes in "event" & "urevent"

for ii = 1:length(EEG.event)

valIni = EEG.event(ii).type;

%test between event & urevent
if EEG.urevent(ii).type ~= valIni
error(' --- correspondance pb between condition codes --- ');
end

%if correspondance OK
%change to decimal value
valIni2 = dec2bin(abs(valIni));
valIni3 = valIni2(16:length(valIni2));
valIni4 =dec2bin(bitcmp(bin2dec(valIni3),9));
valIni5 = valIni4(2:length(valIni4));
valIni6 = bin2dec(valIni5)+1;

%write the decimal value
EEG.event(ii).type = valIni6 ;
EEG.urevent(ii).type = valIni6 ;

old_val(ii) = valIni;
new_val(ii) = valIni6;

clear valIni valIni2 valIni3 valIni4 valIni5 valIni6;

end

%display of the new codes
cpt = 1;
for ii = 1:length(old_val)

if ii == 1
fprintf('\n%s%s%s%s\n', ['chgt_' num2str(cpt) ' : '], num2str(old_val(ii)), ' , into: ', num2str(new_val(ii)));
code_vu(cpt) = new_val(ii);
cpt = cpt + 1;

else
vu_bool = 0;
for ij = 1:length(code_vu)
if new_val(ii) == code_vu(ij)
vu_bool = 1;
end
end
if vu_bool == 0
fprintf('%s%s%s%s\n', ['chgt_' num2str(cpt) ' : '], num2str(old_val(ii)), ' , into: ', num2str(new_val(ii)));
code_vu(cpt) = new_val(ii);
cpt = cpt + 1;
end
end
end
fprintf('\n');
----------------------------------------------------

BDF Events detection

Posted: Wed Jul 09, 2008 6:08 pm
by fdigrazia
Hi,
I used the Matlab codes (Schloegl & Lorig) present on the BioSemi webpage to read my Biosemi .bdf data.
But I couldn't extract the correct data and the events.
Could someone help me?[/list]