| Contents | ecgsim home | ECGSIM Manual

File

The File menu has the following entries:

Open

The Open menu item starts up a sub-menu containing two entries: Source parameters and Reference surface potentials.

Open: Source parameters

The parameters ECGSIM works with are: depolarization times, dep, repolarization times, rep, and the magnitudes of the local transmembrane potential, str, at all nodes of the heart. Open -> Source parameters allows the user to replace the default parameter by those read from a file. You may either open a file saved during a previous ECGSIM session, or create your own. See source description files for the required file format.

If the source parameters loaded from a file contain depolarization times beyond 500 ms, the maximum repolarization time is automatically set to 1000 ms.

Open: Reference surface potentials

Open -> Reference surface potentials allows the user to replace the default set of reference potentials. These will be used both for the reference body surface potentials in the thorax pane and the reference 12-lead ECG in the ECGs pane. You may either open a file previously saved by ECGSIM, or create your own.

The number of rows in the file must match the number of nodes on the thorax. See surface potential files for the file format.

Reference surface potentials may also be loaded when ECGSIM starts by using the -ref command line option.

Save

The Save menu item starts up a sub-menu containing three entries: Source parameters, Simulated surface potentials, and Simulated 12-lead ECG.

Save: Source parameters

You may save the set of depolarization times, dep, repolarization times, rep, and transmembrane potential magnitudes (str) at all nodes of the heart to a file by using Save -> Source parameters. You may open this file in a later ECGSIM session. See source description files for the file format.

Save: Simulated surface potentials

Save -> Simulated surface potentials allows the user to save the simulated surface potentials at all nodes of the thorax to a file. These may later be opened to serve as reference potentials, or used for further analysis outside ECGSIM. See surface potential files for the file format.

Save: Simulated 12-lead ECG

Save -> Simulated 12-lead ECG allows the user to save the simulated 12-lead ECG to a file. These may then be saved for further analysis outside ECGSIM. See 12-lead ECG files for the file format.

Default

Once you have opened a source description file, the default set of source parameters is lost. You may restore the default source parameters by choosing Default.

Print

The Print menu item starts up a sub-menu, from which you may choose which pane you want to print.

ECGSIM sends a bitmap copy of the pane to the printer, hence the resolution of the print-out is that of the screen and not that of the printer (which commonly has a much higher resolution). You may improve the quality of the print-out by enlarging the pane you want to print, which is done by dragging the bars between the pane by the left mouse button.

We plan to make use of the full printer resolution in a later release of ECGSIM.

File formats

Source description files

The default extension of the files in which ECGSIM stores the source parameters is .src. The format of the file is:

N 3
d(1) r(1) s(1)
d(2) r(2) s(2)
. . .
. . .
d(N) r(N) s(N)

where N is the number of rows that follow (=the number of nodes at the heart; N=257 for the default heart geometry), 3 is the number of columns, d(n) is the depolarization time at node n in ms, r(n) is the repolarization time at node n in ms, and s(n) is the depolarization magnitude at node n. The scaling of the latter ranges from a value of 0 for inactive nodes to 1 for the full (relative) magnitude of the upstroke of the transmembrane potential.

The index n of a selected heart node may be displayed on the status bar of the heart pane by displaying the geometry in that pane and selecting the node.

The geometry description of the heart may be downloaded from www.ecgsim.org.

Surface potential files

The default extension of the files in which ECGSIM stores surface potentials is .bsm.

The format of the file is the standard format used for matrix files in ECGSIM:

L     T
p(1,1) p(1,2) ... p(1,T)
p(2,1) p(2,2) ... p(2,T)
. . . .
. . . .
p(L,1) p(L,2) ... p(L,T)

where L is the number of rows that follow (=the number of nodes on the thorax; L=300 for the default torso geometry), T is the number of columns (=number of time samples) and p(l,t) is the potential in mV at node l at sampling time t.

The sample frequency is 1000 Hz.

The index of the selected thorax node may be displayed on the status bar of the thorax pane by displaying the geometry in that pane and selecting the node.

The geometry description of the thorax may downloaded from www.ecgsim.org.

12-lead ECG files

The default extension of the files in which ECGSIM stores 12-lead ECGs is .ecg. The format of the file is:

L     T
p(1,1) p(1,2) ... p(1,T)
p(2,1) p(2,2) ... p(2,T)
. . . .
. . . .
p(L,1) p(L,2) ... p(L,T)

where L is the number of rows that follow (=the number of leads, normally 12), T is the number of columns (=number of time samples) and p(l,t) is the potential in mV at lead l at time sample t.

Rows 1-6 correspond to leads V1-V6, rows 7-9 to leads aVR, aVL and aVF, respectively and rows 10-12 to leads I, II and III, respectively.

The implied sample frequency is 1000 Hz.

Triangulated geometry files

The format of the files that describe triangulated geometries is as follows:

npnt
1 x(1) y(1) z(1)
2 x(2) y(2) z(2)
. . . .
. . . .
npnt x(npnt) y(npnt) z(npnt)
ntri
1 ind(1,1) ind(1,2) ind(1,3)
2 ind(2,1) ind(2,2) ind(2,3)
. . . .
. . . .
ntri ind(ntri,1) ind(ntri,2) ind(ntri,3)

where npnt is the number of vertices, x(i), y(i) and z(i) are the coordinates (in meters) of vertex i, ntri is the number of triangles, and ind(j,1), ind(j,2) and ind(j,3) are the indices of the vertices of triangle j. The order of the indices for a triangle defines the orientation of the triangle; when viewed from the outside the vertices are numbered clockwise.