Back to the main page.
Bug 1924 - implement the deymed EEG file format
Status | CLOSED FIXED |
Reported | 2013-01-14 13:28:00 +0100 |
Modified | 2013-04-23 12:06:29 +0200 |
Product: | FieldTrip |
Component: | fileio |
Version: | unspecified |
Hardware: | All |
Operating System: | Mac OS |
Importance: | P3 enhancement |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Robert Oostenveld - 2013-01-14 13:28:34 +0100
It consists of a *.ini and a *.dat file. Documentation is not available, but we can visualize it with the original (windows) software. Furthermore, we can read it into BESA and from there export it to EDF+ and/or to ascii format.
Robert Oostenveld - 2013-01-14 14:44:11 +0100
The dat file seems to have a 512 bytes header, which also specifies the number of channels, the channel names and the sampling frequency. I have not yet found the calibration values, so at the moment it returns integer values (int16). I have made a first implementation. roboos@mentat001> svn commit . ../private/ Sending fileio/ft_filetype.m Sending fileio/ft_read_data.m Sending fileio/ft_read_header.m Sending fileio/private/dataset2files.m Adding fileio/private/inifile.m Adding fileio/private/read_deymed_dat.m Adding fileio/private/read_deymed_ini.m Deleting private/inifile.m Transmitting file data ...... Committed revision 7306. @Madelon, can you check and compare this new implementation with the EDF and the ascii files?
Robert Oostenveld - 2013-01-16 09:07:02 +0100
I used the following to compare the dat to the edf: ------------------------------------------------ datfile = 'R3.09.Dat'; edffile = 'R3.09-export.edf'; hdr1 = ft_read_header(datfile); hdr2 = ft_read_header(edffile); dat1 = ft_read_data(datfile); dat2 = ft_read_data(edffile); sel1 = (1:25600) + 512; sel2 = 1:25600; x = dat1(1,sel1); y = dat2(1,sel2); figure plot(x, 'b') hold on plot(y, 'r') z = xcorr(x, y, 'coeff'); figure plot(z) [m, i] = max(z); ------------------------------------------------ The 512 samples that I add to sel1 are experimentally determined, it shifts the two signals precisely over each other. Since it is not a multiple of 22 and since all channels are shifted with 512 samples, it suggests that there are additional channel headers following the general 512 byte header. The total header seems 512+22528 bytes long. Each channel-header seems 1024 bytes long.
Robert Oostenveld - 2013-01-16 09:12:55 +0100
(In reply to comment #2) I have adjusted the code for the 1024byte channel headers, the samples are now aligned. roboos@mentat001> svn commit Sending fileio/private/read_deymed_dat.m Sending fileio/private/read_deymed_ini.m Transmitting file data .. Committed revision 7326.
Robert Oostenveld - 2013-01-16 09:48:10 +0100
Fixed the calibration, which seems to be 1/4. roboos@mentat001> svn commit Sending fileio/private/read_deymed_dat.m Sending fileio/private/read_deymed_ini.m Transmitting file data .. Committed revision 7328.
Robert Oostenveld - 2013-01-16 17:55:08 +0100
I created a test script, which from now on will run automatically and detect any regression errors. roboos@mentat001> svn commit test_bug1924.m Sending test_bug1924.m Transmitting file data . Committed revision 7338. It might be desireable to also support the event file, but at this moment it does not have any priority. Therefore I now close this issue.
Robert Oostenveld - 2013-04-23 12:05:53 +0200
closed various bugs