Software Open Access

WFDB SWIG Toolbox for MATLAB

Ikaro Silva

Published: Aug. 17, 2009. Version: 1.0.0


Please include the standard citation for PhysioNet: (show more options)
Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation [Online]. 101 (23), pp. e215–e220.

Abstract

The WFDB SWIG Toolbox for MATLAB is a collection of applications for reading, writing, manipulating, and plotting PhysioNet data, implemented as functions in MATLAB. Since it is based on the WFDB Software Package, the WFDB Toolbox for MATLAB supports reading data directly from PhysioNet. This (SWIG) version of the WFDB Toolbox for MATLAB was last updated in 2009 and it will not be updated further. Now we recommend using one of the more current implementations of the WFDB toolbox.

Software description

The WFDB Toolbox for MATLAB makes use of the compiled WFDB library itself. This means that separate shared libraries are distributed for each supported platform (operating system and CPU).

In this version of the toolbox, MATLAB functions invoke Java translations of WFDB applications. These applications invoke JNI (Java Native Interface) wrappers for WFDB library functions. The JNI wrappers are generated automatically from the WFDB library header files using SWIG.

At the moment, the following functions are implemented:

rdannread annotation files for WFDB records
rdsampread signal files of WFDB records
setwfdbset WFDB paths to default values
time2secconvert WFDB-format time intervals into seconds
wfdb_configreturn version and compilation information about the WFDB library
wfdbdescreturn specifications for signals in WFDB records
wfdbwhichfind the location of files belonging to WFDB records
wrannwrite annotations for WFDB records into annotation files
wrsampwrite signal data into WFDB-compatible records

Supported platforms

The following table shows which combinations of CPU architectures and operating systems have been tested for compatibility with this version of the toolkit.

 AMD64, a.k.a. x86-64i386, a.k.a. x86 (IA-32)PowerPC
Windows XP/Vista/7YESYESN/A
GNU/LinuxYESYESN/A
Mac OS X 10.5 and 10.6YESYESYES

Earlier versions of Mac OS X have not been tested but are expected to work. Depending on your MATLAB installation, the WFDB Toolbox installer may ask you to make classpath.txt and librarypath.txt writable; you can do this using the Terminal application (in Applications → Utilities), by typing these commands:

cd /Applications/MATLAB*/toolbox/local 
chmod +w classpath.txt librarypath.txt

Under GNU/Linux, glibc 2.3.0 or higher, and a Linux 2.6.x or later kernel must be used.

MATLAB Versions

Though only a few versions of MATLAB have been tested (including 7.0, 7.1, 7.3, 7.7, and 7.10), the WFDB Toolbox is expected to work for any version of MATLAB with a JVM version 1.4.0 or higher.

Installation

To use this version of the WFDB Toolbox, you must have installed MATLAB 7 (R14, 2004) or later, with a working Java Virtual Machine (JVM) that supports Java 1.4 or later. There are no plans to support earlier versions of MATLAB or Java. If necessary, it may be possible to upgrade the JVM used by an installation of MATLAB; see this MathWorks technical note on the subject.

The WFDB Toolbox has been developed and tested using Sun/Oracle Java (available freely from http://www.java.com). It is compatible with at least some versions of OpenJDK (IcedTea); if you have problems installing it using IcedTea, try using Sun's Java.

The WFDB Toolbox for MATLAB is available for direct installation via a Java Web Start application. This makes it very easy to download and install the package, as long as you have a Java Runtime Environment installed.

The steps that the Java Web Start installer will take are summarized briefly below.

 First, you will see a security window asking for permission to allow the installer to run; this is necessary because the WFDB Toolbox must be installed to the file system.
 Next, a panel with some introductory information will appear.
 The installer will then search for installations of MATLAB. When it is done, you may search the file system for any other installations that it did not find.
 Once the MATLAB installations have been selected, the WFDB Toolbox will be installed, and MATLAB will be updated to use them. The installer needs to update MATLAB's classpath.txt and librarypath.txt files, so you may be prompted for a superuser (root, administrator) password (or asked to make these files accessible.) Also, a brief test of the WFDB Toolbox will be run for each version of MATLAB selected.
 Finally, a summary of the installation will be displayed. If the WFDB Toolbox could not be installed for some version of MATLAB, or if the brief test was not successful, such information will be displayed here.

In some cases, the installer will be unable to update the MATLAB path to include the directories for the WFDB Toolbox. If this is the case, a dialog box will be shown as the installer is exiting, to inform you about this and assist in updating the path manually (MATLAB's pathtool function can normally be used.) This may happen if there does not appear to be a MATLAB userpath variable set.

Before the installer exits, it will ask whether it should launch MATLAB with a short demonstration script that uses rdsamp and rdann to plot a signal and its annotations.

Java Web Start Installer

As the installer runs, it will launch MATLAB several times; on Windows, you may see MATLAB windows pop up briefly, and then disappear. This is normal, and you may safely ignore these windows (do not attempt to close them.)

If one of these runs of MATLAB appears to be taking too long, please note that it is run with a time limit, and will be killed after a couple of minutes, if necessary.

The Java Runtime Environment (JRE) on your computer (not the JVM that MATLAB uses) should be version 1.5.0 or higher to run the WFDB Toolbox installer. If your system has an older version, you can still use the WFDB Toolbox installer, and Java Web Start should automatically download and set up a newer JRE version.

Other installation methods

If the Java Web Start installer does not work properly, one of the methods below may be helpful.

For GNU/Linux and Mac OS X, a install.sh>shell script is provided to install the WFDB Toolbox for MATLAB without using Java Web Start. The script's -h option prints details on how it can be used. The -p option is used to specify the path of a directory or URL holding the JAR files needed for installation (see below for notes on compilation); for example

./install.sh -p http://physionet.org/content/wfdb-swig-matlab

will download (as a set of JAR files) and install the latest version of the WFDB Toolbox. There is also a -g option which allows "global," i.e. system-wide installation, for all users.

Note that install.sh, unlike the Java Web Start installer, can only install for one version of MATLAB at a time.

If all else fails, the necessary JAR files may be downloaded and installed manually. Please see the file README.manual-inst for instructions on how to do this.

Compiling from source code

The latest wfdb-swig-matlab.tar.gz source code may be downloaded and compiled. Please see the README file within the tarball for instructions on compilation.

Please note that the WFDB Toolbox for MATLAB has a number of dependencies that it includes as native shared libraries. These are pre-compiled and distributed both with the Java Web Start installer, and in downloadable JAR files (see above.) The source-code tarball does not include source for these dependencies; they must be downloaded and compiled separately, for the target operating system and architecture.

Dependencies

The following external dependencies are used by the WFDB Toolbox for MATLAB. The version numbers listed are those of the shared libraries distributed with this version of the WFDB Toolbox.

cURL7.19.3https://curl.haxx.se/
GnuTLS2.6.4http://www.gnu.org/software/gnutls
GnuPG1.4.4http://www.gnupg.org
Libgpg-error1.7http://www.gnupg.org/download/#libgpg-error
Libidn1.12http://www.gnu.org/software/libidn/
WFDB10.4.21https://physionet.org/content/wfdb/
WFDB SWIG Wrappers10.4.1https://physionet.org/content/wfdb-swig/1.0.0/

Note that GnuTLS, GnuPG, and Libgpg-error can be omitted if SSL support in cURL is turned off.

Compilation on GNU/Linux and Mac OS X is fairly straightfoward. On Windows, MinGW is required.

Usage notes

These functions provide MATLAB interfaces to some of the most useful stand-alone (command-line) WFDB applications. Many, but not all, of the features of the stand-alone applications are accessible via these Toolbox functions; use MATLAB's help function to discover which features are available and how to use them.

For example, in MATLAB, one can very simply download and plot a signal:

>> r = rdsamp('mitdb/100', 'maxt', ':10');
>> plot(r(:,1), r(:,2));

This package is no longer supported. We now recommend using one of the many implementations of the WFDB software package, which can be found on PhysioNet.

Release notes

This (SWIG) version of the WFDB Toolbox for MATLAB was last updated in 2009, and it will not be updated further. If you have MATLAB 7.11 (R2010b) or later on 64-bit GNU/Linux, Mac OS X, or MS-Windows, please use the currently supported version of the WFDB toolbox.


Share
Access

Access Policy:
Anyone can access the files, as long as they conform to the terms of the specified license.

License (for files):
Open Data Commons Attribution License v1.0

Discovery

DOI (version 1.0.0):
https://doi.org/10.13026/C28378

Topics:
wfdb

Corresponding Author
You must be logged in to view the contact information.

Files

Total uncompressed size: 41.7 MB.

Access the files
Folder Navigation: <base>/pn-server
Name Size Modified
Parent Directory
aami-ec13.txt (download) 444 B 2019-04-12
afdb.txt (download) 28.8 KB 2019-04-12
afpdb.txt (download) 35.3 KB 2019-04-12
aftdb.txt (download) 11.9 KB 2019-04-12
ahadb.txt (download) 252 B 2019-04-12
apnea-ecg.txt (download) 12.5 KB 2019-04-12
cdb.txt (download) 180.9 KB 2019-04-12
challenge.txt (download) 269.1 KB 2019-04-12
chf2db.txt (download) 1.4 KB 2019-04-12
chfdb.txt (download) 2.0 KB 2019-04-12
crisdb.txt (download) 77.7 KB 2019-04-12
cudb.txt (download) 2.6 KB 2019-04-12
db_list.txt (download) 674 B 2019-04-12
drivedb.txt (download) 5.4 KB 2019-04-12
edb.txt (download) 12.7 KB 2019-04-12
excluded.txt (download) 405 B 2019-04-12
fantasia.txt (download) 6.3 KB 2019-04-12
gait-maturation-db.txt (download) 2.8 KB 2019-04-12
gaitdb.txt (download) 665 B 2019-04-12
gaitndd.txt (download) 6.3 KB 2019-04-12
gen_databases.sh (download) 372 B 2019-04-12
iafdb.txt (download) 12.5 KB 2019-04-12
incartdb.txt (download) 39.8 KB 2019-04-12
ltafdb.txt (download) 11.0 KB 2019-04-12
ltdb.txt (download) 994 B 2019-04-12
ltstdb.txt (download) 33.4 KB 2019-04-12
meditation.txt (download) 3.1 KB 2019-04-12
mghdb.txt (download) 101.9 KB 2019-04-12
mimic2cdb.txt (download) 3.9 KB 2019-04-12
mimic2db.txt (download) 11.0 MB 2019-04-12
mimicdb.txt (download) 163.9 KB 2019-04-12
mitdb.txt (download) 5.6 KB 2019-04-12
mvtdb.txt (download) 13.2 KB 2019-04-12
nifecgdb.txt (download) 24.6 KB 2019-04-12
nsr2db.txt (download) 2.7 KB 2019-04-12
nsrdb.txt (download) 2.4 KB 2019-04-12
nstdb.txt (download) 1.8 KB 2019-04-12
physiobank-index (download) 12.5 MB 2019-04-12
ptbdb.txt (download) 446.3 KB 2019-04-12
qtdb.txt (download) 38.7 KB 2019-04-12
sddb.txt (download) 3.2 KB 2019-04-12
shhpsgdb.txt (download) 769 B 2019-04-12
sleep-edf.txt (download) 3.5 KB 2019-04-12
slpdb.txt (download) 6.4 KB 2019-04-12
stdb.txt (download) 38.0 KB 2019-04-12
svdb.txt (download) 9.1 KB 2019-04-12
szdb.txt (download) 565 B 2019-04-12
twadb.txt (download) 40.8 KB 2019-04-12
ucddb.txt (download) 22.2 KB 2019-04-12
vfdb.txt (download) 2.4 KB 2019-04-12
wfdb-matlab-latest.xml (download) 852 B 2019-04-12