I have a one hour GDF file, and I want to find a particular section of interest that is about 10 minutes long, and save that as a GDF file. What workflow would you recommend as a general solution to that task?
SigViewer helps for the reviewing aspect of identifying the start and end time of the interval, but what comes next?
Thanks and regards,
On 2013-05-28 15:55, Owen K wrote:
> Hello all,
> I have a one hour GDF file, and I want to find a particular section
> of interest that is about 10 minutes long, and save that as a GDF
> file. What workflow would you recommend as a general solution to that
> SigViewer helps for the reviewing aspect of identifying the start and
> end time of the interval, but what comes next?
> Thanks and regards,
The workflow is typically this:
1) Score the data with Sigviewer. When your are done with reviewing the
data with sigviewer, you will typically make some user-specific
annotations/markers (you can use type 1 to 255), lets say you are using
code 11 and 12. Then you store the newly generated annotations either in
(1) exporting the annotations and markers in an event file (filename.evt)
(2) save all data into an gdf file (filename.gdf).
For the next step, there are several possibilities. However, the most
elaborate ones, are probably implemented in Octave and Matlab. (Python
and command line tools like `save2gdf -V4 filename` might be alternatives).
2) Load the header and the data into
You'll load the data and the newly generated annotations into octave (or
Matlab) using sopen/sread/sclose, or sload or mexSLOAD.
[tmp,EVTHDR]=sload('filename.evt'); % loads the event file
[dat,HDR]=sload('filename.dat'); % loads the data.
If all events and data has been stored in a GDF file, you can load both with
[dat,HDR]=sload('filename.gdf'); % load gdf data
and HDR.EVENT will contain the new annotations.
The header of the event file will contain the newly generated event
table EVTHDR.EVENT.TYP, EVTHDR.EVENT.POS. If your markers have typ=11,
you can find the sample position like this
If you have two markers for the beginning and the end, you can extract
the corresponding data segment in the following way:
segment1 = dat(pos(1):pos(2),:);
3) In case you want to extract segments around repeating trigger times,
you can also use trigg.m
see the documentation of trigg() for more details.
4) Data processing,
once you have extracted your data sections, you can clear the original
traces, in order not to waste memory. And you can process the data
according to your needs. For example, you could also store these data
into a new file (see demo/dmeo3.m).