Let's write a very easy program using LibEEGTools. For now, we just read EEGdata from a file that has been saved using EEGlab software and print the information contained in this file
#include <libeegtools/eeg.h> /* struct information */ #include <libeegtools/reader.h> /* read EEG data */ int main( int argc, char **argv ){ EEG *eeg; /* <- main EEG-data struct */ eeg = read_eeglab_file( argv[1] ); /* read EEG from file, allocating data */ fprintf( stdout, "Hello World!\nThis is the content of file '%s'\n", argv[1] ); eeg_print( stdout, eeg, 3 ); eeg_free( eeg ); /* free memory */ return 0; }
If you installed the library to $PREFIX, you can compile and link the sample program with
gcc test.c -I$PREFIX/include -L$PREFIX/lib -leegtools
Instead of printing the data, you can do all the fancy stuff promised in the description. Just read on to Core Functionality to get more information.