You are on page 1of 34

Master Project Presentation

Final Preparation of the CeBIT Data

Ignatius Sapto Condro Atmawan


Matrikel Number 2113914

Supervised by: Dr.-Ing. Ivan Volosyak


Examined by: Prof. Dr.-Ing. Axel Gräser
Content

• Introduction
• SSVEP-based BCI
• EEG Data Storing in IAT
• Alternative Data Format
• Conclusion

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 2
Introduction

• Brain-Computer Interface (BCI)


research at the IAT of the University of
Bremen started in 2005
• IAT BrainRobot group uses SSVEP-
based BCI spelling application at the
fairs CeBit2008 and Rehacare2008
• There is a software bug in CeBit data
storing
Final Preparation of the CeBIT Data
Ignatius Sapto Condro Atmawan 3
SSVEP based BCI

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 4
SSVEP based BCI (I)

Brain-Computer Interface (BCI) is a


communication system in which
messages or commands that an
individual sends to the external world do
not pass through the brain’s normal
output pathways of peripheral nerves
and muscles.
(Wolpaw, et al. 2002. Clinical Neurophysiology)

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 5
SSVEP based BCI (II)

Steady-State Visually Evoked Potential


(SSVEP) is the electrophysiological
response of the visual cortex to a
rapidly repeating (flickering) stimulus.
(Malinowski, et al. 2007. Neuroscience Letter)

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 6
IAT study at the CeBit 2008

Sugiarto. 2008. Master Thesis


Kemp, et al. http://www.edfplus.info/specs/edftexts.html

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 7
Bremen-BCI Spelling software

Sugiarto. 2008. Master Thesis


Allison et al. 2008. Proc. 4th International Brain-computer Interface Workshop and Training
Course.

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 8
EEG Data Storing at IAT

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 9
Data Storing: CeBit Data Format (I)

• No header
• Information is in the folder name

Folder_Name\d_m_yyyy\Subject_N\Experiment_at_hh_mm.txt (or .bin)


d_m_yyyy or dd_mm_yyyy : experiment date
Subject_N : subject number
hh_mm : experiment start time
Txt or bin : text or binary file

e.g.
• C:\BCIData\3_2_2009\Subject_999\Experiment_at_14_35.txt
• F:\RecordedCEBIT3\5_3_2008\Subject_31\ Experiment_at_11_12.bin

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 10
Data Storing: CeBit Data Format (II)

• Time-based order
• Column 1-6: EEG signals from 6
channels, float
• Column 7: command, int

• 4.58068 9.87616 0.676514 18.0576 11.7465 0 3


• -8.72467 57.0976 -233.682 -179.563 -57.0293 79079 3
• -100.928 124.535 -1029.09 -989.75 -389.663 1.71191e-030 3
• -217.56 101.889 -1598.54 -1609.01 -680.271 0 3

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 11
Data Storing: Acquisition (I)

DATA ACQUISITION THREAD (CeBIT Software)


in SSVEP_gUSBampDlg.cpp :

• // Wait for new data to be ready


• GT_GetData(pthis->m_hdev, pByteBuffer,HEADER_SIZE + BufferLengthBytes,&ov);
• dwResult = WaitForSingleObject(pthis->m_hEvent_DataReady,1000);

• // Convert 4 bytes into floats and store in the data buffer
• for(j=0; j<pthis->m_NbrOfChannels; j++)
• {
• for(i=0; i<pthis->m_BufferSizeScans;i++)
• {
• pfl = (float*)(pByteBuffer + HEADER_SIZE + (iBytesperScan)*i + j*sizeof(float));
• pDataBuffer[i + j*pthis->m_BufferSizeScans] = *pfl;
• pthis->m_vSignals[(j+1)*pthis->m_SegLenSamples-pthis->m_BufferSizeScans+i] = *pfl;
• }
• }

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 12
Data Storing: CeBit Results

• 4.58068 9.87616 0.676514 18.0576 11.7465 0 3


• -8.72467 57.0976 -233.682 -179.563 -57.0293 79079 3
• -100.928 124.535 -1029.09 -989.75 -389.663 1.71191e-030 3
• -217.56 101.889 -1598.54 -1609.01 -680.271 0 3 Different?
• -179.722 -52.9912 -633.289 -565.716 -295.813 0 3
• -6.11695 -182.173 1031.37 1264.33 453.48 0 3
• 78.9396 -153.218 1355.57 1592.66 619.318 4.80701e-041 3
• 32.2359 -58.5553 520.087 602.787 234.805 0 3
• 3.17374 -27.0085 120.554 107.899 35.9006 0 3
• 36.5446 -41.549 361.625 351.302 139.178 0 3
• 67.4789 -37.6821 505.338 493.747 206.767 3.48975e-039 3
• 67.3758 -11.7578 349.746 302.14 137.306 2.42446e-038 3
• 56.8749 6.98531 169.164 84.1304 52.0167 -2.3426e-026 3
• 59.0427 10.1912 154.197 58.1533 43.2566 0 2
• 65.9106 12.7982 180.475 84.6529 56.7646 79079 2
• .......

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 13
Data Storing: Check

DATA ACQUISITION THREAD (Modified CeBit Software)


In SSVEP_gUSBampDlg.cpp:

• // Wait for new data to be ready


• GT_GetData(pthis->m_hdev, pByteBuffer,HEADER_SIZE + BufferLengthBytes,&ov);
• dwResult = WaitForSingleObject(pthis->m_hEvent_DataReady,1000);

• // Convert 4 bytes into floats and store in the data buffer


• static int iNumber = 0;
• for(j=0; j<pthis->m_NbrOfChannels; j++)
• {
• for(i=0; i<pthis->m_BufferSizeScans;i++)
• {
• pfl = (float*)(pByteBuffer + HEADER_SIZE + (iBytesperScan)*i + j*sizeof(float));

• // Condro tries to change this into counter


• pDataBuffer[i + j*pthis->m_BufferSizeScans] = 0.001 * static_cast<float>(iNumber); // Condro's change
• iNumber++; // Condro's change
• pthis->m_vSignals[(j+1)*pthis->m_SegLenSamples-pthis->m_BufferSizeScans+i] = *pfl;
• }
• }

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 14
Data Storing:
CeBit Checking Results


0
0.001 0.014
0.013 0.026
0.027
0.039
0.04
0.052
0.053
-4.22017e+037
-1.21979e-012
0
0
Bugs!
• 0.002 0.015 0.028 0.041 0.054 -1.21979e-012 0
• 0.003 0.016 0.029 0.042 0.055 0 0
• 0.004 0.017 0.03 0.043 0.056 0 0
• 0.005 0.018 0.031 0.044 0.057 1.89419e+030 0
• 0.006 0.019 0.032 0.045 0.058 2.75846e-023 0
• 0.007 0.02 0.033 0.046 0.059 6.36856e-037 0
• 0.008 0.021 0.034 0.047 0.06 1.80468e-037 0
• 0.009 0.022 0.035 0.048 0.061 6.39981e-039 0
• 0.01 0.023 0.036 0.049 0.062 6.02558e-043 0
• 0.011 0.024 0.037 0.05 0.063 4.17587e-043 0
• 0.012 0.025 0.038 0.051 0.064 1.4013e-045 0
• 0.065 0.078 0.091 0.104 0.117 -4.22017e+037 0
• 0.066 0.079 0.092 0.105 0.118 -1.21979e-012 0
• ...........
End of thread
Start of thread

m_NbrOfChannels = 5 and m_BufferSizeScans = 13

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 15
IAT RehaCare Data Format (I)

• No header
• Information is in the folder name

Folder_Name\ddmmyyyy\Subject_N\Experiment_at_hh_mm_Threshold_TTT_Word_XXX.txt
(or .bin)
ddmmyyyy : experiment date
Subject_N : subject number
hh_mm : experiment start time
TTT: threshold
XXX: word for spelling
Txt or bin : text or binary file

e.g.

• E:\RecordedRehaCare\13102008\Subject_1\Experiment_at_16_19_Threshold_260_Word_BCI.txt
• E:\RecordedRehaCare\10122008\Subject_919\Resume_Experiment_at_16_04_Threshold_200_Word_BR
AIN.txt

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 16
IAT RehaCare Data Format (II)

• Time based order


• Column 1-6: EEG signals from 6 channels, float32,
scientific format with 7 significant numbers
• Column 7: command, int32
• Column 8-12: SNRs (from 5 stimuli), float32, scientific
format with 7 significant numbers
• Column 13: command accuracy, int32
• Column 14: current cursor position, ASCII char
• Column 15: selected letter, ASCII char
• Column 16: absolute time, string (CString),
hh:mm:ss.xxx format, ms resolution
Final Preparation of the CeBIT Data
Ignatius Sapto Condro Atmawan 17
Data Storing: Check

DATA ACQUISITION THREAD (Modified RehaCare Software)


In SSVEP_gUSBampDlg.cpp:

• // Wait for new data to be ready


• GT_GetData(pthis->m_hdev, pthis->pByteBuffer,HEADER_SIZE + BufferLengthBytes,&ov);
• dwResult = WaitForSingleObject(pthis->m_hEvent_DataReady,1000);

• // Convert 4 bytes into floats and store in the data buffer


• static int iNumber = 0;
• for(j=0; j<pthis->m_NbrOfElectordes; j++)
• {
• for(i=0; i<pthis->m_BufferSizeScans;i++)
• {
• pfl = (float*)(pthis->pByteBuffer + HEADER_SIZE + (iBytesperScan)*i + j*sizeof(float));

• // Condro tries to change this into counter


• pthis->pDataBuffer[i + j*pthis->m_BufferSizeScans] = 0.01 * static_cast<float>(iNumber); // Condro's change
• iNumber++; // Condro's change
• pthis->m_vSignals[(j+1)*pthis->m_SegLenSamples-pthis->m_BufferSizeScans+i] = *pfl;
• }
• }

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 18
Rehacare Checking Results

• +0.000000e+000 +1.300000e-001 +2.600000e-001 +3.900000e-001 +5.200000e-001 +6.500000e-001 0


• +1.000000e-002 +1.400000e-001 +2.700000e-001 +4.000000e-001 +5.300000e-001 +6.600000e-001 0
• +2.000000e-002 +1.500000e-001 +2.800000e-001 +4.100000e-001 +5.400000e-001 +6.700000e-001 0 No Bugs
• +3.000000e-002 +1.600000e-001 +2.900000e-001 +4.200000e-001 +5.500000e-001 +6.800000e-001 0
• +4.000000e-002 +1.700000e-001 +3.000000e-001 +4.300000e-001 +5.600000e-001 +6.900000e-001 0
• +5.000000e-002 +1.800000e-001 +3.100000e-001 +4.400000e-001 +5.700000e-001 +7.000000e-001 0
• +6.000000e-002 +1.900000e-001 +3.200000e-001 +4.500000e-001 +5.800000e-001 +7.100000e-001 0
• +7.000000e-002 +2.000000e-001 +3.300000e-001 +4.600000e-001 +5.900000e-001 +7.200000e-001 0
• +8.000000e-002 +2.100000e-001 +3.400000e-001 +4.700000e-001 +6.000000e-001 +7.300000e-001 0
• +9.000000e-002 +2.200000e-001 +3.500000e-001 +4.800000e-001 +6.100000e-001 +7.400000e-001 0
• +1.000000e-001 +2.300000e-001 +3.600000e-001 +4.900000e-001 +6.200000e-001 +7.500000e-001 0
• +1.100000e-001 +2.400000e-001 +3.700000e-001 +5.000000e-001 +6.300000e-001 +7.600000e-001 0
• +1.200000e-001 +2.500000e-001 +3.800000e-001 +5.100000e-001 +6.400000e-001 +7.700000e-001 0
• +7.800000e-001 +9.100000e-001 +1.040000e+000 +1.170000e+000 +1.300000e+000 +1.430000e+000 0
• +7.900000e-001 +9.200000e-001 +1.050000e+000 +1.180000e+000 +1.310000e+000 +1.440000e+000 0
• ......
End of
thread
Start of thread

m_NbrOfElectrodes = 6 and m_BufferSizeScans = 13

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 19
Why did the CeBit software
store data wrongly?
• In the constructor, the number of channels is initialized
CSSVEP_gUSBampDlg::CSSVEP_gUSBampDlg(CWnd* pParent /*=NULL*/)
{ ...
, m_NbrOfChannels(6)
...
}

• But the number of channels changes after reading the


configuration file
// Read Configuration File (config.txt)
void CSSVEP_gUSBampDlg::readConfig(void)
{ ...
indeks = dummy.Find("Number_Of_Channels");
...
this->m_NbrOfChannels = atoi(dummy);
...
}

• Inside the file config.txt


Number_Of_Channels = 5

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 20
EEG Data Storing Bug at the
CeBit
• The CeBit software is not consistent using the number of
channels and the number of electrodes, resulting loss of one
data from 6 EEG electrodes.
• The number of channels should be equal to the number of
stimuli (5 flickering boxes), instead of the number of electrodes
(6)
• In the RehaCare software, the EEG data acquisition problem
has been solved by the right usage of the variables:
m_NBrOfChannels and m_NBrOfElectrodes.

• Other data formats could be considered for future works

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 21
Alternative Data Formats

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 22
Alternative Data Formats

• Data exchange
• With or without header
• Number of channels vs. number of
electrodes
• Time-based order vs. channel-based
order
• Record, channels and sample

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 23
Alternative Data Format:
Time based order

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 24
Alternative Data Format:
Channel based order (I)

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 25
Alternative Data Format:
Channel based order (II)

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 26
Alternative Data Format:
European Data Format (EDF)

• There are EDF and EDF+


• With header
• Fixed Header size = 256 Bytes
• Variable Header Size = N x 256 Bytes, with
N = number of channels/signals
• The record is in time-based order
• Inside a record, data block is in a channel-
based order
• Supports only int16 (short int)

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 27
Alternative Data Format:
BioSemi Data Format (BDF)

• BDF is another improvement of EDF


• Developed by BioSemi, in Amsterdam
• Supports only int24

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 28
Alternative Data Format:
Overview of EDF and BDF fixed header

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 29
Alternative Data Format:
Overview of EDF and BDF variable header

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 30
Alternative Data Format:
General Data Format (GDF)

• GDF v1.x is an improvement of EDF and


BDF
• Proposed international standard
• Supports many data types, including float32
(float) and float64 (double)
• After header and data block, there is event
table.
• GDF v2.x has more headers => header 3
Final Preparation of the CeBIT Data
Ignatius Sapto Condro Atmawan 31
Alternative Data Format: BKR

• Time based order


• With header
• Header size = 1024 bytes
• Header contains information about
advanced signal processing: wavelet,
neural networks, etc.
• Supports only int16 (short int)

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 32
Conclusion

• Data of one channel from 6 EEG


electrodes cannot be retrieved
• In the Rehacare version, the data
storing bug of the CeBit version has
been fixed
• Alternative data formats (GDF, EDF,
and BKR) can be used for future works,
for flexible data exchange between
institutes
Final Preparation of the CeBIT Data
Ignatius Sapto Condro Atmawan 33
Thank You

Final Preparation of the CeBIT Data


Ignatius Sapto Condro Atmawan 34