segmentation &  timing


general timing notes:

anslab has a very simple way to allow processing of selected intervals of measured data: when a data file is read, anslab looks for an m-file with the same name as the data file, in the folder where the data file is stored. If this m-file exists, it is read and  timing is based on the T-variable defined in the m-file. For instance, if for a data file


    F:\tex\raw\tex00101.acq


an m-file


  F:\tex\raw\tex00101.m


exists and it contains the following text:


    T = [...
    2    0       1800        1800;...
    1    1800    1903.519    103.519;...
    3    NaN     NaN         NaN;...
    8    2130    2475.2      345.2 ];


anslab will recognize 4 valid segment definitions. The first segment belongs to condition '2' and begins at 0 seconds after file begin and ends at 1800 seconds after file begin, thus has a length of 1800 seconds. The second interval (of condition '1') starts at 1800 and ends at 1903.519 seconds after file begin, spanning 103.519 seconds. The third line is a segment that cannot be loaded, as begin and end time and duration are not valid timing values, but will be filled with missing data when use for statistical exports, icg, spectral or crossspectral analysis. The fourth line again is a valid segment of condition 8.


You can create such a timing file manually, or use the 'marker'-analysistype to generate timing files automatically (see marker  ). Moreover, you can do this quickly for a list of files using the batch mode of anslab.



timing fields:
As of version 2.6, anslab supports multiple timing 'fields' in a single file. For instance, the above file could also look like this:


     T = [...
    2    0       1800        1800;...
    1    1800    1903.519    103.519;...
    3    NaN     NaN         NaN;...
    8    2130    2475.2      345.2 ];



     T.spectral = [...
    2    0       600         600;...
    1    600     1200        600;...
    3    1200    1800        600;...
    8    1800    2400        600 ];


thus containing an additional timing field 'spectral'. Having multiple timing fields in a single file saves you the hassle of managing and copying back and forth different versions of timing files that you need for different type of tasks, such as value export, spectral analysis, icg analysis, reflexive startle analysis or trial extraction.




modifying timing files:

Because timing files are so important for so many tasks in anslab, there are two powerful tools to modify and adjust these timing files to your specific needs: timing file modification and timing file recoding. These are rule based replacement tools for changing the condition values and the time values of segments in a timing field. You can also collapse multiple segments to a single segments or split a single segment into several parts. Both of these tools are described at the tools-menu description.





analyzing event-related designs:
To analyze event-related designs with anslab, you should first of all process all your data files as if you were interested in overall mean values, that is to say, edit artifacts and extract event traces over the entire file. If you have only a small amount of relevant data segments and have marked segments of interest with a dedicated marker channel, you can reduce the work by loading this marker channel as 'optional channel' and editing only segments that you jump to by using the 'find peak'-function from the navigation section.


Once you have processed all the files of interest, you must create timing files for every data file as described above (see marker for a detailed description). This can be automatized using the batchmode of anslab, activating the 'marker'-option in the dynamic 'batch'-module of anslab menu window. Later in the process anslab will take every segment listed in the timing files and extract a given number of seconds before and after the start of the segment. The ending time is ignored in this case, to avoid signal length differences due to timing rounding errors in the extracted trials. Thus, you can select a subset of segments to include in the extraction, by changing the timing file. Moreover, the first column of the T-variable can be used to determine the naming of the averaged segments later on.
You can automatically modifiy a set of timing files using the timing file modification tool and the timing file recoding tool described here.


Once you have prepared all this, use the  'extract trials'-item from the event-menu, to extract data segments, corresponding the trials in your experiment.