| Contents | ecgsim home | ECGSIM Manual

MCG

Introduction

In addition to the ECG, ECGSIM can also be used simulate and display the MagnetoCardioGram (MCG). For this purpose, ECGSIM must be supplied with a transfer matrix for the MCG and a description of the grid of the MCG detectors (gradiometers). You may also supply ECGSIM with a set of measured MCGs and their desired layout (montage) in the ECGs pane. This section of the manual describes the format of these files, and how you can load them into ECGSIM. Examples of these files may be downloaded from www.ecgsim.org/downloadmcg.html.

Loading MCG files into ECGSIM

In order to load the MCG related files in ECGSIM, you must specify the file names in the command line by starting ECGSIM in the following way:

ecgsim -mcg TransferFile GridFile MeasurementFile

where TransferFile is the name of the file containing the MCG transfer matrix, GridFile is the name of the file containing the description of the observation grid, and MeasurementFile is the file containing the measured MCG. You may leave out MeasurementFile; in that case no measured MCGs will be displayed.

In the unix version you may just type the command line as described above. In the Windows version you must include the -mcg command line option in a short-cut by which ECGSIM is started. For that purpose, right-click on the short-cut, and add the -mcg option and its parameters to the command line (after ecgsim.exe). You may want to create a separate short-cut for this purpose. If you don't give the full path of the files, ECGSIM will look for them in the "start in" folder defined in the short-cut.

When you start ECGSIM in this fashion, several items will be added to the dialogs that are evoked from the Thorax menu, allowing you to display maps of the MCG and the MCG transfer function in the Thorax pane, and to control their scale.

In order to display the MCGs as a function of time in the ECGs pane, a further option must be added to the command line:

-mcglayout LayoutFile

where LayoutFile is a layout definition file, in which is defined which leads are to be displayed in the ECGs pane, and at what position. If this command line option is added, some items will be added to the dialogs invoked by the ECGs menu.

File Formats

Transfer matrix

The format of the MCG transfer matrix complies with the standard format of matrix files used in ECGSIM. Element T(l,v) of the transfer matrix is the gradiometer field at observation point l generated by a unit strength source at vertex v of the heart. Hence, the number of rows must be equal to the number of observation points, and the number of columns must be equal to the number of vertices on the heart surface.

Observation grid

For display purposes the observation grid description must contain a definition of triangles interconnecting the observation points. The format of the observation grid description complies to the standard format of triangulated geometries used in ECGSIM. The vertices in this file represent the observation points.

Layout definition

The file format for files defining the layout of signals to be displayed in the ECGs pane is as follows:

n
l(1) x(1) y(1) w(1) h(1) label(1)
l(2) x(2) y(2) w(2) h(2) label(2)
. . . .
. . . .
l(n) x(n) y(n) w(n) h(n) label(n)

Where n is the number of signals to be displayed, l(i) is the lead number of the i-th signal to be displayed, x(i) and y(i) define the position of the left-bottom corner of the plot of that signal within the ECGs pane, and w(i) and h(i) define its width and height. The position and size are specified in floating point numbers between 0 and 1, where 0 represents the left/top edge of the pane, and 1 the right/bottom edge. Label(i) is the label that will be displayed at the top of each signal. You may omit the label; in that case the lead number will be used as a label.

Measured MCGs

The format of the file containing measured MCGs complies with the standard format of matrix files used in ECGSIM. Element M(l,t) of the measurement matrix is the gradiometer field at observation point l at time t. Hence, the number of rows must be equal to the number of observation points, and the number of columns must equal the number of time samples. The sample rate must be 1000 Hz.