Up: Catalog of documents

MIMIC Database Software Notes

For general information on the DB Software Package, see the Software notes.

Links between MIMIC clinical data and waveform data

The MIMIC Database includes both digitized physiologic signals (waveform data) and information in hypertext form derived from the subjects' medical records (clinical data). The hypertext files contain links to the waveform data, and the annotation files associated with the waveform data contain links to the clinical data.

If you have installed WAVE under Linux, Solaris, or SunOS, you can follow these links in both directions. If you have installed WVIEW under MS-Windows, you can follow the links from the hypertext files to the waveform data, but not those that go from the waveform data to the clinical data.

To be able to follow links from the waveform data to the clinical data, you must configure WAVE to use your web browser as its HTML viewer. To be able to follow links from the clinical data to the waveform data, you must configure your web browser to use as a helper application either wavescript (for use with WAVE) or wvscript (for use with WVIEW). See the section titled WAVE and the Web in the WAVE User's Guide, or see Setting up WVSCRIPT, for detailed setup instructions.

If you open annotator log or all while viewing a MIMIC record, you will find link annotations (shown in the same color as the signals, and underlined). Using WAVE, you may select one of these link annotations and press Enter; this action causes your web browser to go to the appropriate location in the clinical data timeline (log.htm).

While viewing the clinical data timeline, or any of the other hypertext files containing clinical data, you will see that timestamps throughout the file are links. Provided that you have set up your browser properly, you may click on these timestamp links to open the corresponding section of the waveform data using WAVE or WVIEW. Using the sample record on this disk, the signals from record 237 will not be visible in most cases, since only a small excerpt of that record is included here; those from record 237n, however, will be visible throughout the 42-hour recording interval. The clinical data includes some additional information gathered before and after the recording interval, and neither the signals from record 237 nor those from record 237n will be visible at these times.

Note that there are two sets of waveform data associated with each MIMIC subject: a raw waveform record (such as record 237 on this disk), containing ECGs, continuous blood pressure waveforms, etc.; and a derived waveform record (such as record 237n on this disk), containing heart rate, mean, systolic, and diastolic BP measurements, respiration rate, etc. The links in the clinical data files link to both sets of waveform data. WAVE can display both sets at the same time (in separate windows), but WVIEW cannot do so (it will display only the raw waveform data; you may switch to the derived waveform data using WVIEW's File menu.)

Software for use with the MIMIC Database

The DB Software Package, WAVE, and WVIEW can be used with the MIMIC Database. The software/mimicmsc directory contains a few additional programs and related files that may be useful for use with the MIMIC database. Since most of these programs are specific to the MIMIC database, they have not been incorporated into the DB Software Package itself.

The software/mimicmsc directory contains the following files:

annsort.c [1]
select and sort beat-to-beat intervals in an annotation file
lab2ann.c [1]
create an annotation file from a labdata file
menu.h
menu configuration for rdacexp
rdacexp.c
display data in files exported from the MIMIC Access database
rdtxt.c
extract data from *.txt files in the mimicdb directory
txt2dat.c
create a DB record (signal and header files) from *.txt files
wavemenu [2]
WAVE analysis menu configuration file, with entries customized for use with the MIMIC DB
Makefile [2]
UNIX make description file for compiling these programs
Makefile-dos-gcc [2]
make file for cross-compiling MS-DOS binaries under Linux

Notes:

[1]
These programs were written for use under UNIX; to use them under MS-DOS or any other operating system, you will need to have installed a UNIX-style sort utility (such as GNU sort, available in source form from prep.ai.mit.edu).
[2]
These files are intended to be used under UNIX only.


Reading MIMIC Database records using your own software

MIMIC Database records, such as the sample record provided in the odb directory, differ in several important ways from records included in our previous CD-ROM databases of ECGs and other physiologic signals:

To accommodate these features, the DB library has been updated. In most cases, applications built using older versions of the DB library require no source modifications (only recompilation or relinking) in order to read the records on this disk.

To support multiple sampling frequencies, we introduced the concept of a sample `frame' in DB library version 9.0. A frame contains at least one sample of each signal; a new DB library function, getframe, reads an entire frame. To permit existing applications to read these records without modification, getvec now invokes getframe, and then (in its default mode) averages all samples in the frame (separately for each signal). Hence applications continue to receive one sample per signal on each call to getvec. To read in `low resolution' mode, with all signals converted on-the-fly to 125 samples per second, you need make no changes to your programs. To read in `high resolution' mode, with all signals converted on-the-fly to 500 samples per second, include the line

	setgvmode(DB_HIGHRES); 
in your program at any point before invoking getvec. To read in multi- frequency mode, with neither interpolation nor decimation, use getframe rather than getvec.

To support composite records, we defined a new type of header file, which contains a list of the (ordinary) records that comprise the multi-segment record. To an application built using DB library version 9.1 or later, a multi-segment record of this type is indistinguishable from an ordinary record; reading and seeking (in either direction) works as always, with the DB library opening and closing signal files as needed to move among segments.

To support skew correction, we added an optional field to the header file. DB library version 9.2 and later versions perform skew correction on-the-fly within getframe, invisibly to the application, which receives frames from getframe or sample vectors from getvec containing simultaneous samples (provided that the skews have been correctly recorded in the header file).

This disk contains sources for the DB Software Package, version 9.7.0, and several precompiled (binary) versions of this package as well (for MS-DOS, Sparc SunOS 4.1.x, Sparc Solaris 2.x, and Linux for 386/486/Pentium PCs). In addition to the DB Software Package, the disk contains binaries (only) of WAVE, version 6.1 for Sparc SunOS 4.1.x, Sparc Solaris 2.x, and Linux, and WVIEW, version 1.03 for MS Windows 3.1//95/NT. Version 9.3 of the DB library was the first release that can be compiled without modification into a Microsoft Windows DLL. The DLL previously distributed with wview version 1.01 was based on DB library version 9.0, but the sources for that DLL were not distributed, since they differed significantly from the standard version 9.0 sources. The differences have been merged into a unified set of sources beginning with version 9.3, which includes several portability enhancements that simplify compilation with a variety of UNIX compilers as well.

If your applications were previously built using DB library version 9.0 or later, they need only to be relinked in order to take advantage of the new features of version 9.7. (Dynamically linked applications under Linux, SunOS, Solaris, UNIX SVR4, or Microsoft Windows need not even be explicitly relinked; it is sufficient in these cases to install the new version of the dynamically linked library in place of the old one.) If your applications were built using older versions of the DB library, they should be recompiled, since data structures have changed in <ecg/db.h>.

If you are using proprietary applications that cannot be recompiled or relinked, or if your applications were not built using the DB library, use xform (included on this disk) to reformat these recordings into a compatible binary format, or use rdsamp (also included on this disk) to convert any desired portions of them into text format. xform converts all signals to the same sampling frequency (you may choose any desired sampling frequency within reason -- you are not restricted to 125 or 500 Hz), concatenates the segments of multi-segment records, and performs skew correction. xform also allows you to demultiplex signal files, change storage formats, adjust signal gains and offsets, select a subset of signals, rearrange signals, and choose an interval to be copied. See xform(1) for details.

Please note that the DB library may be used freely (with acknowledgment) in your applications; you are encouraged to do so, to minimize the likelihood that substantial revisions will be needed if file formats change further in the future. If, despite these considerations, you still wish to write your own interface functions, refer to header(5), signal(5), annot(5), and dbcal(5), and to the DB library sources, for descriptions of the file formats. The applications rdsamp and rdann (included on this disk) may be helpful for verifying that your interface functions are working properly.


George B. Moody (george@mit.edu)
25 May 1997 (Links revised 11 November 1999 for PhysioNet)