2008-05-28

Converting Stellate SIG format EEG data into EDF and ASCII

by Forrest Sheng Bao http://fsbao.net

Stellate is a company developing EEG sampling and analysis system in Montreal, Canada. Their system is good. But unlike many other software developed in Montreal Neurological Institute, McGill U., it runs on Windows! So, I tried to install it on Linux thru wine, another open source project aiming to run Windows application on Linux. Cool, it is very easy. Just 2 minutes work. Here displays a short segment of 7 seconds in resolution 7.5 uV/mm. The format, SIG, Stellate system uses is a proprietary format. Thus, we can't apply any our own algorithms onto the data sampled in their system. They provided one way to export the data into EDF (European Data Format) files. Then I can open them by another open source software, EDF Browser, developed by Teuniz, a guy in Leiden University, Netherlands. This is the snapshot of EDFBrowser. The data are the same as above snapshot. But, I found a funny problem: They have opposite signs. So the data are upside down. There is also a bug in the EDF file exported from Stellate system. Let's look at the EDF records of above plot. It starts like this:
Time,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
23.303000,7.782218,-15.717028,5.035553,-9.765921,3.814813,-2.136295,4.272590,7.171848,9.765921,13.580733,19.837026,-30.060724,10.681476,-1.831110,-4.882960,11.749623,7.477033,-8.392588,13.580733,1.678518,-2.746665,11.597031
23.308000,18.768878,-5.035553,14.801473,1.525925,13.733326,8.545180,13.428141,19.074063,16.022213,26.551096,28.992576,-16.327398,17.395546,10.376291,3.967405,22.278506,18.005916,4.425183,14.343696,11.902216,5.798515,23.957024
23.313000,8.239995,-16.785176,7.477033,-5.188145,8.239995,1.678518,8.545180,12.054808,13.428141,19.074063,18.311101,-25.482949,8.087403,-0.915555,-4.119998,12.207401,8.087403,-8.850365,9.918513,6.561478,0.610370,17.853323
23.318000,12.207401,-13.428141,11.902216,-1.983703,14.496288,3.509628,14.038511,12.817771,19.989619,19.837026,19.531841,-25.025171,14.801473,0.762963,1.220740,13.580733,7.934810,-7.477033,13.428141,11.139253,5.951108,19.684434
23.323000,4.425183,-17.090361,5.493330,-12.054808,8.087403,-5.798515,8.697773,3.357035,15.106658,11.444438,14.801473,-32.502204,3.357035,-6.561478,-5.188145,2.746665,4.119998,-15.106658,9.308143,4.882960,-0.305185,11.444438
23.328000,12.207401,-11.291846,13.122956,-6.103700,14.648881,1.220740,14.343696,9.765921,21.668136,15.717028,21.210359,-25.330356,11.749623,0.457778,1.831110,5.645923,9.460735,-11.902216,19.074063,12.359993,7.324440,17.700731
23.333000,7.782218,-23.346654,4.272590,-12.359993,3.662220,-4.577775,3.357035,3.509628,13.428141,7.171848,15.869621,-31.434057,2.441480,-8.239995,-4.882960,-1.220740,3.204443,-18.311101,10.376291,5.340738,0.305185,11.291846
23.338000,14.954066,-13.733326,10.376291,-2.746665,10.681476,5.188145,9.613328,11.902216,21.820729,15.106658,24.414801,-23.041469,8.545180,-3.967405,1.373333,3.204443,12.665178,-8.392588,14.496288,13.122956,7.782218,17.548138
23.343000,5.798515,-19.837026,1.831110,-9.460735,2.288888,-1.831110,0.305185,2.746665,12.054808,6.866663,14.801473,-31.434057,4.272590,-18.005916,-6.714070,-3.967405,2.594073,-16.022213,6.866663,5.035553,1.220740,10.223698
Since the sampling rate is 200 Hz, the difference between two consecutive timestamps is 5 ms. The first field of each line represents the time after the exam begins. It is followed by voltages of all channels. For example, the voltage of first channel at 23.303s of the exam is 7.782218 uV. Duration of this record is from 23.303s to 30.297s. But I can find such records after that
0.000000,-5.340738,-4.425183,-0.915555,7.171848,-4.882960,2.288888,-0.152593,2.441480,-4.119998,-5.798515,-32.959982,9.308143,-12.970363,-5.035553,3.357035,-10.834068,-21.210359,-6.103700,-15.259251,-1.220740,-0.152593,-1.068148
0.005000,-8.545180,1.678518,-5.493330,-4.577775,-10.986661,-4.577775,-6.256293,-3.662220,-9.765921,-12.359993,-33.265167,3.051850,-14.496288,-3.967405,-3.967405,-17.548138,-18.921471,-11.291846,-19.379248,-7.477033,-6.561478,-7.019255
0.010000,-2.136295,5.493330,0.152593,3.662220,-3.967405,3.204443,0.000000,4.577775,-2.746665,0.152593,-25.025171,2.136295,-8.545180,-4.730368,2.288888,-9.460735,-16.785176,-6.103700,-5.035553,-0.610370,-0.610370,0.305185
0.015000,-6.103700,2.288888,-7.629625,-3.967405,-12.207401,-6.408885,-9.613328,-6.561478,-13.428141,-15.106658,-31.891834,1.831110,-12.207401,-5.188145,-6.866663,-19.837026,-18.921471,-10.071106,-17.853323,-10.834068,-9.002958,-10.223698
0.020000,2.746665,2.441480,0.000000,8.697773,-5.951108,4.272590,-2.288888,3.357035,-8.239995,-0.762963,-26.245911,13.885918,-11.291846,-4.730368,3.967405,-8.697773,-12.207401,2.594073,-15.869621,-2.288888,-0.152593,0.762963
0.025000,-5.493330,6.103700,-4.272590,-0.762963,-10.223698,-3.357035,-5.645923,-1.831110,-8.850365,-6.408885,-32.044427,3.662220,-14.801473,-10.376291,-4.577775,-11.291846,-15.106658,-6.866663,-11.749623,-6.866663,-6.408885,-1.373333
0.030000,-1.068148,12.207401,1.525925,4.425183,-1.373333,4.119998,4.119998,8.545180,4.577775,6.256293,-26.398504,3.662220,-6.866663,-4.119998,0.152593,-9.765921,-13.733326,-4.577775,-6.103700,3.051850,0.610370,12.207401
0.035000,-7.171848,5.188145,-7.171848,-1.220740,-10.986661,-0.152593,-6.866663,5.035553,-8.850365,4.577775,-34.333314,1.373333,-20.905174,-3.204443,-8.392588,-6.866663,-19.074063,-5.798515,-25.330356,-4.425183,-7.171848,7.324440
I have no idea about them. And I can find 0 voltages on all channels from 0.04s to 0.99s. I think they are bugs of Stellate system.

No comments: