data preparation

  

Contents:

Data format types
Creating a study folder
File naming
Channel naming
Importing polar heart rate data

Preparing your data for analysis with ANSLAB involves the following steps:


Data format types: ANSLAB can read BIOPAC Acqknowledge files (*.ACQ), Vivologic data files (*.VIV), HP VEE data files (*.D*T), European/Biosemi Data Format files (*.EDF/*.BDF), Vitaport data files (*.dat, *.vpd), heart rate data qcquired with POLAR watches, ECG data acquired with MONICA fetal ecg device (*.RAW), Matlab data files (*.MAT) and tab-separated text (TXT) files. To analyze Vivologic or MONICA data files, no special preparation other than renaming and creating a study folder (see below) is required. To analyze BIOPAC, VEE, EDF/BEDF and VPD data files, you have to inform anslab about the way your data channels are labelled (see channel naming below).  The data formats ANS and MAT are used for saving analysis results in anslab - they are not meant to be used as raw data format to start analyzing from. POLAR heart rate data must be analyzed in a study folder as described for the other data types, and renamed to match the ANSLAB naming convention. Moreover, data files must be converted to matlab data format and loaded for editing as described at importing polar heart rate data. Text files (TXT) have to be arranged with sample points as rows and channels as columns. Channels can be listed at different sampling rates, but unequal signal length have to be padded with empty cells.  Tab-delimited format is recommended. Column-channel-associations and sampling rates have to be specified using the anslab options dialog on the 'TXT anylsis options'-tab (shown below). The data section of the text-file (all lines except the first if a header row is specified) may not contain any text fields (except for the number-equivalents 'nan' and 'inf' and exponential number format like e.g. 5e13).  [Top]



Data can be listed at an arbitrary sampling rate (sufficient to avoid data loss) because all anslab functions will resample the data to whatever rate they need.


Creating a study folder: To analyse data using anslab, you must alway work in a special 'study folder', that has a predefined structure. You have to select this folder before running any kind of analysis, as all study specific options are stored inside this folder. To create a study folder, you have several options:

1. You can create an empty study folder automatically by using the 'study'-button on the bottom right of the main ANSLAB command window. Enter a 3 character study identifier string, that will be the name of your study folder, and select the location, where the folder should be created. It is not recommended to use numbers in this identifier (e.g., ab1) since reduced data file names will have many numbers specifying subject and data file following this identifier, and reading these correctly can then be confusing.

2. Alternitavely, you can copy the  'EmptyStudyFolder' from the ANSLABUtil-folder to a location of your choice and rename it to a 3 character study identifier (for instance 'tex' for 'test experiment' as in the ANSLABTestData-folder). This will be your working folder and it's name will identify the study.  It is not recommended to use numbers in this identifier (e.g., ab1) since reduced data file names will have many numbers specifying subject and data file following this identifier, and reading these correctly can then be confusing.

To actually select a study folder as working directory, use the 'select'-button, on the left column of the anslab menu window next to the text label "working directory". After you select the 'anslabdef.m'-file inside your study folder, it's path is displayed in the edit box underneath the select-button. [Top]



File naming: 
ACQ, VPD, EDF/BDF, RAW, TXT  & VEE:  ACQ, VPD, EDF/BDF, RAW  and VEE raw data files must be renamed using the 3-character study name (e.g. 'tex')  followed by a 3 digit subject number and a 2 digit session number (for instance 'tex00101.acq'). All the programs use the specific file name properties to deduce subject- and run-number for saving and naming files, thus using different file names will not work!!!. You can copy the data files to the 'raw'-folder inside the study folder, but this is not mandatory.                  

CCC XXX    YY    .ext
study identifier (for instance 'tex')
subject# (for instance 089)
  run# (for instance 03)
file extension (for instance .ACQ)

An example is:   TAF02401.acq


VIV :  Vivologic raw data files must follow the vivologic data center naming convention, which is depicted below.  The first five characters identify the study, then always follows a dash, then a 3 digit number for the subject, a letter for the run, always an underscore, and last date and time of the start of the recording.  You must conform to this convention, because all the programs use information from the filename for saving and naming files containing the reduced data. Moreover, some analysis types require to retrieve the file start time from the filename.     
            

CXXXX  -
YYY   C _ YYYY    MM DD hh mm .viv
study identifier
 (e.g 'p0027')
dash
subject#
(for instance 089)
run# as character
 (a,b, c...)
underscore
 year month
day
hour
minute
file extension

An example is:    p0027-003b_200506231038.viv [Top]



Channel naming:
ACQ:   In BIOPAC Acqknowledge software, channels can be labelled by the user. To allow anslab to recognize channels relevant for each analysis type, you must add the labels you use in your laboratory to the set of possible labels recognized by anslab. Anslab stores these labels in a text file called 'channelnames.m', that is located in the 'anslabutil'-folder, in the 'channelnaming'-subfolder ( \anslabfolder\ anslabutil\ channelnaming\ channelnames.m ). Initially this file is named 'channelnames.txt' to avoid CVS-repository conflicts. Rename this file to 'channelnames.m' to allow proper channel identification.
You can modify the list in channelnames.m manually using a text editor (e.g. using the matlab editor by typing 'edit channelnames' on the command prompt), or you can edit this file indirectly using the 'channel naming'-tab from the options dialog in the 'tools'-menu (*tools*options*channel naming).  If you edit this file directly, be sure to preserver correct matlab syntax. As the label lists are stored as multiline character arrays, you must padd the right side with empty spaces, so that all entry lines have exactly the same length! You can see this directly if you are using a font with uniform character sizes (e.g. courier, as shown in the example below, if your browser support this font):


EcgLabels = [...
'ECG Lead II';...
'EKG        ';...
'EC         ';...
'ECG Lead I ';...
'mylabel    '];


The channel naming tab of the options dialog allows you to edit the names without bothering about the length of the labels. Anslab automatically converts the entries to equal sized lines and saves them in the 'channelnames.m' -file. Separate new entries with commata, and hit 'apply' or 'apply & close' to save your changes. Note that you will loose your settings by changing to a different option tab (e.g. the ecg options) without applying first.






The channel naming tab of the options dialog allows you to edit the names without bothering about the length of the labels. Anslab automatically converts the entries to equal sized lines and saves them in the 'channelnames.m' -file.


VIV:   Vivologic channel names cannot be changed, settings therefore do not have to modified by you.

RAW:   Monica data is read from previously exported files, which must be named as they are named automatically by the MONICA software (xxxx.ch1, xxxx.ch2, xxxx.ch3 and xxxx.ch4). Moreover, fetal beat-by-beat data must be stored in an associated text file called "xxxx.ibi". All these files belonging to a *.RAW data file must live in the same directory as the RAW-file for anslab to find them.


VEE:  HP VEE channel names, signal types, sample rates and calibration information (mult, div and offset)  are defined in the 'veechannelnames.m'-file in the folder \anslabutil\channelnaming\. This file initially is named 'veechannelnames.txt' to avoid CVS repository conflicts. Rename this file to 'veechannelnames.m' to allow proper channel identificaiton. Adjust the content of this file corresponding to your data files. Note that anslab identifies the channels to load exclusively by the Ch#, that is 'hardcoded' in  the fileheader of each datafile, and retrieves scaling information based on this number from the 'veechannelnames.m'-file.


VPD:  Vitaport channel names are defined in the 'vpdchannelnames.m'-file. This file initially is named 'vpdchannelnames.txt' to avoid CVS repository conflicts. Rename this file to 'veechannelnames.m' to allow proper channel identificaiton.Like the Acqknowledge channelnames-file, it contains only signal type information, calibration data is taken from the file header. 

EDF/BDF:  EDF channel names are defined in the 'edfchannelnames.m'-file, BDF channel names in the 'bdfchannelnames.m'-file. These files initially are named 'edfchannelnames.txt' and 'bdfchannelnames.txt' to avoid CVS repository conflicts. Rename this file to 'edfchannelnames.m'/'bdfchannelnames.m' to allow proper channel identification. Like the Acqknowledge channelnames-file, it contains only signal type information, calibration data is taken from the file header.  [Top]


Rereferencing data in a BDF data file
As non-EEG data (e.g. ECG) in a Biosemi data file is usually saved referenced to the common mode sense (CMS) electrode but needs to be rereferenced to a specific second sensor before analysis, the channelname file for BDF data is checked for reference information. You can specificy a channel to be rereferenced to  some other channel by putting both channelnames in a row in the channelnames file separated by three dashes ("---"). So the ECG section of your "bdfchannelnames.m" file might read:

EcgLabels = [...
'Ekg1---Ekg2';...
'EKG        ';...
'EC         ';...
'ECG Lead I ';...
'ECG        '];

indicating that the channel "Ekg1" is to be rereferenced to "Ekg2" before analysis.





Importing polar heart rate data:

To convert polar heart rate text files, first create a subfolder in your study folder. Second,  create and load a batchfile containing the paths of the text files to import as described at create batchfile and load filematrix . Select 'Import polar data' from the 'tools'-menu. You are prompted to select a folder, where the converted data files will be stored. Choose the just created 'import' folder and wait while anslab converts the files. [Top]