|Next: WFDB-CONFIG(1) Up: WFDB Applications Guide Previous: WAV2MIT(1)||On This Page|
wave can be used to view the specified WFDB record or records on any display controlled by an X11 server. It includes facilities for interactive annotation editing. The keyboard and mouse are used to control the display interactively. First-time users should read the WAVE User’s Guide, available at http://physionet.org/physiotools/wug/ (or, while wave is running, choose User’s Guide from the Help panel).
If you specify more than one record, a separate wave process is started for each record. Note that all records to be opened must be listed in a single command-line argument following -r, with + characters (not spaces) between the record names. See ‘Running two or more WAVE processes’ below.
Use the left mouse button to make selections, and the right mouse button to open menus (indicated by triangular glyphs at the right end of some buttons). See the Guide or choose Annotation Editing from the Help panel).
Note that wave queries the X server to determine the display capabilities and resolution; it is not necessary to use the -g, -m, or -S options unless you wish to restrict wave’s use of the available capabilities. Use the -dpi option to override the server’s default resolution if it is incorrect and cannot be changed otherwise (see comments below under ‘Resources’).
The system on which wave runs (the ‘‘host’’ system) need not be the same as the system to which your keyboard, mouse and display are connected (the ‘‘local’’ system), provided only that the host and local systems are on the same network. If you wish to run wave remotely, simply log in to the host using ssh, which normally handles display redirection automatically. If you use some other method to log in remotely, such as rlogin (not recommended) or telnet (not recommended), it is usually necessary to grant permission for the host system to open windows on the local system’s display (generally, this is accomplished using xhost on the local system; see the documentation for your X server for details), and to set the DISPLAY environment variable on the host system appropriately (if the local system runs UNIX, the value of DISPLAY should be local-hostname:0.0 in most cases; again, consult your X server documentation).
The environment variables below are not needed unless the wave binary distribution, or XView, has been installed in non-standard directories:
You can control many aspects of wave’s appearance and behavior by setting its resources. If you are not familiar with this concept, refer to an introductory book on using the X Window System, such as Darwin, Quercia, and O’Reilly’s X User’s Guide: Open Look Edition (see the link below). Since wave is built using the XView toolkit, all of the resources listed in xview(7) can be used with wave. In addition, the following wave-specific resources may also be set:
By default, all of the display options in the first group are off (False); set any of these X resources to True to enable these options, or use the command-line options to do so.
The remaining resources and command-line display options correspond to the menu buttons in wave’s View window. The value of each resource, or the numeric argument that immediately follows the command-line option, should match the position of the desired menu choice, where the top item on each menu is in position 0, the one below it is in position 1, etc. For example, to set the initial amplitude scale to 5 mm/mV (the item at position 2 in the ‘Amplitude scale’ menu), add -Vv 2 to the command line, or Wave.View.AmplitudeScale:2 to the X11 resource database.
|-Vt 0||0.25 mm/hour|
|-Vt 1||1 mm/hour|
|-Vt 2||5 mm/hour|
|-Vt 3||0.25 mm/min|
|-Vt 4||1 mm/min|
|-Vt 5||5 mm/min|
|-Vt 6||25 mm/min|
|-Vt 7||50 mm/min|
|-Vt 8||125 mm/min|
|-Vt 9||250 mm/min|
|-Vt 10||500 mm/min|
|-Vt 11||12.5 mm/sec|
|-Vt 12||25 mm/sec (default)|
|-Vt 13||50 mm/sec|
|-Vt 14||125 mm/sec|
|-Vt 15||250 mm/sec|
|-Vt 16||500 mm/sec|
|-Vt 17||1000 mm/sec|
|-Vt 18||2000 mm/sec|
|-Vt 19||5000 mm/sec|
|-Vt 20||10 mm/ms|
|-Vt 21||20 mm/ms|
|-Vt 22||50 mm/ms|
|-Vt 23||100 mm/ms|
|-Vt 24||200 mm/ms|
|-Vt 25||500 mm/ms|
In addition to the usual
ways of setting X resources, it is possible to set any of those listed
above, as well as any of the generic XView resources, by using the -xrm
or -default options on the command line when starting wave. For example,
you can set the background color of the signal window using a command such
wave -r 100s -xrm Wave.SignalWindow.Color.Background:lightblue
By specifying two or more record names, separated by ‘+’ characters, in the command-line argument that follows ‘-r’ (see above), you may open separate WAVE signal windows (processes) for each record. These processes are almost completely independent: from any signal window, you may navigate within the record, change display settings, edit annotations, run external analysis programs, quit the process, etc., without affecting any other signal windows.
For example, you may open two signal
windows for the same record by:
wave -r 100+100 -a atr
You can now move about the record freely in either window. This facility makes it easy to compare different segments of the record. Note that whenever two or more windows are displaying the same set of annotations, as in this case, only one should be editing the annotations at any given time.
The window associated with the last record named on the command line has a special status: it is designated the master signal window, and an extra button (labelled ‘Sync’) appears at the top of this window. Clicking on this button causes all of the other signal windows to be redrawn so that the times shown in their lower left corners match that in the master signal window. (Note, however, that if you have quit a signal window from the middle of the list, any signal windows from earlier in the list will no longer respond to sync requests.)
By default, all command-line arguments apply to all signal windows. You may specify an argument that is to apply to only one signal window, however, by prefixing the argument with ‘+n/’, where n is the signal window number. (The first signal window, corresponding to the first record named on the command line, is signal window number 0; the next is number 1, etc.)
This facility has many applications. For
example, you may wish to open two copies of the same record, with two different
wave -r 100+100 -a +0/atr +1/qrs
In this case, record 100 is opened in two windows, with annotator ‘atr’ in window 0 and annotator ‘qrs’ in window 1. (The ‘-a’ option applies to both windows since it does not have a ‘+n/’ prefix.)
As another example, you may wish to
discuss a record with colleagues at other locations:
wave -r 200+200+200 -a qrs +0/-display +0/atlantic.bigu.edu:0 \
Here, record 200 is opened in three windows. Window 0 is opened on display 0 of atlantic.bigu.edu, window 1 on display 0 of pacific.widget.com, and window 2 (the master window) on the local display. (For this to work, your colleagues must first allow your computer to open windows on their displays, typically using xhost. See xview(7) for information about the -display option. Notice that the ‘+n/’ prefix must be attached to both the ‘-display’ option and to its argument in order to apply both of these arguments to the same signal window.) Your colleagues can freely move about the record, but you can direct the discussion at any time by using the Sync button in your signal window. In a case such as this one, anyone can enable editing; you should do so only after making sure that no one else has. Once you have saved your work (by selecting ‘Save’ from the File menu), your changes become visible to your colleagues if they reload the annotations (by clicking on ‘Reload’ from the Load window).
As a final example, the MIMIC Database includes both high-resolution
waveform records and medium-resolution (roughly 1 sample per second) computed
measurement records. You may view both of these at the same time using
a command such as:
wave -r 237+237n -a all
Typically, you will wish to view the high-resolution and low-resolution data at different time scales. Although wave attempts to choose reasonable defaults, you can adjust the scales independently if you wish:
wave -r 237+237n -a all +1/-Vt +1/2
If you use wavescript or wave-remote to control the master signal window (this happens by default unless you use the -pid option of these programs to control a different signal window), the other signal windows are kept synchronized with the master window.
Note that you cannot increase the number of signal windows in a group once you have started a wave process group, although you can run more than one process group at a time if you wish.
wave uses a simple menu file to allow you to set up analysis options. Each line in the file corresponds to a button in the Analyze window (except for empty lines and lines that begin with ‘#’, which are ignored). Within each line, the syntax is label<tab>action, where <tab> is one or more tab characters. The label field is used to identify a command button in the Analyze window, and the action field is any command acceptable to your shell. button-label and action may include spaces if needed; if necessary, a ‘\’ may be used at the end of a line to indicate that it is continued on the next line. Before the command is executed, wave replaces certain tokens with appropriate strings; these include:
Other tokens that begin with ‘$’ are passed to the shell unchanged.
|Mark QRS complexes||sqrs -r $RECORD -f $START -t $END -s $SIGNAL|
|Calibrate||calsig -r $RECORD -f $START -t $END -s $SIGNALS|
|Extract segment||snip -i $RECORD -f $START -t $END -n n_$RECORD \|
|List annotations||rdann -r $RECORD -a $ANNOTATOR -f $START -t $END|
|List samples||rdsamp -r $RECORD -f $START -t $END -s $SIGNALS|
|Print chart||echo $RECORD $START-$END | \|
|pschart -a $ANNOTATOR -g -l -R -s $SIGNALS - | $PSPRINT|
|Print full disclosure||echo $RECORD $START-$END | \|
|psfd -a $ANNOTATOR -g -l -R -s $SIGNALS - | $PSPRINT|
Whenever the pointer is in the signal window, the normal arrow pointer is replaced by a crosshair pointer. At these times, the numeric keypad and several of the function keys may be used for many annotation editing and display operations, and the normal alphanumeric and punctuation keys can be used to select single-character annotation mnemonics (displayed in the Annotation Template window). ‘Num Lock’ must be off if you wish to use the keypad for editing operations. Some of the function and numeric keypad commands work on Sun keyboards only; in these cases, alternate keyboard commands for use with PC and other keyboards are shown in parentheses. Most of these alternate commands also work on Sun keyboards.
Under SunOS, once you have opened the Analyze window or have selected Print from the File menu, do not attempt to suspend wave (for example, by typing control-Z in the controlling terminal window). Under these circumstances, wave may exit immediately (without quit confirmation) and any unsaved edits may be lost. This problem is the result of a bug in the XView termsw package used for the Analysis Commands window. To avoid this bug, always run wave in the background under SunOS. The Linux, Mac OS X, MS Windows, and Solaris 2.x versions of the XView library do not have this bug.
If wave opens with an empty signal window, this may mean that the X server’s backing store is disabled. wave versions 6.8 and later incorporate a workaround that avoids this problem. If you must use an earlier version of wave, enable backing store and restart the X server. (Using the X servers from the x.org or XFree86 projects, backing store can be enabled by inserting the line ‘Option "backingstore"’ in the ‘Device’ section(s) of the xorg.conf or XF86Config-4 file. If your X server is normally started by a display manager such as xdm, close all windows and restart the server with <ctrl><alt><backspace>. Otherwise, log out, log in, and restart the X server manually if necessary.)
If this doesn’t solve the problem, use any of wave’s navigation controls, or resize the signal window, to make the signals visible. On some 24-bit displays, this problem may be the result of an X server bug, and these methods will work around the problem. On some of these displays, text in the signal window may be invisible using overlay graphics mode; if this happens, use the -S option.
No more than one piped record (see the WFDB Programmer’s Guide) can be viewed in a single invocation of wave. If the signal file is a pipe, it is possible only to search forward through it (although wave caches several of the most recently displayed windows, which can be reviewed in any case). Using the ‘>’ button to move by half a frame does not work properly with piped input, nor does changing the display scales, since these actions require rereading the signals.
There appears to be a subtle incompatibility between XView-based applications such as wave and at least some X servers. The symptom of this problem is that wave’s View panel may be blank, and many warning messages from the notifier may appear in the controlling terminal window. This problem appears to occur only when all of the following are true: the X server is running on a multi-head display with Xinerama enabled, the user does not have root privileges, a .Xdefaults file exists, and wave or another XView application has run at least once since the X server was started.
A more serious incompatibility (which may be related to the subtle incompatibility noted above) appeared with the release in 2009 of the X.org version 1.6.3 X server, which freezes when any application that uses the XView library (such as wave) ’grabs’ the mouse pointer. By default, XView applications do so in response to a left button click on any XView control. ’Grabs’ can be disabled, and this behavior avoided, by using the -Wfsdb option available in wave and in other XView applications. In wave version 6.10 and later versions, the default behavior of XView has been changed to disable ’grabs’, and this problem does not occur.
wave currently runs under FreeBSD, GNU/Linux, Mac OS X, MS-Windows with Cygwin/X, Solaris, and SunOS. It should be easily portable to any POSIX-compliant OS that can support X11 and XView. If you would like to use wave on a system other than those listed above, you will need to port XView to your system first (or purchase a commercial port if one is available). Sources for XView are available from PhysioNet (www.physionet.org, where the sources for wave itself are also available), www.ibiblio.org, and their mirrors. We cannot offer assistance in porting XView; if you wish to try this, you are on your own. If you successfully port the cmdtool terminal emulator application included in the XView sources, we will assist you in porting wave (this is much simpler than the XView port).
Table of Contents
Up: WFDB Applications Guide
Please e-mail your comments and suggestions to email@example.com, or post them to:PhysioNet
Updated 28 November 2018