Data preparation

Data format types

ANSLAB can read various different data file formats (Note: the list of file formats actually available to a user depends on the ANSLAB license): Depending on the file format, some steps have to be carried out before data can be analyzed:

In general, the data used for an analysis may have been sampled at an arbitrary sampling rate (as long as the rate is sufficient to avoid data loss) because ANSLAB will resample the data to whatever sampling rate is needed.

[Top]

Creating a study folder

To analyze data using ANSLAB, you must always work with a special 'study folder', which must have 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 new study folder use the button new study on the bottom right of the main ANSLAB command window. Enter a 3-character study identifier string, which 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.

To actually select a study folder as the working directory, use the button select on the left column of the ANSLAB menu window next to the text label "working directory". After you selected a study folder, the path of that study folder is displayed in the edit box underneath the select-button.

[Top]

File naming

To be able to analyze data properly within ANSLAB, the raw file names must adhere to some certain file naming rules. Otherwise, ANSLAB will probably run into problems when trying to load and analyze the data.

ACQ, VPD, EDF/BDF, RAW, TXT & VEE files

Files of these file types must be renamed using the 3-character study name (e.g. 'tex'), followed by a 3-digit subject number and a 2-digit run number (for instance 'tex00101.acq'). All the programs use the specific file name parts to deduce subject- and run-number for saving and naming files. Thus using different file names will not work. Once renamed, you may copy the data files to the 'raw'-folder inside the study folder but this is not mandatory.

The naming convention is again summarized in the following table, along with an example for the file name TEX08903.ACQ:
Study identifier Subject # Run # File extension
CCC XXX YY .ext
 
Example
TEX 089 03 .ACQ

VIV files

Vivologic raw data files must follow the vivologic data center naming convention, which is shown in the table below. The first five characters identify the study, always followed by a dash, a 3 digit number for the subject, a letter for the run, always an underscore, and date and time of the start of the recording. You must adhere to this convention since 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.

The naming convention is again summarized in the following table, along with an example for the file name p0027-003b_200506231038.viv:
Study identifier Dash Subject # Run # Underscore Year Month Day Hour Minute File extension
CXXXX - YYY C _ YYYY MM DD hh mm .viv
 
Example
p0027 - 003 b _ 2005 06 23 10 38 .viv

[Top]

Channel naming

ACQ files

In BIOPAC Acqknowledge software, channels can be labeled 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 (i.e. \anslabfolder\anslabutil\channelnaming\channelnames.m). Initially this file is named 'channelnames.txt'. If an analysis involving an ACQ file has already been started previously in ANSLAB, this file is automatically copied over to 'channelnames.m', which is then used for editing channel names and a 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 preserve a 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 instantly if you are using a font with uniform character sizes (e.g. courier, as shown in the example below, if your browser supports 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 equally sized lines and saves them in the file 'channelnames.m' -file. Separate new entries with commata and hit apply or apply & close to save your changes.

Starting with ANSLAB 2.6, you will not loose your settings by changing to a different option tab without saving your changes before changing. ANSLAB will detect changed settings and ask you if you want to save or discard the changes.

VIV files

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

RAW files

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 in order to allow ANSLAB to find them.

VEE files

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\. Initially this file is named 'veechannelnames.txt'. If an analysis involving a VEE file has already been started previously in ANSLAB, this file is automatically copied over to 'veechannelnames.m', which is then used for editing channel names and a proper channel identification.

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 files

VitaPort/VarioPort channel names are defined in the 'vpdchannelnames.m'-file. Initially this file is named 'vpdchannelnames.txt'. If an analysis involving a VPD file has already been started previously in ANSLAB, this file is automatically copied over to 'vpdchannelnames.m', which is then used for editing channel names and a proper channel identification.
Like the Acqknowledge channelnames-file, it contains only signal type information. Calibration data is taken from the file header.

EDF/BDF files

EDF channel names are defined in the 'edfchannelnames.m'-file, BDF channel names in the 'bdfchannelnames.m'-file. Initially these files are named 'vpdchannelnames.txt' 'edfchannelnames.txt' and 'bdfchannelnames.txt'. If an analysis involving a EDF or BDF file has already been started previously in ANSLAB, these file are automatically copied over to 'bdfchannelnames.m' and 'edfchannelnames.m', which are then used for editing channel names and a proper channel identification.
Like the Acqknowledge channelnames-file, these files contain only signal type information, calibration data is taken from the file headers.
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.
[Top]

Importing IBI data from polar files

ANSLAB allows to import raw IBI data recorded e.g., from Polar watch or Actiheart devices.

The source files are assumed to be one-column text files of raw IBI data. One such file is needed for each recording. An excerpt from an example of such a file is shown below:
	855.00
	790.00
	763.00
	765.00
	781.00
	748.00
	...
			
If the source file contains two columns, only the first column is used (expected to contain r-spike times given in seconds).

The sampling accuracy for the imported IBIs is assumed to be 1000 Hz. All values will be rounded to full milliseconds. After the import a *.mat file will be created for each imported file which has the structure of a an edited ECG file. This can then be used for further analysis (e.g., spectral analysis or value export).

The IBI raw data can also be loaded into the ECG analysis module for manual editing of outliers.

To convert polar data files to ANSLAB ECG data files follow these steps:
  1. Create a subfolder in your study folder.
  2. Create and load a batchfile containing the paths of the text files to be imported as described at Create batchfile and Load filematrix.
  3. Select 'Import IBI 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]