next up previous contents
Next: Some idiosyncrasies of the Up: A tool to import/export Previous: Installation   Contents

Usage

Once you have installed edfAnn you start the program in the usual way (calling the program from the commnand line or clicking the icon). We are going to use the file wav.edf. This file is also avaliable at the download page. You can use the program to face the following processes:

As a summary think for a moment in the process used to import/export annotations. The magic comes when you modify the text file. Some examples:

  • You have an EDF file and a hypnogram in other file in the form

     
    0<TAB>30<TAB>Sleep stage 0<CR>
    30<TAB>30<TAB>Sleep stage 0<CR>...
    

    You can include it as a signal of an EDF+ file.

  • You can create a frame to include the analysis of the sleep in this way

     
    0<TAB>30<TAB>Sleep stage ?<CR>
    30<TAB>30<TAB>Sleep stage ?<CR>...
    

  • Then you mark with some external program or algorithm the apneas eventually detected and you could have a file in the form

     
    1450<TAB>32.3<TAB>Obstructive apnea...
    

    You append the file containing the sleep stages with the apnea file and you include the new signal that now contains stages and apneas.

  • Then you save the file and some months after you want to create a text file containing only the obstructive apneas. Now you do not have access to the original file (you only have the EDF+ file) but the relations between annotations and signals are deeply built in the structure of the EDF+ file. You could export the annotations and filter the lines containing the word obstructive. EDF+ is a nice way to store all the relevant information of the recording.

  • You can have some algorithm e.g. to detect apneas... and you want to check its correctness with some viewer. You do not need to program the EDF file you only need to create the file with the annotations

  • Once analyzed the file, segments indicating artifacts or segments requiring further analysis could be marked for further processing

And possibly you will be able to imagine some similar ways to process sleep recordings or many other physiological signals... you will share the same procedures for the analysis of en EMG, the averaging of an evoked potential or the marking of a conventional EEG recording.

One last comment on the integration of annotations coming from different origins. Different formats of annotations can be converted by hand or by the appropriate programs. In this way annotations coming from different sources can be combined and included in the EDF+ file.

Let's face an example on how to include Physionet annotations. Of course you have to install Physionet WFDB . We begin by reading the sampling of the file and the annotations

je@unit1:~/prog/tutorials/edfAnn/Code> sampfreq 100s
360
je@unit1:~/prog/tutorials/edfAnn/Code> rdann -r 100s -a atr | head -n 6
    0:00.050       18     +    0    0    0      (N
    0:00.213       77     N    0    0    0
    0:01.027      370     N    0    0    0
    0:01.838      662     N    0    0    0
    0:02.627      946     N    0    0    0
    0:03.419     1231     N    0    0    0

Now we want to convert this annotation to our annotation format.

onset<TAB>duration<TAB>content<CR>
onset<TAB>duration<TAB>content<CR>
onset<TAB>duration<TAB>content<CR>
...

Notice that the original annotations indicate the position of QRS complex and have no duration. We have to read the second column, convert position in samples to position in seconds (in this case sampling rate is 360) and add a duration of 0 to all the annotations. To do it we can use awk (the first line has been folded)

 
je@unit1:~/prog/tutorials/edfAnn/Code> rdann -r 100s -a atr |
           awk '{print $2/360 "\t 0 \t" $3}'
0.05     0      +
0.21388  0      N
1.02778  0      N
1.83889  0      N
2.62778  0      N
3.41944  0      N
4.20833  0      N
5.025    0      N
5.67778  0      A
6.67222  0      N
...

Now we can save the file and include the annotations in the EDF+ file. A similar process could be carried out with other annotations.


next up previous contents
Next: Some idiosyncrasies of the Up: A tool to import/export Previous: Installation   Contents
je 2006-10-13