Home/News

About Us

Products
  Locator
  Data Editor
  Source Estimator
  MR Viewer
  Image Processor
  Visualizer

Data Analysis Service

Downloads

FAQs

Formats

Jobs

Contact Us

Papers

Links

EMSE User Group

Search


 

File Formats - Time Series Data (versions 5.0 and above)

This document describes the data file format used in version 5.0 of the EMSE software.  The data are represented with two files, the header file and the data file.  The header file is used to describe the nature of the data file.  It is a text file in Extensible Markup Language (XML) format*.  It consists of many “keyword-value” sections.  The data file is simply a matrix with rows and columns of numbers (real or complex).  It can be ASCII or binary as specified by a descriptor in the header file.  The data file has the name <filename>.bin while the header file has the name <filename>.bin.emse_hdr (or in the case of an ASCII data file, <filename>.txt and <filename>.txt.emse_hdr).  The <filename> portion of the name is the same in both the data and header files.  The following sections will describe each file in detail and will give examples of EMSE data files.  There is also an additional file, the event file, used in EMSE to mark the time points of events in the data.  The event file is also a text file in XML format.  It has the file name <filename>.evt.  An example is shown below.

 

The Header File Format

EMSE uses XML in the header file primarily because so that it can be viewed in any text editor or XML parser, and it is easily extendable.  The details of constructing an XML file are not described here. We simply define the fields used in EMSE.  All fields must be bounded inside the <EMSE_Header> and </EMSE_Header> tags.  The names of the fields are predefined.

Name of the field (Heading)

Meaning

Valid values

RunType

The way that the data was saved in a file after an experiment (a run).

Continuous, MultiEpoch, and SingleEpoch.

(No default and must be set)

DataFormat

The format of a datum

ASCII, Byte, Short, Swab_Short, Long, Swab_Long, Float, Swab_Float, Double, Swab_Double.

 

Swab is used for Big Endian Order, such as data stored by Unix and Macintosh systems.

(No default and must be set)

MatrixOrientation

The orientation of the data file. There are two ways a matrix can be stored. One is the slice mode or multiplexed mode in which the first data point from channels 1..N (a slice) are stored, followed by the second data point from channels 1..N, and so on. The other is the trace mode in which all data points from channel 1 (a trace) are saved, followed by all data points from channel 2, and so on.

 

Slice_Mode,

Trace_Mode.

 

(Slice_Mode is the default and is recommened.)

 

DataDomain

The domain in which the data are measured.

TimeDomain, FrequencyDomain,

SpaceDomain.

(No default and must be set)

SampleRate

Time domain: the sampling rate in Hz.

Frequency domain: the interval between 2 adjacent bins, also in Hz.

Any number greater than 0.

(No default and must be set)

NumChans

The number of channels in the data file.

Any number greater than 0.

(No default and must be set.)

NumSlices

The number of slices in continuous recording and in a single epoch data file, and the number of slices in one epoch in a multiepoch data file (assuming all epochs have the same number of slices).

Any number greater than 0.

(No default and must be set)

ChannelList

Main section heading for the channel list

There are default values for name, type and scale. The default names are 1 to N where N is the number of channels. The default type is 1024, meaning a electric channel. The default scale is 1.

Name

The name of a channel.

Any ASCII string

Type

The type of a channel which is the combination (adding) of one or many attributes. All attributes are listed on the right.

 

2048 – Off

512 – Magnetic

1024 – Electric

4096 – Reference

16384 – Optical

32768 – Trigger

65536 – Other

262144 – Planar (if a magnetic sensor is not specified as planar, then gradiometer or magnetometer is assumed).

524288 – Pass through (meaning display it but do not process it).

Scale

The scale factor of a channel. The data used in EMSE is the data stored in the file multiplied by this number.

Any real number

(default is 1.0)

NumEpochs

Only used in describing multiepoch data. The number of epochs in the data file. The total number of slices in the data file equals NumEpochs * NumSlices.

Any positive number

(default = 1)

PreStim

Pre-stimulus interval

Should be a negative number

(default = 0)

DataType

This field is used only for single epoch data. It describes the kind of epoch data.

EvokedPotential,

FourierTransform,

PowerSpectrum,

Coherence.

(No default and must be set)

PValues

This field is used only for single epoch probability data. It describes the kind of P value stored in the file.

NA, (default, not P value)

PVALUES_P,

PVALUES__LOGP,

PVALUES_LOGQ,

PVALUES_LOGQ_LOGP

NumTrials

The field is used only for averaged single epoch data.

It specifies the number of valid epochs involved in the averaging process.

Any positive number

(default = 1)

EventFileName

The file name of the event data.

Full path of the event file

DataFileName

The file name of the data. Used only for book-keeping purpose.

Full path of the data file

 

The Data File Format

 

1.    Binary data

The size of a binary data file depends on the DataFormat of a datum. Short or Swab_Short has 2 bytes. Long or Swab_Long has 4 bytes. Float or Swab_Float has 4 bytes. Double or Swab_Double has 8 bytes. Therefore the size of a file in bytes = the number of channels * the number of total slices * sizeof(a datum), regardless of the matrix orientation. In slice mode, you may use the following lines to access the nth slice of data. In this case we assume that the data is of short type.

short* pBuffer = new short[ the number of channels ];

long lByteOffset = (the number of channels) * (n-1) * sizeof(short);

fseek(fp, lByteOffset, SEEK_SET);

fread(pBuffer, sizeof (short), (the number of channels), fp);

 

2.    ASCII data

The size of an ASCII data file varies. Like binary data files, they are in rows and columns. They also can be viewed in many spreadsheet programs such as Microsoft Excel. In slice mode each row represents a slice and each column represents a channel, while in trace mode each row represents a channel and each column represents a slice.

 

3.    The unit of the data

The unit for electric data is Volt,  and for magnetic data is Tesla (in the time domain).  For EMSE generated files, it is Volt or Tesla for EvokedPotential and FourierTransform; Volt^2 or Tesla^2 for PowerSpectrum; unitless for Coherence; unitless for EvokedPotential and PVALUES_P or PVALUES__LOGP or PVALUES_LOGQ or PVALUES_LOGQ_LOGP.

 

Examples of EMSE Data Files 

The following example illustrates a time series data file which has two EEG channels and four slices, and is stored in an ASCII text file, example1.txt with example1.txt.emse_hdr.

 

example1.txt.emse_hdr

 

<EMSE_Header>

<DataFileName>C:\Tmp\ example1.txt </DataFileName>

<DataDomain>TimeDomain</DataDomain>

<DataFormat>ASCII</DataFormat>

<NumChans>2</NumChans>

<SampleRate>500</SampleRate>

<RunType>SingleEpoch</RunType>

<NumSlices>200</NumSlices>

<PreStim>-0.1</PreStim>

<NumTrials>1</NumTrials>

<DataType>EvokedPotential</DataType>

<PValues>NA</PValues>

<ChannelList>

<Channel><Name>FP1</Name><Type>1024</Type><Scale>1</Scale></Channel>

<Channel><Name>FP2</Name><Type>1024</Type><Scale>1</Scale></Channel>

</ChannelList>

</EMSE_Header>

 

example1.txt

 

1.008e-007  -1.74e-008 

-3.742e-008-1.063e-007

-6.137e-008-9.006e-009

7.744e-008  2.041e-007

 

 



 
  © 2007 by Source Signal Imaging Inc.