diff -Naur wfdb-10.3.1/MANIFEST wfdb-10.3.2/MANIFEST --- wfdb-10.3.1/MANIFEST Thu Dec 5 03:27:29 2002 +++ wfdb-10.3.2/MANIFEST Mon Feb 24 01:58:08 2003 @@ -16,6 +16,7 @@ app/mfilt.c app/mrgann.c app/mxm.c +app/nguess.c app/nst.c app/plotstm.c app/pscgen.c @@ -61,8 +62,10 @@ checkpkg/appcheck checkpkg/checkfile checkpkg/expected/ +checkpkg/expected/100a.nguess checkpkg/expected/100s.a2r checkpkg/expected/100s.mix +checkpkg/expected/100s.mrg checkpkg/expected/100s.qrs checkpkg/expected/100s.sigavg checkpkg/expected/100s.wqrs @@ -112,6 +115,7 @@ checkpkg/expected/xform.all checkpkg/expected/xform.dat checkpkg/expected/xform.hea +checkpkg/expected/xform.wabp checkpkg/input/ checkpkg/input/100x.hea checkpkg/input/ecgeval @@ -122,6 +126,7 @@ checkpkg/Makefile checkpkg/Makefile.top checkpkg/Makefile.tpl +checkpkg/mitdb/ conf/ conf/cygwin.def conf/cygwin-slib.def @@ -156,11 +161,15 @@ convert/makeid.c convert/md2a.c convert/mit2edf.c +convert/mit2wav.c convert/readid.c convert/README convert/revise.c +convert/wav2mit.c COPYING data/ +data/100a.atr +data/100a.hea data/100s.atr data/100s.dat data/100s.hea @@ -269,6 +278,7 @@ doc/wag-src/header.5 doc/wag-src/hrfft.1 doc/wag-src/ihr.1 +doc/wag-src/imageplt.1 doc/wag-src/install0.tex doc/wag-src/intro.ht0 doc/wag-src/.latex2html-init @@ -286,10 +296,13 @@ doc/wag-src/mfilt.1 doc/wag-src/mrgann.1 doc/wag-src/mxm.1 +doc/wag-src/nguess.1 doc/wag-src/nst.1 doc/wag-src/plot2d.1 doc/wag-src/plotstm.1 doc/wag-src/plt.1 +doc/wag-src/pltf.1 +doc/wag-src/pnnlist.1 doc/wag-src/pschart.1 doc/wag-src/psfd.1 doc/wag-src/rdann.1 @@ -310,12 +323,13 @@ doc/wag-src/sumstats.1 doc/wag-src/tach.1 doc/wag-src/tmac.dif -doc/wag-src/view.1 +doc/wag-src/view-dos.1 doc/wag-src/wabp.1 doc/wag-src/wag.cover doc/wag-src/wag.ht0 doc/wag-src/wag.ht1 doc/wag-src/wag.tex +doc/wag-src/wav2mit.1 doc/wag-src/wave.1 doc/wag-src/wfdb.3 doc/wag-src/wfdbcal.5 @@ -480,10 +494,9 @@ lib/README lib/signal.c lib/wfdbdll.def -lib/wfdb.h +lib/wfdb.h0 lib/wfdbinit.c lib/wfdbio.c -lib/wfdblib.h lib/wfdblib.h0 Makefile Makefile.top diff -Naur wfdb-10.3.1/Makefile wfdb-10.3.2/Makefile --- wfdb-10.3.1/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/Makefile Mon Feb 24 00:53:28 2003 @@ -39,12 +39,12 @@ # create source archives, type `make tarballs'; or to make a binary archive, # type `make bin-tarball'. Making archives requires PGP, gzip, and GNU tar). # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -56,18 +56,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -114,7 +114,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -221,8 +221,8 @@ lib-post-uninstall: echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ -# file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 8 August 2002 +# file: Makefile.tpl G. Moody 24 May 2000 +# Last revised: 17 December 2002 # This section of the Makefile should not need to be changed. # ARCH specifies the type of CPU and the operating system (e.g., 'i686-Linux'). @@ -333,6 +333,8 @@ # documentation), and check that the MANIFEST (list of files in the package) # is correct. tarballs: clean + rm -f ../$(PACKAGE)-MANIFEST ../$(PACKAGE).tar.gz \ + ../$(PACKAGE)-no-docs.tar.gz cd lib; $(SETPERMISSIONS) *.h cd ..; tar --create --file $(PACKAGE).tar.gz --verbose --gzip \ '--exclude=$(PACKAGE)/*CVS' $(PACKAGE) | sed s+${PACKAGE}/++ | \ @@ -359,10 +361,14 @@ rpms: tarballs cp -p ../$(PACKAGE).tar.gz $(RPMROOT)/SOURCES - sed s/VERSION/$(VERSION)/ $(PACKAGE)-$(RPMRELEASE).spec cp -p $(PACKAGE)-$(RPMRELEASE).spec $(RPMROOT)/SPECS - rpm -ba $(PACKAGE)-$(RPMRELEASE).spec - mv $(RPMROOT)/RPMS/*/$(PACKAGE)-$(RPMRELEASE).*.rpm .. + if [ -x /usr/bin/rpmbuild ]; \ + then rpmbuild -ba $(PACKAGE)-$(RPMRELEASE).spec; \ + else echo "rpmbuild not found in /usr/bin; attempting to use rpm"; \ + rpm -ba $(PACKAGE)-$(RPMRELEASE).spec; fi + mv $(RPMROOT)/RPMS/*/wfdb*-$(VERSION)-$(RPMRELEASE).*.rpm .. mv $(RPMROOT)/SRPMS/$(PACKAGE)-$(RPMRELEASE).src.rpm .. rm -f $(PACKAGE)-$(RPMRELEASE).spec diff -Naur wfdb-10.3.1/Makefile.tpl wfdb-10.3.2/Makefile.tpl --- wfdb-10.3.1/Makefile.tpl Mon Oct 14 03:57:09 2002 +++ wfdb-10.3.2/Makefile.tpl Wed Dec 18 15:42:30 2002 @@ -1,5 +1,5 @@ -# file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 8 August 2002 +# file: Makefile.tpl G. Moody 24 May 2000 +# Last revised: 17 December 2002 # This section of the Makefile should not need to be changed. # ARCH specifies the type of CPU and the operating system (e.g., 'i686-Linux'). @@ -110,6 +110,8 @@ # documentation), and check that the MANIFEST (list of files in the package) # is correct. tarballs: clean + rm -f ../$(PACKAGE)-MANIFEST ../$(PACKAGE).tar.gz \ + ../$(PACKAGE)-no-docs.tar.gz cd lib; $(SETPERMISSIONS) *.h cd ..; tar --create --file $(PACKAGE).tar.gz --verbose --gzip \ '--exclude=$(PACKAGE)/*CVS' $(PACKAGE) | sed s+${PACKAGE}/++ | \ @@ -136,10 +138,14 @@ rpms: tarballs cp -p ../$(PACKAGE).tar.gz $(RPMROOT)/SOURCES - sed s/VERSION/$(VERSION)/ $(PACKAGE)-$(RPMRELEASE).spec cp -p $(PACKAGE)-$(RPMRELEASE).spec $(RPMROOT)/SPECS - rpm -ba $(PACKAGE)-$(RPMRELEASE).spec - mv $(RPMROOT)/RPMS/*/$(PACKAGE)-$(RPMRELEASE).*.rpm .. + if [ -x /usr/bin/rpmbuild ]; \ + then rpmbuild -ba $(PACKAGE)-$(RPMRELEASE).spec; \ + else echo "rpmbuild not found in /usr/bin; attempting to use rpm"; \ + rpm -ba $(PACKAGE)-$(RPMRELEASE).spec; fi + mv $(RPMROOT)/RPMS/*/wfdb*-$(VERSION)-$(RPMRELEASE).*.rpm .. mv $(RPMROOT)/SRPMS/$(PACKAGE)-$(RPMRELEASE).src.rpm .. rm -f $(PACKAGE)-$(RPMRELEASE).spec diff -Naur wfdb-10.3.1/NEWS wfdb-10.3.2/NEWS --- wfdb-10.3.1/NEWS Thu Dec 5 03:13:06 2002 +++ wfdb-10.3.2/NEWS Wed Feb 19 22:44:49 2003 @@ -1,3 +1,43 @@ +10.3.2: + New applications wav2mit and mit2wav create WFDB-format records from + files in the widely-used .wav audio format and vice versa. + + New application nguess estimates the locations of missing normal + sinus heart beats in an annotation file. + + When running multiple WAVE processes started from a single command, + it is now possible to update all of the signal windows by selecting + a sample in the master signal window (using +). + + WAVE now handles invalid entries in the signal list properly; thanks + to Joe Mietus for the bug report. + + Changed options in ann2rr to support more flexible output formatting. + + Fixed a WFDB library bug that caused annotation sorting to fail + if a new header file had been written. Thanks to Winton Baker for + reporting this problem and for providing an example that illustrated + the bug. + + Fixed a bug in mit2edf that caused a crash instead of printing help + if no arguments were supplied on the command line; thanks to Jesus + Olivan for the bug report. + + Better input checking in edf2mit; fixed bugs in handling of unusual + signal lists. + + Fixed a bug in snip that caused a crash if -a was the last option + on the command line; thanks to Joe Mietus for the bug report. + + Fixed installation bugs in psd/hr* scripts and psd/Makefile.tpl. + + Corrected a documentation bug in WAVE's on-line help. + + Revised rpm.spec and rules (in Makefile.tpl) for creating RPMs. + There are now separate wfdb, wfdb-devel, wfdb-app, wfdb-doc, and + wfdb-wave RPMs. + 10.3.1: Added a -W option to ann2rr to create 2-column output containing intervals in seconds and annotation mnemonics, and modified the diff -Naur wfdb-10.3.1/app/Makefile wfdb-10.3.2/app/Makefile --- wfdb-10.3.1/app/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/app/Makefile Mon Feb 24 00:53:28 2003 @@ -33,12 +33,12 @@ # type `make listing'. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -50,18 +50,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -108,7 +108,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -216,21 +216,21 @@ echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ # file: Makefile.tpl G. Moody 23 May 2000 -# Last revised: 5 December 2002 +# Last revised: 17 February 2003 # This section of the Makefile should not need to be changed. CFILES = ann2rr.c bxb.c calsig.c ecgeval.c epicmp.c fir.c ihr.c mfilt.c \ - mrgann.c mxm.c nst.c plotstm.c pscgen.c pschart.c psfd.c rdann.c rdsamp.c \ - rr2ann.c rxr.c sampfreq.c sample.c sigamp.c sigavg.c skewedit.c snip.c \ - sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c view.c vsetup.c wabp.c \ - wfdbcat.c wfdbcollate.c wfdb-config.c wfdbdesc.c wfdbwhich.c wqrs.c wrann.c \ - wrsamp.c wvscript.c xform.c + mrgann.c mxm.c nguess.c nst.c plotstm.c pscgen.c pschart.c psfd.c rdann.c \ + rdsamp.c rr2ann.c rxr.c sampfreq.c sample.c sigamp.c sigavg.c skewedit.c \ + snip.c sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c view.c vsetup.c \ + wabp.c wfdbcat.c wfdbcollate.c wfdb-config.c wfdbdesc.c wfdbwhich.c wqrs.c \ + wrann.c wrsamp.c wvscript.c xform.c XFILES = ann2rr bxb calsig ecgeval epicmp fir ihr mfilt \ - mrgann mxm nst plotstm pscgen pschart psfd rdann rdsamp \ - rr2ann rxr sampfreq sigamp sigavg skewedit snip \ - sortann sqrs sqrs125 sumann sumstats tach wabp \ - wfdbcat wfdbcollate wfdb-config wfdbdesc wfdbwhich wqrs wrann \ - wrsamp xform + mrgann mxm nguess nst plotstm pscgen pschart psfd rdann \ + rdsamp rr2ann rxr sampfreq sigamp sigavg skewedit \ + snip sortann sqrs sqrs125 sumann sumstats tach \ + wabp wfdbcat wfdbcollate wfdb-config wfdbdesc wfdbwhich wqrs \ + wrann wrsamp xform SCRIPTS = cshsetwfdb setwfdb PSFILES = pschart.pro psfd.pro 12lead.pro OTHERFILES = cshsetwfdb setwfdb setwfdb.bat sample8.hea @@ -285,6 +285,8 @@ $(CC) $(CFLAGS) bxb.c -o $@ $(LDFLAGS) -lm mxm: mxm.c $(CC) $(CFLAGS) mxm.c -o $@ $(LDFLAGS) -lm +nguess: nguess.c + $(CC) $(CFLAGS) nguess.c -o $@ $(LDFLAGS) -lm nst: nst.c $(CC) $(CFLAGS) nst.c -o $@ $(LDFLAGS) -lm plotstm: plotstm.c diff -Naur wfdb-10.3.1/app/Makefile.tpl wfdb-10.3.2/app/Makefile.tpl --- wfdb-10.3.1/app/Makefile.tpl Thu Dec 5 02:50:05 2002 +++ wfdb-10.3.2/app/Makefile.tpl Mon Feb 17 07:22:45 2003 @@ -1,19 +1,19 @@ # file: Makefile.tpl G. Moody 23 May 2000 -# Last revised: 5 December 2002 +# Last revised: 17 February 2003 # This section of the Makefile should not need to be changed. CFILES = ann2rr.c bxb.c calsig.c ecgeval.c epicmp.c fir.c ihr.c mfilt.c \ - mrgann.c mxm.c nst.c plotstm.c pscgen.c pschart.c psfd.c rdann.c rdsamp.c \ - rr2ann.c rxr.c sampfreq.c sample.c sigamp.c sigavg.c skewedit.c snip.c \ - sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c view.c vsetup.c wabp.c \ - wfdbcat.c wfdbcollate.c wfdb-config.c wfdbdesc.c wfdbwhich.c wqrs.c wrann.c \ - wrsamp.c wvscript.c xform.c + mrgann.c mxm.c nguess.c nst.c plotstm.c pscgen.c pschart.c psfd.c rdann.c \ + rdsamp.c rr2ann.c rxr.c sampfreq.c sample.c sigamp.c sigavg.c skewedit.c \ + snip.c sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c view.c vsetup.c \ + wabp.c wfdbcat.c wfdbcollate.c wfdb-config.c wfdbdesc.c wfdbwhich.c wqrs.c \ + wrann.c wrsamp.c wvscript.c xform.c XFILES = ann2rr bxb calsig ecgeval epicmp fir ihr mfilt \ - mrgann mxm nst plotstm pscgen pschart psfd rdann rdsamp \ - rr2ann rxr sampfreq sigamp sigavg skewedit snip \ - sortann sqrs sqrs125 sumann sumstats tach wabp \ - wfdbcat wfdbcollate wfdb-config wfdbdesc wfdbwhich wqrs wrann \ - wrsamp xform + mrgann mxm nguess nst plotstm pscgen pschart psfd rdann \ + rdsamp rr2ann rxr sampfreq sigamp sigavg skewedit \ + snip sortann sqrs sqrs125 sumann sumstats tach \ + wabp wfdbcat wfdbcollate wfdb-config wfdbdesc wfdbwhich wqrs \ + wrann wrsamp xform SCRIPTS = cshsetwfdb setwfdb PSFILES = pschart.pro psfd.pro 12lead.pro OTHERFILES = cshsetwfdb setwfdb setwfdb.bat sample8.hea @@ -68,6 +68,8 @@ $(CC) $(CFLAGS) bxb.c -o $@ $(LDFLAGS) -lm mxm: mxm.c $(CC) $(CFLAGS) mxm.c -o $@ $(LDFLAGS) -lm +nguess: nguess.c + $(CC) $(CFLAGS) nguess.c -o $@ $(LDFLAGS) -lm nst: nst.c $(CC) $(CFLAGS) nst.c -o $@ $(LDFLAGS) -lm plotstm: plotstm.c diff -Naur wfdb-10.3.1/app/ann2rr.c wfdb-10.3.2/app/ann2rr.c --- wfdb-10.3.1/app/ann2rr.c Thu Dec 5 01:05:31 2002 +++ wfdb-10.3.2/app/ann2rr.c Sat Feb 8 16:41:29 2003 @@ -1,8 +1,8 @@ /* file: ann2rr.c G. Moody 16 May 1995 - Last revised: 5 December 2002 + Last revised: 8 February 2003 ------------------------------------------------------------------------------- ann2rr: Calculate RR intervals from an annotation file -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -42,20 +42,23 @@ int argc; char *argv[]; { - char *record = NULL, *prog_name(); - double sps, spm, sph, rrsec; - int cflag=0, i, j, pflag=0, previous_annot_valid=0, tformat=0, vflag=0, - wflag=0; - long beat_number = 0L, from = 0L, to = 0L, rr, tp = 0L, atol(); - static char flag[ACMAX+1]; + char *record = NULL, rrfstr[8], t0fstr[8], t1fstr[8], *prog_name(); + double sps, spm, sph; + int Aflag = 0, a0, a0flag = 0, a1, a1flag = 0, + cflag = 0, i, j, pflag = 0, previous_annot_valid = 0, rrdigits = 3, + rrformat = 0, t0digits = 3, t0flag = 0, t0format = 0, t1digits = 3, + t1flag = 0, t1format = 0; + long atol(); + static char a0f[ACMAX+1], a1f[ACMAX+1]; static WFDB_Anninfo ai; static WFDB_Annotation annot; + static WFDB_Time from, to, rr, t0, t1; void help(); pname = prog_name(argv[0]); /* Interpret command-line options. */ - for (i = flag[0] = 1; i < argc; i++) { + for (i = a0f[0] = a1f[0] = 1; i < argc; i++) { if (*argv[i] == '-') switch (*(argv[i]+1)) { case 'a': /* annotator follows */ if (++i >= argc) { @@ -65,6 +68,9 @@ } ai.name = argv[i]; break; + case 'A': /* print intervals between annotations of all types */ + Aflag = 1; + break; case 'c': /* print intervals between consecutive valid annotations only */ cflag = 1; @@ -81,23 +87,46 @@ help(); exit(0); break; + case 'i': /* specify interval output format */ + if (++i >= argc || *(argv[i]) == '-') { + (void)fprintf(stderr, + "%s: interval output format must follow -i\n", + pname); + exit(1); + } + rrformat = *(argv[i]); + sscanf(argv[i]+1, "%d", &rrdigits); + break; case 'p': /* annotation mnemonic(s) follow */ if (++i >= argc || !isann(j = strann(argv[i]))) { (void)fprintf(stderr, - "%s: annotation mnemonic(s) must follow -p\n", + "%s: annotation mnemonic(s) must follow -P\n", pname); exit(1); } - flag[j] = 1; + a1f[j] = 1; /* The code above not only checks that there is a mnemonic where there should be one, but also allows for the possibility that there might be a (user-defined) mnemonic beginning with `-'. The following lines pick up any other mnemonics, but assume that arguments beginning with `-' are options, not mnemonics. */ while (++i < argc && argv[i][0] != '-') - if (isann(j = strann(argv[i]))) flag[j] = 1; + if (isann(j = strann(argv[i]))) a1f[j] = 1; if (i == argc || argv[i][0] == '-') i--; - flag[0] = 0; + a1f[0] = 0; + break; + case 'P': /* annotation mnemonic(s) follow */ + if (++i >= argc || !isann(j = strann(argv[i]))) { + (void)fprintf(stderr, + "%s: annotation mnemonic(s) must follow -p\n", + pname); + exit(1); + } + a0f[j] = 1; + while (++i < argc && argv[i][0] != '-') + if (isann(j = strann(argv[i]))) a0f[j] = 1; + if (i == argc || argv[i][0] == '-') i--; + a0f[0] = 0; break; case 'r': /* input record name follows */ if (++i >= argc) { @@ -115,23 +144,29 @@ } to = i; break; - case 'v': /* output times of beginnings of intervals */ - case 'V': /* output times of ends of intervals */ - vflag = (*(argv[i]+1) == 'v') ? 1 : -1; - switch (*(argv[i]+2)) { - case 'h': tformat = 3; break; /* use hours */ - case 'm': tformat = 2; break; /* use minutes */ - case 's': tformat = 1; break; /* use seconds */ - default: tformat = 0; break; /* use sample intervals */ + case 'v': /* output times of ends of intervals */ + t1flag = 1; + if (++i >= argc || argv[i][0] == '-') + i--; + else { + t1format = *(argv[i]); + sscanf(argv[i]+1, "%d", &t1digits); + } + break; + case 'V': /* output times of beginnings of intervals */ + t0flag = 1; + if (++i >= argc || argv[i][0] == '-') + i--; + else { + t0format = *(argv[i]); + sscanf(argv[i]+1, "%d", &t0digits); } break; case 'w': /* output annotation types following intervals */ - wflag = 1; + a1flag = 1; break; - case 'W': /* output annotation types following intervals in sec */ - wflag = 1; - if (vflag == 0) vflag = 1; - if (tformat == 0) tformat = -1; + case 'W': /* output annotation types preceeding intervals */ + a0flag = 1; break; default: (void)fprintf(stderr, "%s: unrecognized option %s\n", @@ -158,71 +193,116 @@ if (annopen(record, &ai, 1) < 0) /* open annotation file */ exit(2); + if (rrdigits < 0 || rrdigits > 15) rrdigits = 3; + sprintf(rrfstr, "%%.%dlf", rrdigits); + if (t0digits < 0 || t0digits > 15) t0digits = 3; + sprintf(t0fstr, "%%.%dlf", t0digits); + if (t1digits < 0 || t1digits > 15) t1digits = 3; + sprintf(t1fstr, "%%.%dlf", t1digits); + if (from) { - if (*argv[(int)from] == '#') { - if ((beat_number = atol(argv[(int)from]+1)) < 0L) beat_number = 0L; - while (beat_number > 0L && getann(0, &annot) == 0) - if (isqrs(annot.anntyp)) beat_number--; - if (beat_number > 0L) exit(2); - } - else if (iannsettime(strtim(argv[(int)from])) < 0) exit(2); + from = strtim(argv[(int)from]); + if (from < (WFDB_Time)0) from = -from; } if (to) { - if (*argv[(int)to] == '#') { - if ((beat_number = atol(argv[(int)to]+1)) < 1L) beat_number = 1L; - to = (WFDB_Time)0; - } - else { - beat_number = -1L; - to = strtim(argv[(int)to]); - if (to < (WFDB_Time)0) to = -to; - } + to = strtim(argv[(int)to]); + if (to < (WFDB_Time)0) to = -to; + } + if (to < from) { + WFDB_Time tt = from; + + from = to; + to = tt; } + if (from > (WFDB_Time)0 && iannsettime(from) < 0) + exit(2); + + a0 = NOTQRS; + t0 = from; - tp = from; while (getann(0, &annot) == 0 && (to == (WFDB_Time)0 || annot.time <= to)){ - if (!isann(annot.anntyp)) continue; - if ((flag[0] && isqrs(annot.anntyp)) || flag[annot.anntyp]) { + a1 = annot.anntyp; + t1 = annot.time; + + /* Does t1 mark a valid interval end point? */ + if (Aflag || (a1f[0] && isqrs(a1)) || a1f[a1]) { + /* Does t0 mark a valid interval starting point? */ if (cflag == 0 || previous_annot_valid == 1) { - if (vflag) { /* print elapsed time if requested */ - long tt = (vflag > 0) ? tp : annot.time; - switch (tformat) { - default: - case 0: (void)printf("%ld\t", tt); break; - case 1: (void)printf("%.3lf\t", tt/sps); break; - case 2: (void)printf("%.5lf\t", tt/spm); break; - case 3: (void)printf("%.7lf\t", tt/sph); break; - case -1: break; + /* If requested, print time at beginning of interval. */ + if (t0flag) { + switch (t0format) { + case 'h': (void)printf(t0fstr, t0/sph); break; + case 'm': (void)printf(t0fstr, t0/spm); break; + case 's': (void)printf(t0fstr, t0/sps); break; + case 't': if (t0 == (WFDB_Time)0) + (void)printf(" 0:00.000"); + else + (void)printf("%s", mstimstr(t0)); + break; + case 'T': (void)printf("%s", mstimstr(-t0)); break; + default: (void)printf("%ld", t0); break; } - } - /* print RR interval */ - rr = annot.time - tp; - if (tformat) { - char rrstr[10]; - static double frr, t = 0.0; - - (void)sprintf(rrstr, "%.3lf", rr/sps); - (void)printf("%s", rrstr); - sscanf(rrstr, "%lf", &frr); - t += frr * sps; - tp = (long)(t + 0.5); + (void)printf("\t"); } - else { - (void)printf("%ld", rr); - tp = annot.time; + + /* If requested, print annotation at beginning of interval. */ + if (a0flag) { + if (a0 == NOTQRS) (void)printf("[0]\t"); + else (void)printf("%s\t", annstr(a0)); } - /* print annotation type if requested */ - if (wflag) (void)printf("\t%s", annstr(annot.anntyp)); - printf("\n"); + + /* Print the interval, and update t0 and a0. */ + rr = t1 - t0; + switch (rrformat) { + char rrstr[20]; + double frr; + + case 'h': (void)sprintf(rrstr, rrfstr, rr/sph); + (void)printf("%s", rrstr); + (void)sscanf(rrstr, "%lf", &frr); + t1 = (long)(t0 + frr * sph + 0.5); + break; + case 'm': (void)sprintf(rrstr, rrfstr, rr/spm); + (void)printf("%s", rrstr); + (void)sscanf(rrstr, "%lf", &frr); + t1 = (long)(t0 + frr * spm + 0.5); + break; + case 's': (void)sprintf(rrstr, rrfstr, rr/sps); + (void)printf("%s", rrstr); + (void)sscanf(rrstr, "%lf", &frr); + t1 = (long)(t0 + frr * sps + 0.5); + break; + case 't': (void)printf("%s", mstimstr(t1)); break; + default: (void)printf("%ld", rr); break; + } + + /* If requested, print annotation at end of interval. */ + if (a1flag) + (void)printf("\t%s", annstr(a1)); + + /* If requested, print time at end of interval. */ + if (t1flag) { + (void)printf("\t"); + switch (t1format) { + case 'h': (void)printf(t1fstr, t1/sph); break; + case 'm': (void)printf(t1fstr, t1/spm); break; + case 's': (void)printf(t1fstr, t1/sps); break; + case 't': (void)printf("%s", mstimstr(-t1)); break; + default: (void)printf("%ld", t1); break; + } + } + + (void)printf("\n"); } - else - tp = annot.time; + } + /* Does t1 mark a valid interval starting point? */ + if (Aflag || (a0f[0] && isqrs(a1)) || a0f[a1]) { + a0 = a1; + t0 = t1; previous_annot_valid = 1; } else if (cflag) previous_annot_valid = 0; - if (beat_number > 0L && isqrs(annot.anntyp) && --beat_number == 0L) - break; } exit(0); /*NOTREACHED*/ } @@ -250,24 +330,29 @@ static char *help_strings[] = { "usage: %s -r RECORD -a ANNOTATOR [OPTIONS ...]\n", "where RECORD and ANNOTATOR specify the input, and OPTIONS may include:", + " -A print all intervals between annotations (default: print only RR", + " intervals; overrides -c, -p)", " -c print intervals between consecutive valid annotations only", " -f TIME start at specified TIME", " -h print this usage summary", + " -i FMT print intervals using format FMT (see below for values of FMT)", " -p TYPE [TYPE ...] print intervals ending with annotations of specified", " TYPEs only (use mnemonics such as N or V for TYPE)", + " -P TYPE [TYPE ...] print intervals beginning with specified types only", " -t TIME stop at specified TIME", - "The output contains the RR intervals (in units of sample intervals) only,", - "unless one of the additional options below is used:", - " -v print times of beginnings of intervals before each interval", - " -vh same as -v, but print times in hours and RR intervals in seconds", - " -vm same as -v, but print times in minutes and RR intervals in seconds", - " -vs same as -v, but print times and RR intervals in seconds", - " -V print times of ends of intervals before each interval", - " -Vh same as -V, but print times in hours and RR intervals in seconds", - " -Vm same as -V, but print times in minutes and RR intervals in seconds", - " -Vs same as -V, but print times and RR intervals in seconds", - " -w print annotation types following intervals (in sample intervals)", - " -W print annotation types following intervals (in seconds)", + " -v FMT print times of ends of intervals using format FMT (see below)", + " -V FMT print times of beginnings of intervals using format FMT (see below)", + " -w print annotations that end intervals", + " -W print annotations that begin intervals", + "By default, the output contains the RR intervals only, unless one or more", + "of -v, -V, -w, or -W are used. Intervals and times are printed in units of", + "sample intervals, unless a format is specified using -i, -v, or -V.", + "Formats can be 'h' (hours), 'm' (minutes), 's' (seconds), 't' (hh:mm:ss);", + "when used with -v or -V, format 'T' yields dates and times if available,", + "or the format can be omitted to obtain times in sample intervals. Formats", + "'h', 'm', and 's' may be followed by a number between 0 and 15, specifying", + "the number of decimal places (default: 3). For example, to obtain intervals", + "in seconds with 8 decimal places, use '-i s8'.", NULL }; @@ -276,6 +361,14 @@ int i; (void)fprintf(stderr, help_strings[0], pname); - for (i = 1; help_strings[i] != NULL; i++) + for (i = 1; help_strings[i] != NULL; i++) { (void)fprintf(stderr, "%s\n", help_strings[i]); + if (i % 23 == 0) { + char b[5]; + (void)fprintf(stderr, "--More--"); + (void)fgets(b, 5, stdin); + (void)fprintf(stderr, "\033[A\033[2K"); /* erase "--More--"; + assumes ANSI terminal */ + } + } } diff -Naur wfdb-10.3.1/app/nguess.c wfdb-10.3.2/app/nguess.c --- wfdb-10.3.1/app/nguess.c Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/app/nguess.c Sun Feb 23 14:14:06 2003 @@ -0,0 +1,361 @@ +/* file: nguess.c G. Moody 9 June 1986 + Last revised: 17 February 2003 +------------------------------------------------------------------------------- +nguess: Guess the times of missing normal sinus beats in an annotation file +Copyright (C) 2003 George B. Moody + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA. + +You may contact the author by e-mail (george@mit.edu) or postal mail +(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, +please visit PhysioNet (http://www.physionet.org/). +_______________________________________________________________________________ + +This program copies its input (a WFDB annotation file containing beat +annotations), removing annotations of events other than sinus beats, and +interpolating additional Q (unknown beat) annotations at times when sinus beats +are expected. Intervals between sinus beats are predicted using a predictor +array as described by Paul Schluter ("The design and evaluation of a bedside +cardiac arrhythmia monitor"; Ph.D. thesis, MIT Dept. of Electrical +Engineering, 1981). When the predictions are inconsistent with the known sinus +beats, as may occur in extreme noise or in highly irregular rhythms such as +atrial fibrillation, no interpolations are made. + +It should be understood that, as the name of this program implies, the Q labels +it generates represent, at best, good guesses about the times at which sinus +beats may be expected. Ideally, one should avoid having to make such guesses, +but some commonly-used techniques for study of heart rate variability (for +example, conventional methods for power spectral density estimation in the +frequency domain) require a uniformly sampled instantaneous heart rate signal, +such as can be obtained using 'tach' to process the output of 'nguess'. Other +techniques, such as the Lomb periodogram method implemented by 'lomb', can +obtain frequency spectra from time series with missing and irregularly spaced +values, such as can be produced from a beat annotation file using 'ihr' without +the need to use 'nguess'. Use 'nguess' only when necessary and do not expect +it to perform miracles; as a rule of thumb, if the number of guesses (Q +annotations) exceeds one or two percent of the number of known sinus beats (N +annotations), be exceedingly wary of the guesses and consider using techniques +such as 'lomb' that do not require the use of 'nguess'. Also as a general +rule, 'nguess' works best when it is guessing the locations of sinus beats +obscured by noise, or those of sinus beats that were inhibited by isolated +premature ventricular beats; the underlying hypothesis of a quasi-continuous +sinus rhythm, the basis not only of 'nguess' but also of all other algorithms +for reconstructing NN interval time series, is most suspect in the context of +supraventricular ectopic beats (which may reset the SA node, thus interrupting +the sinus rhythm) and consecutive ventricular ectopic beats. + +The predictor array method is based on the observation that most of the +short-term variability in normal sinus inter-beat (NN) intervals is due to +respiratory sinus arrhythmia (RSA, the quasi-periodic modulation of heart rate +by respiration, which is most notable in young, healthy subjects and decreases +with age). Since respiration rate is (in humans and smaller mammals) +substantially slower than heart rate, it is possible to estimate the length of +the respiratory cycle in terms of some number of NN intervals. If, for +example, heart rate is around 60 beats per minute and respiration rate is +around 10 breaths per minute, one might expect that 6 NN intervals would +correspond to one breath, and that the current interval might be particularly +well-approximated by the sixth previous interval. Since we don't know the +ratio between heart and respiration rate a priori, we can observe how well each +of the previous PBLEN intervals predicts the current interval on average. Thus +we have PBLEN predictors for each interval, some of which may be much better on +average than others. At any time, we know which predictor is (locally) the +best, and we can use that predictor to make a best guess of the location of the +next sinus beat. In subjects with significant RSA, the best predictor may be +determined by the length of the respiratory cycle; in others, the previous beat +may be a better predictor. For our purposes, it really doesn't matter which +predictor is best, only that the mean error of the best predictor is small. If +the next known sinus beat is at least 1.75 times as distant as the prediction, +and if the predictions are reasonably good on average, 'nguess' asserts that a +gap exists and fills it in with a Q annotation (or more than one, if the gap is +sufficiently long). +*/ + +#include +#include +#include +#include +#define PBLEN 12 /* size of predictor array */ + +char *pname, *prog_name(); + +main(argc, argv) +int argc; +char *argv[]; +{ + char *record = NULL; + static double alpha = 0.75, bestpe, pe[PBLEN], rrmax, sps, worstpe; + static int b, best, i, n, worst; + static long rr[PBLEN], rrsum; + static WFDB_Anninfo an[2]; + static WFDB_Annotation in_ann, out_ann; + static WFDB_Time from, from0, next, to; + void help(); + + pname = prog_name(argv[0]); + + /* Interpret command-line options. */ + for (i = 1; i < argc; i++) { + if (*argv[i] == '-') switch (*(argv[i]+1)) { + case 'a': /* annotator follows */ + if (++i >= argc) { + (void)fprintf(stderr, "%s: input annotator must follow -a\n", + pname); + exit(1); + } + an[0].name = argv[i]; + break; + case 'f': /* starting time follows */ + if (++i >= argc) { + (void)fprintf(stderr, "%s: starting time must follow -f\n", + pname); + exit(1); + } + from = i; /* to be converted to sample intervals below */ + break; + case 'h': /* print usage summary and quit */ + help(); + exit(0); + break; + case 'o': /* output annotator follows */ + if (++i >= argc) { + (void)fprintf(stderr, "%s: output annotator must follow -o\n", + pname); + exit(1); + } + an[1].name = argv[i]; + break; + case 'r': /* input record name follows */ + if (++i >= argc) { + (void)fprintf(stderr, + "%s: input record name must follow -r\n", + pname); + exit(1); + } + record = argv[i]; + break; + case 't': /* ending time follows */ + if (++i >= argc) { + (void)fprintf(stderr, "%s: end time must follow -t\n", pname); + exit(1); + } + to = i; + break; + default: + (void)fprintf(stderr, "%s: unrecognized option %s\n", + pname, argv[i]); + exit(1); + } + else { + (void)fprintf(stderr, "%s: unrecognized argument %s\n", + pname, argv[i]); + exit(1); + } + } + + /* Check that required arguments are present. */ + if (record == NULL || an[0].name == NULL) { + help(); + exit(1); + } + an[0].stat = WFDB_READ; + if (an[1].name == NULL) an[1].name = "nguess"; + an[1].stat = WFDB_WRITE; + + /* Open the input and output annotation files. */ + if (annopen(record, an, 2) < 0) + exit(2); + wfdbquiet(); + if ((sps = sampfreq(record)) < 0) { + fprintf(stderr, + "%s: can't read header for record %s, assuming %g Hz\n", + pname, record, sps = WFDB_DEFFREQ); + setsampfreq(sps); + } + wfdbverbose(); + + if (from) { + from = strtim(argv[(int)from]); + if (from < (WFDB_Time)0) from = -from; + } + if (to) { + to = strtim(argv[(int)to]); + if (to < (WFDB_Time)0) to = -to; + } + if (to < from) { + WFDB_Time tt = from; + + from = to; + to = tt; + } + + rrmax = sps/2.0; + + /* Begin processing a minute before the specified start time, if possible. + No output is produced until the specified start time, but the extra + minute gives the program a chance to `learn' the rhythm. */ + if ((from0 = from - strtim("1:0")) < 0L) + from0 = 0L; + if (from0 > 0L && iannsettime(from0) < 0) { + wfdbquit(); + exit(0); + } + + /* Get the first normal beat annotation after from0. */ + getnormal(&in_ann); + + out_ann.time = in_ann.time; + + /* Once past `from', emit an output annotation for each iteration of the + loop below. */ + while (to <= 0L || out_ann.time < to) { + /* Get (in in_ann) the normal beat annotation that occurs nearest the + prediction, and get the following normal beat annotation in + in_ann. Once the predictor array is full, the prediction is + updated on each iteration, and the following lines discard + interpolated beats and false detections. The assumption is that + the true sinus rate never doubles instantaneously. */ + while (map2(in_ann.anntyp) != NORMAL || + in_ann.time < next) /* get input annot if needed */ + getnormal(&in_ann); + + /* From the previous RR intervals, choose the best predictor. */ + for (i = n, bestpe = 99999., worst = 0.; i > 0; i--) { + if (rr[i] > 0 && + (pe[i] += (fabs(rr[i]-rr[0])-pe[i])/20.) <= bestpe) { + bestpe = pe[i]; + best = i; + } /* find best predicting interval */ + if (pe[i] >= worstpe) { + worstpe = pe[i]; + worst = i; + } + rr[i] = rr[i-1]; /* shift RR buffer */ + } + + /* Define the current RR interval as the difference between the time + of the current normal beat and the time of the most recently + written output (beat) annotation. */ + rr[0] = in_ann.time - out_ann.time; + + /* If the predictor array is not yet full, just copy the input + annotation to the output (if it falls after `from'). */ + if (n < PBLEN-1) { + n++; + out_ann.anntyp = in_ann.anntyp; + in_ann.anntyp = NOTQRS; + if ((out_ann.time += rr[0]) > from) + putann(0, &out_ann); + continue; + } + + /* If the interval is long enough, search for a gap (corresponding + to a non-conducted P-wave, or, more likely, an undetected sinus + beat). */ + i = 0; /* expected number of RR intervals contained within rr[0] */ + if (rr[0] > rrmax) { + b = best; /* index of best predicting interval */ + rrsum = 0; /* sum of i predicted intervals */ + while (rr[0] > rrsum + rr[b]*alpha) { + rrsum += rr[b]; + if (--b <= 0) b = best; /* get next prediction index */ + i++; + } + } + if (i > 1) { /* gap found -- prepare to insert an annotation */ + rr[0] = (long)(0.5 + ((double)rr[0]*rr[best])/(double)rrsum); + out_ann.anntyp = UNKNOWN; + } + else { /* no gap -- prepare to copy the input annotation */ + out_ann.anntyp = in_ann.anntyp; + in_ann.anntyp = NOTQRS; + } + + if ((out_ann.time += rr[0]) > from) + putann(0, &out_ann); /* emit an output annotation */ + + /* If rr[0] doesn't match the best predicting interval reasonably well, + adjust it to a weighted sum of the predicted and observed intervals. + The weighting heavily favors the prediction, on the assumption + that the observation is in error (or is unrepresentative of sinus + rhythm). */ + if (fabs(rr[best] - rr[0]) > rr[best]/10) + rr[0] = (9*rr[best] + rr[0])/10; + + /* Predict the time of the next sinus beat, if the best and worst + predictions are in reasonable agreement. */ + if (fabs(rr[best] - rr[worst]) < rr[best]/8) + next = out_ann.time + + (rr[best-1] < sps) ? (19*rr[best-1])/20 : 19*sps/20; + } +} + +getnormal(ap) +WFDB_Annotation *ap; +{ + do { + if (getann(0, ap) < 0) { + wfdbquit(); + exit(0); + } + } while (map2(ap->anntyp) != NORMAL); +} + +char *prog_name(s) +char *s; +{ + char *p = s + strlen(s); + +#ifdef MSDOS + while (p >= s && *p != '\\' && *p != ':') { + if (*p == '.') + *p = '\0'; /* strip off extension */ + if ('A' <= *p && *p <= 'Z') + *p += 'a' - 'A'; /* convert to lower case */ + p--; + } +#else + while (p >= s && *p != '/') + p--; +#endif + return (p+1); +} + +static char *help_strings[] = { + "usage: %s -r RECORD -a ANNOTATOR [OPTIONS ...]\n", + "where RECORD and ANNOTATOR specify the input, and OPTIONS may include:", + " -f TIME start at specified TIME", + " -h print this usage summary", + " -o OANN write output as annotator OANN (default: nguess)", + " -t TIME stop at specified TIME", + "The output contains copies of all N annotations, with additional Q", + "annotations inserted at the inferred locations of missing N (sinus) beats.", +NULL +}; + +void help() +{ + int i; + + (void)fprintf(stderr, help_strings[0], pname); + for (i = 1; help_strings[i] != NULL; i++) { + (void)fprintf(stderr, "%s\n", help_strings[i]); + if (i % 23 == 0) { + char b[5]; + (void)fprintf(stderr, "--More--"); + (void)fgets(b, 5, stdin); + (void)fprintf(stderr, "\033[A\033[2K"); /* erase "--More--"; + assumes ANSI terminal */ + } + } +} diff -Naur wfdb-10.3.1/app/snip.c wfdb-10.3.2/app/snip.c --- wfdb-10.3.1/app/snip.c Thu Nov 14 17:32:48 2002 +++ wfdb-10.3.2/app/snip.c Fri Feb 7 18:04:34 2003 @@ -1,8 +1,8 @@ /* file: snip.c G. Moody 30 July 1989 - Last revised: 14 November 2002 + Last revised: 7 February 2003 ------------------------------------------------------------------------------- snip: Copy an excerpt of a database record -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -59,8 +59,8 @@ a = i; do { nann++; - } while (i < argc && *argv[++i] != '-'); - i--; + } while (++i < argc && *argv[i] != '-'); + if (i < argc) i--; break; case 'f': /* starting time */ if (++i >= argc) { diff -Naur wfdb-10.3.1/app/xform.c wfdb-10.3.2/app/xform.c --- wfdb-10.3.1/app/xform.c Thu Nov 14 19:17:33 2002 +++ wfdb-10.3.2/app/xform.c Thu Feb 13 13:23:49 2003 @@ -975,7 +975,7 @@ int x, y; { while (x != y) { - if (x > y) x-=y; + if (x > y) x -= y; else y -= x; } return (x); diff -Naur wfdb-10.3.1/checkpkg/Makefile wfdb-10.3.2/checkpkg/Makefile --- wfdb-10.3.1/checkpkg/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/checkpkg/Makefile Mon Feb 24 00:53:28 2003 @@ -31,12 +31,12 @@ # directory). To print a set of source listings, type `make listing'. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -48,18 +48,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -106,7 +106,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. diff -Naur wfdb-10.3.1/checkpkg/appcheck wfdb-10.3.2/checkpkg/appcheck --- wfdb-10.3.1/checkpkg/appcheck Thu Dec 5 02:57:00 2002 +++ wfdb-10.3.2/checkpkg/appcheck Sun Feb 23 15:38:57 2003 @@ -1,6 +1,6 @@ #!/bin/sh # file: appcheck G. Moody 7 September 2001 -# Last revised: 5 December 2002 +# Last revised: 23 February 2003 # # This script checks the functionality of the WFDB applications in the 'app' # directory. @@ -225,6 +225,31 @@ TESTS=`expr $TESTS + 1` done +echo Testing mrgann ... +F=100s.mrg +cp expected/100s.qrs expected/100s.wqrs . +mrgann -r 100s -i qrs wqrs -o mrg -m0 10 -m1 20 -m2 30 -m3 40 +if ( ./checkfile $F ) +then + PASS=`expr $PASS + 1` + rm -f $F 100s.qrs 100s.wqrs +else + FAIL=`expr $FAIL + 1` +fi +TESTS=`expr $TESTS + 1` + +echo Testing nguess ... +F=100a.nguess +nguess -r 100a -a atr +if ( ./checkfile $F ) +then + PASS=`expr $PASS + 1` + rm -f $F +else + FAIL=`expr $FAIL + 1` +fi +TESTS=`expr $TESTS + 1` + echo Testing pschart ... F=pschart.ps pschart -a atr -c "" -g -l -T Test - >$F <wabp.log +if ( ./checkfile $F ) +then + PASS=`expr $PASS + 1` + rm -f $F wabp.log xform.dat xform.hea +else + FAIL=`expr $FAIL + 1` +fi +TESTS=`expr $TESTS + 1` + echo Testing wqrs ... F=100s.wqrs wqrs -r 100s -j 2>wqrs.log @@ -432,14 +470,12 @@ calsig epicmp -mrgann mxm nst plotstm pscgen skewedit sqrs125 -wabp EOF diff -Naur wfdb-10.3.1/checkpkg/expected/100a.nguess wfdb-10.3.2/checkpkg/expected/100a.nguess --- wfdb-10.3.1/checkpkg/expected/100a.nguess Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/checkpkg/expected/100a.nguess Sun Feb 23 14:18:41 2003 @@ -0,0 +1,13 @@ +M%$&Q0$.4(*((9($&*0" 5/)!-'0=(!$-+)$#/,+"41(&$2,$!/)$  &5++)++(%51$$)13# !&-'*%(7+!'+.''%-( ++7(! %1))*'1#''""$( +'$**! '-. !,1."%'*")50&'$$18%*++2%'/6,5,.+!$)#) /.+%#,1-#.50.-%"-3.+ !#*0-*0'1#$'7. "%*/.4(0*($$'*5 ""$ %)*') !,4+&)')-0*+"*)1" $    00&+,:60"",60 '% "! +5 !úúÿý øþù +ýý! (&""%) ÿúû +ÿ $   %' ) ý  ñôûþ÷øúùõ    ÿý  %,"&&"5!) '# ,   ÿ  &/%" )>5#! '3.&1+-#$/0&#%& "$  + 0-#/$#"")   #"*& %,&#%&"$)+  "*"   ý ÷ýÿ  ÿ '  + $,. #+#) /2!  )ü  û  #""$)(#"0+#)%($!2$)($  * 3(5#./($ '%'"" ..!)&0(*!&# -+((2$ &.%%'5.)/%$( 5þ.0.#50+ & !' 5-;,# %(.%&"5'%# 5>- %+$13*1:(- 23/ ""$#/-/%04'1%"55.! $',1'&,."# 1.3$ '01"$%&("3'# 53100#.4* 5&-'"(*#*3*'"(2*  !$ $  !&$  $46#(,7%-0( !)0$!1 /$  /!! 5(1/,$$!* "&+  ")-"+,$,$!*4*)!(51)!),)'1($$ 5"/)&%*"00,&'(/& %'&""".-&(,0"#20%%"$2(#&/%&!!*$",-$55*1)'/)".*0.&5*1,'+,"5.) %53+/.'%("68( (')5/8.*-5.("%0*%/03" *40(! #'3."5(',-* -/'5$$.5(" %,3*8/(),//*!'//*) ,3.1$*:)& ""'60 '3)&)$-*-,*("!*:/ &(+.;(#./.+%',1(&#$*(* 5. './**/)&/1*$#-.'"(/0(!,0,),!!63"!''06#/2(/('+4&  :1&5(.0-,$#*94& ##'.2!..2*&#'-6+"%'/%' *5+)%112)+*,(,6/(##&.11%,5,.*&##9-!'&42 /)"-!#12'!!%,.*'&)!54+" !,#5 52+*'(4.!!$%#2.6 ,!505$#!/7,&"-/(5"#++)#û@, + úö  +%%!%!5(3"$ .2' + ÿÿýöëù   +   07&%*)# + !"#(#!#&"2$!&+#**$/& +#!  )%5ÿ  +  ÿ"#&&1%&2*'"-*   üö õþüú \ No newline at end of file diff -Naur wfdb-10.3.1/checkpkg/expected/100s.mrg wfdb-10.3.2/checkpkg/expected/100s.mrg --- wfdb-10.3.1/checkpkg/expected/100s.mrg Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/checkpkg/expected/100s.mrg Sun Feb 23 15:42:51 2003 @@ -0,0 +1,4 @@ +ìÕ#'*0! 5(            ý   +      +  ý      ý  ÿ           +  \ No newline at end of file diff -Naur wfdb-10.3.1/checkpkg/expected/100s.wqrs wfdb-10.3.2/checkpkg/expected/100s.wqrs --- wfdb-10.3.1/checkpkg/expected/100s.wqrs Fri Nov 22 23:22:13 2002 +++ wfdb-10.3.2/checkpkg/expected/100s.wqrs Mon Dec 16 21:28:34 2002 @@ -1,4 +1,4 @@ -=          Ð L     û                û     +>          Ð L     û                û         ü                ý           ý      ý  ÿ           diff -Naur wfdb-10.3.1/checkpkg/expected/xform.wabp wfdb-10.3.2/checkpkg/expected/xform.wabp --- wfdb-10.3.1/checkpkg/expected/xform.wabp Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/checkpkg/expected/xform.wabp Sun Feb 23 15:29:48 2003 @@ -0,0 +1 @@ +øbchjjigjXxÚž`e]ad`cded_ee`ddbdebedddfeefddfcfhŠ=O‚dedbbZneaffdfellgggeee \ No newline at end of file diff -Naur wfdb-10.3.1/conf/cygwin.def wfdb-10.3.2/conf/cygwin.def --- wfdb-10.3.1/conf/cygwin.def Thu Nov 21 21:42:46 2002 +++ wfdb-10.3.2/conf/cygwin.def Wed Dec 18 14:33:17 2002 @@ -1,5 +1,5 @@ # file: cygwin.def G. Moody 6 June 2000 -# Last revised: 21 November 2002 +# Last revised: 18 December 2002 # # This file contains default 'make' definitions for compiling the WFDB Software # Package under MS Windows using the free Cygwin/gcc ANSI C compiler, available @@ -58,7 +58,7 @@ # PSPDIR specifies the name of a directory in which to install the PostScript # prolog (*.pro) files from the 'app' directory. -PSPDIR = $(WFDBROOT)/lib/ps +PSPDIR = /usr/lib/ps # CC is the name of your C compiler. The WFDB library can be compiled with K&R # C compilers (`cc' on most if not all UNIX systems) as well as with ANSI C diff -Naur wfdb-10.3.1/conf/darwin.def wfdb-10.3.2/conf/darwin.def --- wfdb-10.3.1/conf/darwin.def Thu Nov 21 21:11:38 2002 +++ wfdb-10.3.2/conf/darwin.def Wed Dec 18 14:31:44 2002 @@ -1,5 +1,5 @@ # file: darwin.def G. Moody and I. Henry 14 November 2002 -# Last revised: 21 November 2002 +# Last revised: 18 December 2002 # 'make' definitions for compiling the WFDB Software Package under Darwin # # Based on 'freebsd.def'. @@ -56,7 +56,7 @@ # PSPDIR specifies the name of a directory in which to install the PostScript # prolog (*.pro) files from the 'app' directory. -PSPDIR = $(WFDBROOT)/lib/ps +PSPDIR = /usr/lib/ps # CC is the name of your C compiler. CC = gcc diff -Naur wfdb-10.3.1/conf/freebsd.def wfdb-10.3.2/conf/freebsd.def --- wfdb-10.3.1/conf/freebsd.def Thu Nov 21 20:17:29 2002 +++ wfdb-10.3.2/conf/freebsd.def Wed Dec 18 14:32:10 2002 @@ -1,5 +1,5 @@ # file: freebsd.def G. Moody 5 March 2002 -# Last revised: 21 November 2002 +# Last revised: 18 December 2002 # 'make' definitions for compiling the WFDB Software Package under FreeBSD # # Based on 'linux.def', with edits for FreeBSD thanks to Giuseppe Pagnoni. @@ -56,7 +56,7 @@ # PSPDIR specifies the name of a directory in which to install the PostScript # prolog (*.pro) files from the 'app' directory. -PSPDIR = $(WFDBROOT)/lib/ps +PSPDIR = /usr/lib/ps # CC is the name of your C compiler. CC = gcc diff -Naur wfdb-10.3.1/conf/generic.def wfdb-10.3.2/conf/generic.def --- wfdb-10.3.1/conf/generic.def Thu Nov 21 20:18:21 2002 +++ wfdb-10.3.2/conf/generic.def Wed Dec 18 14:32:29 2002 @@ -1,5 +1,5 @@ # file: generic.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 18 December 2002 # This file contains default 'make' definitions for compiling the WFDB Software # Package under versions of UNIX that are not otherwise recognized by # 'configure'. @@ -70,7 +70,7 @@ # PSPDIR specifies the name of a directory in which to install the PostScript # prolog (*.pro) files from the 'app' directory. -PSPDIR = $(WFDBROOT)/lib/ps +PSPDIR = /usr/lib/ps # CC is the name of your C compiler. The WFDB library can be compiled with K&R # C compilers (`cc' on most if not all UNIX systems) as well as with ANSI C diff -Naur wfdb-10.3.1/conf/hpux.def wfdb-10.3.2/conf/hpux.def --- wfdb-10.3.1/conf/hpux.def Thu Nov 21 20:19:39 2002 +++ wfdb-10.3.2/conf/hpux.def Wed Dec 18 14:33:39 2002 @@ -1,5 +1,5 @@ # file: hpux.def G. Moody 31 May 2000 -# Last revised: 21 November 2001 +# Last revised: 18 December 2001 # 'make' definitions for compiling the WFDB library under HP-UX # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -62,7 +62,7 @@ # PSPDIR specifies the name of a directory in which to install the PostScript # prolog (*.pro) files from the 'app' directory. -PSPDIR = $(WFDBROOT)/lib/ps +PSPDIR = /usr/lib/ps # CC is the name of your C compiler. CC = gcc diff -Naur wfdb-10.3.1/conf/linux-slib.def wfdb-10.3.2/conf/linux-slib.def --- wfdb-10.3.1/conf/linux-slib.def Thu Nov 21 21:41:44 2002 +++ wfdb-10.3.2/conf/linux-slib.def Tue Dec 17 15:55:52 2002 @@ -100,8 +100,8 @@ # `make lib-post-install' should be run after installing the WFDB library. lib-post-install: - cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_BASENAME) - cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_SONAME) + -(cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_SONAME)) + -(cd $(LIBDIR); ln -sf $(WFDBLIB_SONAME) $(WFDBLIB_BASENAME)) @$(LDCONFIG) || echo Warning: "$(LDCONFIG)" was unsuccessful lib-post-uninstall: diff -Naur wfdb-10.3.1/conf/linux.def wfdb-10.3.2/conf/linux.def --- wfdb-10.3.1/conf/linux.def Thu Nov 21 20:14:38 2002 +++ wfdb-10.3.2/conf/linux.def Sun Feb 23 22:54:19 2003 @@ -1,5 +1,5 @@ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -46,7 +46,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. diff -Naur wfdb-10.3.1/conf/solaris.def wfdb-10.3.2/conf/solaris.def --- wfdb-10.3.1/conf/solaris.def Thu Nov 21 20:16:15 2002 +++ wfdb-10.3.2/conf/solaris.def Wed Dec 18 14:34:11 2002 @@ -1,5 +1,5 @@ # file: solaris.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 18 December 2002 # 'make' definitions for compiling the WFDB Software Package under Solaris # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -59,7 +59,7 @@ # PSPDIR specifies the name of a directory in which to install the PostScript # prolog (*.pro) files from the 'app' directory. -PSPDIR = $(WFDBROOT)/lib/ps +PSPDIR = /usr/lib/ps # CC is the name of your C compiler. CC = gcc diff -Naur wfdb-10.3.1/conf/version.def wfdb-10.3.2/conf/version.def --- wfdb-10.3.1/conf/version.def Thu Dec 5 02:57:20 2002 +++ wfdb-10.3.2/conf/version.def Sun Feb 23 11:42:48 2003 @@ -1,10 +1,10 @@ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -16,6 +16,6 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ diff -Naur wfdb-10.3.1/configure wfdb-10.3.2/configure --- wfdb-10.3.1/configure Mon Nov 25 10:11:41 2002 +++ wfdb-10.3.2/configure Wed Dec 18 14:47:50 2002 @@ -1,6 +1,6 @@ #! /bin/sh # file: configure G. Moody 24 May 2000 -# Last revised: 25 November 2002 +# Last revised: 18 December 2002 # Configuration script for the WFDB Software Package # This script was not generated using 'autoconf'. If you can implement @@ -229,8 +229,7 @@ mv conf/site.tmp conf/site.def sed "s/LWC = libwww-config/LWC = :/" conf/site.tmp mv conf/site.tmp conf/site-slib.def - sed "s/WFDB_NETFILES 1/WFDB_NETFILES 0/" lib/wfdb.tmp - mv lib/wfdb.tmp lib/wfdb.h + sed "s/WFDB_NETFILES 1/WFDB_NETFILES 0/" lib/wfdb.h WITHNF=without else echo "The WFDB software will be compiled with NETFILES access." @@ -244,8 +243,7 @@ fi sed "s/LWC = :/LWC = libwww-config/" conf/site.tmp mv conf/site.tmp conf/site-slib.def - sed "s/WFDB_NETFILES 0/WFDB_NETFILES 1/" lib/wfdb.temp - mv lib/wfdb.temp lib/wfdb.h + sed "s/WFDB_NETFILES 0/WFDB_NETFILES 1/" lib/wfdb.h WITHNF=with fi diff -Naur wfdb-10.3.1/convert/Makefile wfdb-10.3.2/convert/Makefile --- wfdb-10.3.1/convert/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/convert/Makefile Mon Feb 24 00:53:28 2003 @@ -33,12 +33,12 @@ # type `make listing'. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -50,18 +50,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -108,7 +108,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -216,12 +216,12 @@ echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 5 November 2002 +# Last revised: 12 February 2003 # This section of the Makefile should not need to be changed. CFILES = a2m.c ad2m.c m2a.c md2a.c readid.c makeid.c edf2mit.c mit2edf.c \ - revise.c -XFILES = a2m ad2m m2a md2a readid makeid edf2mit mit2edf revise + wav2mit.c mit2wav.c revise.c +XFILES = a2m ad2m m2a md2a readid makeid edf2mit mit2edf wav2mit mit2wav revise SCRIPTS = ahaconvert MFILES = Makefile Makefile.dos diff -Naur wfdb-10.3.1/convert/Makefile.tpl wfdb-10.3.2/convert/Makefile.tpl --- wfdb-10.3.1/convert/Makefile.tpl Tue Nov 5 12:33:44 2002 +++ wfdb-10.3.2/convert/Makefile.tpl Wed Feb 12 15:19:27 2003 @@ -1,10 +1,10 @@ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 5 November 2002 +# Last revised: 12 February 2003 # This section of the Makefile should not need to be changed. CFILES = a2m.c ad2m.c m2a.c md2a.c readid.c makeid.c edf2mit.c mit2edf.c \ - revise.c -XFILES = a2m ad2m m2a md2a readid makeid edf2mit mit2edf revise + wav2mit.c mit2wav.c revise.c +XFILES = a2m ad2m m2a md2a readid makeid edf2mit mit2edf wav2mit mit2wav revise SCRIPTS = ahaconvert MFILES = Makefile Makefile.dos diff -Naur wfdb-10.3.1/convert/edf2mit.c wfdb-10.3.2/convert/edf2mit.c --- wfdb-10.3.1/convert/edf2mit.c Wed Dec 4 12:21:12 2002 +++ wfdb-10.3.2/convert/edf2mit.c Thu Feb 13 17:03:37 2003 @@ -1,9 +1,9 @@ /* file: edf2mit.c G. Moody 16 October 1996 - Last revised: 4 December 2002 + Last revised: 13 February 2003 ------------------------------------------------------------------------------- Convert EDF (European Data Format) file to MIT format header and signal files -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -35,10 +35,10 @@ char **argv; { char buf[81], record[WFDB_MAXRNL+1], **vi, **vin; - double *sigpmax, *sigpmin, *sampfreq, spr, sps; + double *sigpmax, *sigpmin, *sampfreq, spr, sps, gcd(); FILE *ifile = NULL; int big_endian = 0, fpb, h, i, j, k, l, nsig, nosig = 0, *siglist = NULL, - *spb, tspb = 0, tspf = 0, vflag = 0, + *spb, tspb = 0, ispf = 0, tspf = 0, vflag = 0, day, month, year, hour, minute, second; long adcrange, *sigdmax, *sigdmin; WFDB_Sample *vo, *vout; @@ -118,7 +118,16 @@ help(); exit(1); } + fread(buf, 1, 8, ifile); + /* Check to see that the input is an EDF file. (This check will detect + up most but not all other types of files.) */ + if (strncmp(buf, "0 ", 8)) { + (void)fprintf(stderr, + "%s: input does not appear to be EDF -- no conversion attempted.\n", + pname); + exit(2); + } buf[8] = ' '; for (j = 8; j >= 0 && buf[j] == ' '; j--) buf[j] = '\0'; @@ -207,6 +216,16 @@ for ( ; nosig < nsig; nosig++) siglist[nosig] = nosig; } + else { + for (i = 0; i < nosig; i++) { + if (siglist[i] < 0 || siglist[i] >= nsig) { + fprintf(stderr, + "%s: invalid signal number, %d, in signal list\n", + pname, siglist[i]); + exit(1); + } + } + } if ((so = malloc(nosig * sizeof(WFDB_Siginfo))) == NULL) { fprintf(stderr, "%s: insufficient memory\n", pname); @@ -231,7 +250,7 @@ if (vflag && j > 0) printf("Signal %d transducer type: '%s'\n", i, buf); } - + for (i = 0; i < nsig; i++) { fread(buf, 1, 8, ifile); buf[8] = ' '; @@ -324,16 +343,12 @@ printf("Signal %d free space: '%s'\n", i, buf); } - /* Determine the base sampling frequency (the lowest sampling frequency for - any signal in the signal list) */ - sps = 0; - for (i = 0; i < nosig; i++) - if (sampfreq[siglist[i]] > sps) sps = sampfreq[siglist[i]]; - for (i = 0; i < nosig; i++) - if (sampfreq[siglist[i]] <= sps) { - sps = sampfreq[siglist[i]]; - fpb = spb[siglist[i]]; - } + /* Determine the base sampling frequency (the greatest common divisor of + all sampling frequencies for the signals in the signal list) */ + sps = sampfreq[siglist[0]]; + for (i = 1; i < nosig; i++) + if (sampfreq[siglist[i]] != sps) + sps = gcd(sps, sampfreq[siglist[i]]); setsampfreq(sps); sprintf(buf, "%02d:%02d:%02d %02d/%02d/%04d", @@ -348,6 +363,10 @@ so[i] = si[siglist[i]]; } + for (i = ispf = 0; i < nsig; i++) + ispf += (int)(sampfreq[i]/sps + 0.5); + fpb = spb[siglist[0]] / si[siglist[0]].spf; + if (vflag) printf("\nOUTPUT:\nBase sampling frequency: %g Hz\n", sps); @@ -361,30 +380,29 @@ } vin = (char **)malloc(nsig * sizeof(char *)); - vi = (char **)malloc(nsig * sizeof(char *)); + vi = (char **)malloc(nosig * sizeof(char *)); for (i = 0; i < nsig; i++) { vin[i] = (char *)malloc(spb[i] * 2); } vout = (WFDB_Sample *)malloc(tspf * sizeof(WFDB_Sample)); - osigfopen(so, nosig); while (1) { for (i = 0; i < nsig; i++) j = fread(vin[i], 2, spb[i], ifile); if (j == 0) break; for (j = 0; j < nosig; j++) - vi[siglist[j]] = vin[siglist[j]]; + vi[j] = vin[siglist[j]]; for (i = 0; i < fpb; i++) { vo = vout; for (j = 0; j < nosig; j++) for (k = 0; k < so[j].spf; k++) { if (big_endian) { - h = *vi[siglist[j]]++; /* high byte first */ - l = *vi[siglist[j]]++; /* then low byte */ + h = *vi[j]++; /* high byte first */ + l = *vi[j]++; /* then low byte */ } else { - l = *vi[siglist[j]]++; /* low byte first */ - h = *vi[siglist[j]]++; /* then high byte */ + l = *vi[j]++; /* low byte first */ + h = *vi[j]++; /* then high byte */ } /* If a short int is not 16 bits, it may be necessary to modify the next line for proper sign extension. */ @@ -397,6 +415,26 @@ newheader(record); wfdbquit(); + exit(0); +} + +/* Calculate the greatest common divisor of x and y. This function uses + Euclid's algorithm, modified so that an exact answer is not required if the + (possibly non-integral) arguments do not have a common divisor that can be + represented exactly. */ +double gcd(x, y) +double x, y; +{ + double tol; + + if (x > y) tol = 0.001*y; + else tol = 0.001*x; + + while (1) { + if (x > y && x-y > tol) x -= y; + else if (y > x && y-x > tol) y -= x; + else return (x); + } } static char *help_strings[] = { diff -Naur wfdb-10.3.1/convert/mit2edf.c wfdb-10.3.2/convert/mit2edf.c --- wfdb-10.3.1/convert/mit2edf.c Wed Dec 4 12:49:07 2002 +++ wfdb-10.3.2/convert/mit2edf.c Thu Dec 5 21:37:25 2002 @@ -1,5 +1,5 @@ /* file: mit2edf.c G. Moody 2 November 2002 - Last revised: 4 December 2002 + Last revised: 5 December 2002 ------------------------------------------------------------------------------- Convert MIT format header and signal files to EDF (European Data Format) file Copyright (C) 2002 George B. Moody @@ -81,6 +81,12 @@ } } + /* Quit if no record was specified. */ + if (record == NULL) { + help(); + exit(1); + } + /* Construct or validate the name of the output file. */ if (ofname == NULL) { for (p = record + strlen(record); p > record; p--) @@ -102,10 +108,6 @@ } /* Open the input record. */ - if (record == NULL) { - help(); - exit(1); - } if ((nsig = isigopen(record, NULL, 0)) <= 0) exit(2); if ((si = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL) { (void)fprintf(stderr, "%s: insufficient memory\n", pname); diff -Naur wfdb-10.3.1/convert/mit2wav.c wfdb-10.3.2/convert/mit2wav.c --- wfdb-10.3.1/convert/mit2wav.c Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/convert/mit2wav.c Wed Feb 12 13:21:05 2003 @@ -0,0 +1,359 @@ +/* file: mit2wav.c G. Moody 12 February 2003 + +------------------------------------------------------------------------------- +mit2wav: Convert WFDB format signal file(s) to .wav format +Copyright (C) 2003 George B. Moody + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA. + +You may contact the author by e-mail (george@mit.edu) or postal mail +(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, +please visit PhysioNet (http://www.physionet.org/). +_______________________________________________________________________________ + +This program converts a WFDB record into .wav format (format 16, multiplexed +signals, with embedded header information). Use 'wav2mit' to perform the +reverse conversion. + +You may be able to use this program's output to create analog signals by +playing the .wav file through a sound card, but you should be aware of the +following potential pitfalls: + +* Your sound card, and the software that comes with it, may not be able to + play .wav files containing three or more signals. If this is a problem, + you will need to extract one or two signals to include in the .wav file + from your original recording (for example, using 'xform'). + +* Your sound card and its software may be unable to play .wav files at other + than certain fixed sampling frequencies (typically 11025, 22050, and 44100 + Hz). If this is a problem, you will need to resample the input at one of + the frequencies supported by your sound card (for example, using 'xform') + before converting it to .wav format using this program. + +* Your sound card may not be able to reproduce the frequencies present in + the input. This is *very* likely if you are trying to recreate physiologic + signals such as ECGs (with most of the useful information in the 0.1 to 30 + Hz band) using a consumer sound card (which probably does not reproduce + frequencies below the lower limit of human hearing (around 30 Hz). One + possible solution to this problem is to create a digital signal containing + a higher-frequency carrier signal, amplitude-modulated by the signal of + interest, and to convert this AM signal into a .wav file; on playback, + an analog AM demodulator would then recover the original low-frequency + signal of interest. If you successfully implement this solution, please + send details to the author (george@mit.edu). + + If the output contains 2, 3, 4, or 6 signals, and you play it through a + sound card with at least that many outputs, the association between the + digital inputs and the analog outputs is as follows: + + signals input output + 2 0 left + 1 right + + 3 0 left + 1 right + 2 center + + 4 0 front left -or- left + 1 front right center + 2 rear left right + 3 rear right surround + + 6 0 left + 1 left center + 2 center + 3 right center + 4 right + 5 surround + +Output files created by this program always have exactly three chunks (a header +chunk, a format chunk, and a data chunk). Files created by other software in +.wav format may include additional chunks. In .wav files, binary data are +always written in little-endian format (least significant byte first). The +format of mit2wav's output files is as follows: + +[Header chunk] +Bytes 0 - 3: "RIFF" [4 ASCII characters] +Bytes 4 - 7: L-8 (number of bytes to follow in the file, excluding bytes 0-7) +Bytes 8 - 11: "WAVE" [4 ASCII characters] + +[Format chunk] +Bytes 12 - 15: "fmt " [4 ASCII characters, note trailing space] +Bytes 16 - 19: 16 (format chunk length in bytes, excluding bytes 12-19) +Bytes 20 - 35: format specification, consisting of: + Bytes 20 - 21: 1 (format tag, indicating no compression is used) + Bytes 22 - 23: number of signals (1 - 65535) + Bytes 24 - 27: sampling frequency in Hz (per signal) + Note that the sampling frequency in a .wav file must be an + integer multiple of 1 Hz, a restriction that is not imposed + by MIT (WFDB) format. + Bytes 28 - 31: bytes per second (sampling frequency * frame size in bytes) + Bytes 32 - 33: frame size in bytes + Bytes 34 - 35: bits per sample (ADC resolution in bits) + Note that the actual ADC resolution (e.g., 12) is written in + this field, although each output sample is right-padded to fill + a full (16-bit) word. (.wav format allows for 8, 16, 24, and + 32 bits per sample; all mit2wav output is 16 bits per sample.) + +[Data chunk] +Bytes 36 - 39: "data" [4 ASCII characters] +Bytes 40 - 43: L-44 (number of bytes to follow in the data chunk) +Bytes 44 - L-1: sample data, consisting of: + Bytes 44 - 45: sample 0, channel 0 + Bytes 46 - 47: sample 0, channel 1 + ... etc. (same order as in a multiplexed WFDB signal file) + +*/ + +#include +#include +#ifdef NOMKSTEMP +#define mkstemp mktemp +#endif + +char *pname; /* name of this program, for use in error messages */ +FILE *ofile; /* output (.wav) file pointer */ + +int out16(short); +int out32(long); +char *prog_name(char *); +void help(void); + +main(int argc, char **argv) +{ + char buf[80], *nrec = NULL, *ofname, *record = NULL, tfname[10]; + double sps; + FILE *sfile; + int bitspersample, bytespersecond, framelen, i, mag, nsig, *offset, *shift; + long nsamp; + static WFDB_Sample *x, *y; + static WFDB_Siginfo *s; + + /* Interpret the command line. */ + pname = prog_name(argv[0]); + for (i = 1; i < argc; i++) { + if (*argv[i] == '-') switch (*(argv[i]+1)) { + case 'h': /* help requested */ + help(); + exit(1); + break; + case 'n': /* new record name follows */ + if (++i >= argc) { + (void)fprintf(stderr, + "%s: new record name must follow -n\n", pname); + exit(1); + } + nrec = argv[i]; + break; + case 'o': /* output file name follows */ + if (++i >= argc) { + (void)fprintf(stderr, + "%s: name of wav-format output file must follow -o\n", + pname); + exit(1); + } + ofname = argv[i]; + if (strlen(ofname)<5 || strcmp(".wav", ofname+strlen(ofname)-4)) { + (void)fprintf(stderr, + "%s: name of output file must end in '.wav'\n", + pname); + exit(1); + } + break; + case 'r': + if (++i >= argc) { + (void)fprintf(stderr, + "%s: record name must follow -r\n", pname); + exit(1); + } + record = argv[i]; + break; + default: + (void)fprintf(stderr, "%s: unrecognized option %s\n", pname, + argv[i]); + exit(1); + } + else { + (void)fprintf(stderr, "%s: unrecognized argument %s\n", pname, + argv[i]); + exit(1); + } + } + + /* Check that required arguments are present and valid. */ + if (ofname == NULL || record == NULL) { + help(); + exit(1); + } + if (nrec && strcmp(record, nrec) == 0) { + (void)fprintf(stderr, + "%s: names of input and output records must not be identical\n", + pname); + exit(1); + } + + /* Open the input record and allocate memory for per-signal objects. */ + if ((nsig = isigopen(record, NULL, 0)) <= 0) exit(2); + if ((s = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL || + (offset = malloc(nsig * sizeof(int))) == NULL || + (shift = malloc(nsig * sizeof(int))) == NULL || + (x = malloc(nsig * sizeof(WFDB_Sample))) == NULL || + (y = malloc(nsig * sizeof(WFDB_Sample))) == NULL) { + (void)fprintf(stderr, "%s: insufficient memory\n", pname); + exit(2); + } + if ((nsig = isigopen(record, s, nsig)) <= 0) + exit(3); + + /* Check that the new record name is legal before proceeding. Note that + this step creates a header file, which is overwritten after the + processing is completed. */ + if (nrec != NULL && newheader(nrec) < 0) exit(3); + + /* Set the output signal parameters. */ + for (i = 0; i < nsig; i++) { + if (s[i].adcres > bitspersample) bitspersample = s[i].adcres; + offset[i] = s[i].adczero; + s[i].adczero = 0; + shift[i] = 16 - s[i].adcres; + s[i].adcres = 16; + mag = 1 << shift[i]; + s[i].gain *= mag; + s[i].baseline -= offset[i]; + s[i].baseline *= mag; + s[i].fname = ofname; + s[i].group = 0; + s[i].fmt = 16; + } + + /* Get information needed for the header and format chunks. */ + nsamp = strtim("e"); + sps = strtim("1"); + framelen = nsig * 2; + bytespersecond = sps * framelen; + + /* Give up if the output cannot be written. */ + if (osigfopen(s, (unsigned)nsig) < nsig) exit(4); + + for (i = 0; i < nsig; i++) + wfdbsetstart(i, 44L); + + /* Create a temporary file for use below. */ + (void)strcpy(tfname, "wavXXXXXX"); + (void)mkstemp(tfname); + if ((ofile = fopen(tfname, "wb")) == NULL) { + (void)fprintf(stderr, "%s: can't create temporary file %s\n", tfname); + exit(1); + } + + /* Write the header and format chunks, and the first 8 bytes of the + data chunk, to the temporary file. */ + if (fwrite("RIFF", 1, 4, ofile) != 4) { + fprintf(stderr, "%s: can't write to %s\n", ofname); + exit(2); + } + out32(nsamp*framelen + 36); /* nsamp*framelen sample bytes, and 36 more + bytes of miscellaneous embedded header */ + fwrite("WAVEfmt ", 1, 8, ofile); + out32(16); /* number of bytes to follow in format chunk */ + out16(1); /* format tag */ + out16(nsig); + out32(sps); + out32(sps*framelen); + out16(framelen); + out16(bitspersample); + fwrite("data", 1, 4, ofile); + out32(nsamp*framelen); + fclose(ofile); + + /* Copy the input to the output. Reformatting is handled by putvec(). */ + while (getvec(x) == nsig) { + for (i = 0; i < nsig; i++) + y[i] = (x[i] - offset[i]) << shift[i]; + if (putvec(y) != nsig) + break; + } + + /* Write the new header file if requested. */ + if (nrec) (void)newheader(nrec); + + /* Clean up. */ + wfdbquit(); + + /* Prepend the temporary file to the new signal file. */ + sprintf(buf, "mv %s %s.1", ofname, ofname); + system(buf); + sprintf(buf, "cat %s %s.1 >%s", tfname, ofname, ofname); + system(buf); + sprintf(buf, "rm -f %s %s.1", tfname, ofname); + system(buf); + + exit(0); /*NOTREACHED*/ +} + +int out16(short x) +{ + if (putc(x & 0xff, ofile) == EOF || + putc((x >> 8) & 0xff, ofile) == EOF) + return (EOF); + return (2); +} + +int out32(long x) +{ + if (putc(x & 0xff, ofile) == EOF || + putc((x >> 8) & 0xff, ofile) == EOF || + putc((x >> 16) & 0xff, ofile) == EOF || + putc((x >> 24) & 0xff, ofile) == EOF) + return (EOF); + return (4); +} + +char *prog_name(char *s) +{ + char *p = s + strlen(s); + +#ifdef MSDOS + while (p >= s && *p != '\\' && *p != ':') { + if (*p == '.') + *p = '\0'; /* strip off extension */ + if ('A' <= *p && *p <= 'Z') + *p += 'a' - 'A'; /* convert to lower case */ + p--; + } +#else + while (p >= s && *p != '/') + p--; +#endif + return (p+1); +} + +static char *help_strings[] = { + "usage: %s -o FILE.wav -r RECORD [ OPTIONS ... ]\n", + "where FILE.wav is the name of the wav-format output signal file,", + "RECORD is the record name, and OPTIONS may include:", + " -h print this usage summary", + " -n NEWREC create a header file for the output signal file, so it", + " may be read as record NEWREC", + NULL +}; + +void help() +{ + int i; + + (void)fprintf(stderr, help_strings[0], pname); + for (i = 1; help_strings[i] != NULL; i++) + (void)fprintf(stderr, "%s\n", help_strings[i]); +} diff -Naur wfdb-10.3.1/convert/wav2mit.c wfdb-10.3.2/convert/wav2mit.c --- wfdb-10.3.1/convert/wav2mit.c Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/convert/wav2mit.c Wed Feb 12 15:27:50 2003 @@ -0,0 +1,323 @@ +/* file: wav2mit.c G. Moody 12 February 2003 + +------------------------------------------------------------------------------- +wav2mit: Convert a .wav format file to WFDB format +Copyright (C) 2003 George B. Moody + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA. + +You may contact the author by e-mail (george@mit.edu) or postal mail +(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, +please visit PhysioNet (http://www.physionet.org/). +_______________________________________________________________________________ + +Most .wav files are already written in a WFDB-compatible format. This program +simply creates a .hea (WFDB header) file that describes the .wav file; other +WFDB applications can then read the .wav file directly. + +This process may not work with some .wav files that are encoded using variants +of the original .wav format that are not WFDB-compatible. In principle, this +program should be able to recognize such files by their format codes, and it +will produce an error message in such cases. If the format code is incorrect, +however, 'wav2mit' may not recognize that an error has occurred. + +To perform the reverse conversion, use 'mit2wav'. + +Files that can be processed successfully using 'wav2mit' always have exactly +three chunks (a header chunk, a format chunk, and a data chunk). In .wav +files, binary data are always written in little-endian format (least +significant byte first). The format of wav2mit's input files is as follows: + +[Header chunk] +Bytes 0 - 3: "RIFF" [4 ASCII characters] +Bytes 4 - 7: L-8 (number of bytes to follow in the file, excluding bytes 0-7) +Bytes 8 - 11: "WAVE" [4 ASCII characters] + +[Format chunk] +Bytes 12 - 15: "fmt " [4 ASCII characters, note trailing space] +Bytes 16 - 19: 16 (format chunk length in bytes, excluding bytes 12-19) +Bytes 20 - 35: format specification, consisting of: + Bytes 20 - 21: 1 (format tag, indicating no compression is used) + Bytes 22 - 23: number of signals (1 - 65535) + Bytes 24 - 27: sampling frequency in Hz (per signal) + Note that the sampling frequency in a .wav file must be an + integer multiple of 1 Hz, a restriction that is not imposed + by MIT (WFDB) format. + Bytes 28 - 31: bytes per second (sampling frequency * frame size in bytes) + Bytes 32 - 33: frame size in bytes + Bytes 34 - 35: bits per sample (ADC resolution in bits) + Note that the actual ADC resolution (e.g., 12) is written in + this field, although each output sample is right-padded to fill + a full (16-bit) word. (.wav format allows for 8, 16, 24, and + 32 bits per sample; all mit2wav output is 16 bits per sample.) + +[Data chunk] +Bytes 36 - 39: "data" [4 ASCII characters] +Bytes 40 - 43: L-44 (number of bytes to follow in the data chunk) +Bytes 44 - L-1: sample data, consisting of: + Bytes 44 - 45: sample 0, channel 0 + Bytes 46 - 47: sample 0, channel 1 + ... etc. (same order as in a multiplexed WFDB signal file) + +*/ + +#include +#include + +char *pname; /* name of this program, for use in error messages */ +int errflag=0; /* non-zero if EOF reached in input file */ +FILE *ifile; /* input (.wav) file pointer */ + +short in16(void); +long in32(void); +char *prog_name(char *); +void help(void); + +main(int argc, char **argv) +{ + char buf[80], *ifname, *record = NULL; + double sps, wgain; + int bitspersample, bytespersecond, framelen, i, nsig, tag, wres; + long flen, len, wnsamp; + static WFDB_Siginfo *s; + + /* Interpret the command line. */ + pname = prog_name(argv[0]); + for (i = 1; i < argc; i++) { + if (*argv[i] == '-') switch (*(argv[i]+1)) { + case 'h': /* help requested */ + help(); + exit(1); + break; + case 'i': /* input file name follows */ + if (++i >= argc) { + (void)fprintf(stderr, + "%s: name of wav-format input file must follow -i\n", + pname); + exit(1); + } + ifname = argv[i]; + if (strlen(ifname)<5 || strcmp(".wav", ifname+strlen(ifname)-4)) { + (void)fprintf(stderr, + "%s: name of input file must end in '.wav'\n", + pname); + exit(1); + } + break; + case 'r': + if (++i >= argc) { + (void)fprintf(stderr, + "%s: record name must follow -r\n", pname); + exit(1); + } + record = argv[i]; + break; + default: + (void)fprintf(stderr, "%s: unrecognized option %s\n", pname, + argv[i]); + exit(1); + } + else { + (void)fprintf(stderr, "%s: unrecognized argument %s\n", pname, + argv[i]); + exit(1); + } + } + + /* Check that required arguments are present and valid. */ + if (ifname == NULL) { + help(); + exit(1); + } + + /* If the record name was not specified, generate it from ifname. */ + if (record == NULL) { + record = malloc(strlen(ifname)); + strncpy(record, ifname, strlen(ifname)-4); + record[strlen(ifname)-3] = '\0'; + } + + /* Open the input file. */ + if ((ifile = fopen(ifname, "rb")) == NULL) { + fprintf(stderr, "%s: can't open %s\n", pname, ifname); + exit(2); + } + + /* Determine the size of the input file. */ + fseek(ifile, 0L, SEEK_END); + flen = ftell(ifile); + fseek(ifile, 0L, SEEK_SET); + + /* Read and check the header chunk. */ + if (fread(buf, 1, 4, ifile) != 4 || + strncmp(buf, "RIFF", 4)) { + fprintf(stderr, "%s: %s is not a .wav-format file\n", pname, ifname); + exit(3); + } + len = in32() + 8; + if (len != flen) { + fprintf(stderr, + "%s: header chunk of %s has incorrect length (%ld, should be %ld)\n", + pname, ifname, len, flen); + exit(3); + } + if (fread(buf, 1, 4, ifile) != 4 || + strncmp(buf, "WAVE", 4)) { + fprintf(stderr, "%s: %s is not a .wav-format file\n", pname, ifname); + exit(3); + } + + /* Read and check the format chunk. */ + if (fread(buf, 1, 4, ifile) != 4 || + strncmp(buf, "fmt ", 4)) { + fprintf(stderr, "%s: format chunk missing or corrupt in %s\n", + pname, ifname); + exit(3); + } + len = in32(); + tag = in16(); + if (len != 16 || tag != 1) { + fprintf(stderr, "%s: unsupported format %d in %s\n", + pname, tag, ifname); + exit(3); + } + nsig = in16(); + sps = in32(); + bytespersecond = in32(); + framelen = in16(); + bitspersample = in16(); + if (bitspersample <= 8) { + wres = 8; + wgain = 12.5; + } + else if (bitspersample <= 16) { + wres = 16; + wgain = 6400; + } + else { + fprintf(stderr, "%s: unsupported resolution (%d bits/sample) in %s\n", + pname, bitspersample, ifname); + exit(3); + } + if (framelen != nsig * wres / 8) { + fprintf(stderr, "%s: format chunk of %s has incorrect frame length\n", + pname, ifname); + exit(3); + } + + /* Read and check the beginning of the data chunk. */ + if (fread(buf, 1, 4, ifile) != 4 || + strncmp(buf, "data", 4)) { + fprintf(stderr, "%s: data chunk missing or corrupt in %s\n", + pname, ifname); + exit(3); + } + len = in32(); + wnsamp = len / framelen; + + if ((s = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL) { + (void)fprintf(stderr, "%s: insufficient memory\n", pname); + exit(2); + } + + for (i = 0; i < nsig; i++) { + s[i].fname = ifname; + s[i].desc = NULL; + s[i].units = NULL; + s[i].gain = wgain; + s[i].initval = 0; + s[i].group = 0; + s[i].fmt = (wres == 16) ? 16 : 80; + s[i].spf = 1; + s[i].bsize = 0; + s[i].adcres = wres; + s[i].adczero = (wres == 16) ? 0 : 128; + s[i].baseline = s[i].adczero; + s[i].nsamp = wnsamp; + s[i].cksum = 0; + wfdbsetstart(i, 44L); + } + setsampfreq(sps); + + if (setheader(record, s, nsig)) + exit(4); + + /* Clean up. */ + wfdbquit(); + + exit(0); +} + +short in16() +{ + short a, b, r; + + if ((a = getc(ifile)) == EOF || (b = getc(ifile)) == EOF) { + errflag = EOF; + return (EOF); + } + r = (a & 0xff) | ((b << 8) & 0xff00); + return (r); +} + +long in32() +{ + long a, b, c, d, r; + + if ((a = getc(ifile)) == EOF || (b = getc(ifile)) == EOF || + (c = getc(ifile)) == EOF || (d = getc(ifile)) == EOF) { + errflag = EOF; + return (EOF); + } + r = (a & 0xff) | ((b << 8) & 0xff00) | + ((c << 16) & 0xff0000) | ((d << 24) & 0xff000000); + return (r); +} + +char *prog_name(char *s) +{ + char *p = s + strlen(s); + +#ifdef MSDOS + while (p >= s && *p != '\\' && *p != ':') { + if (*p == '.') + *p = '\0'; /* strip off extension */ + if ('A' <= *p && *p <= 'Z') + *p += 'a' - 'A'; /* convert to lower case */ + p--; + } +#else + while (p >= s && *p != '/') + p--; +#endif + return (p+1); +} + +static char *help_strings[] = { + "usage: %s -i FILE.wav -r RECORD [ OPTIONS ... ]\n", + "where FILE.wav is the name of the wav-format output signal file,", + "and OPTIONS may include:", + " -h print this usage summary", + " -r RECORD create RECORD.hea (default: FILE.hea)", + NULL +}; + +void help() +{ + int i; + + (void)fprintf(stderr, help_strings[0], pname); + for (i = 1; help_strings[i] != NULL; i++) + (void)fprintf(stderr, "%s\n", help_strings[i]); +} diff -Naur wfdb-10.3.1/data/100a.atr wfdb-10.3.2/data/100a.atr --- wfdb-10.3.1/data/100a.atr Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/data/100a.atr Sun Feb 23 14:01:58 2003 @@ -0,0 +1,12 @@ +pü(N;%$&ë f0$.4(*((9($&*0" 5/)!-'0=(!$-+)$#/,+"41(&$2,$!/)$  &5++)++(%51$$)13# !&-'*%(7+!'+.''%-( ++7(! %1))*'1#''""$( +'$**! '-. !,1."%'*")¼ R0&'$$18%*++2%'/6,Û Z,.+!$)#) /.+%#,1-#.50.-%"-3.+ !#*0-*0'1#$'7. "%*/.4(0*($$'*Å _ ""$ %)*') !,4+&)')-0*+"*)1" $    00&+,:60"",60 '% "!Á R!úúÿý øþù +ýý! (&""%) ÿúû +ÿ $   %' ) ý  ñôûþ÷øúùõ    ÿý  %,"&&à c) '# ,   ÿ  &/%" )>5#! '3.&1+-#$/0&#%& "$  + 0-#/$#"")   #"*& %,&#%&"$)+  "*"   ý ÷ýÿ  ÿ '  + $,. #+#) /2!  )ü  û  #""$)(#"0+#)%($!2$)($  * 3( V#./($ '%'"" ..!)&0(*!&# -+((2$ &.%%'5.)/%$( Ô F.0.#ç =0+ & !' Ü p;,# %(.%&á h%#Ô k>- %+$13*1:(- 23/ ""$#/-/%04'1%"55.! $',1'&,."# 1.3$ '01"$%&("3'# Ð W3100#.4* Ø T&-'"(*#*3*'"(2*  !$ $  !&$  $46#(,7%-0( !)0$!1 /$  /!!Ü C(1/,$$!* "&+  ")-"+,$,$!*4*)!(51)!),)'1($$ Ê q/)&%*"00,&'(/& %'&""".-&(,0"#20%%"$2(#&/%&!!*$",-$ä F× Z*1)'/)".*0.&5*1,'+,"Á r.) %Æ k3+/.'%("68( (')Ù q8.*è c.("%0*%/03" *40(! #'3."Ï Z(',-* -/ç d$.5(" %,3*8/(),//*!'//*) ,3.1$*:)& ""'60 '3)&)$-*-,*("!*:/ &(+.;(#./.+%',1(&#$*(*Õ j. './**/)&/1*$#-.'"(/0(!,0,),!!63"!''06#/2(/('+4&  :1Ö h(.0-,$#*94& ##'.2!..2*&#'-6+"%'/%' *5+)%112)+*,(,6/(##&.11%Áô—.*&##9-!'&42 /)"-!#12'!!%,.*'&)!Ý I4+" !,Ú d V2+*'(4.!!$%#2.6 ,ì e5$#!/7,&"-/ô V#++)#û@, + úö  +%%!%!× ?(3"$ .2' + ÿÿýöëù   +   07&%*)# + !"#(#!#&"2$!&+#**$/& +#!  )%¾ C  +  ÿ"#&&1%&2*'"-*   üö õþüú \ No newline at end of file diff -Naur wfdb-10.3.1/data/100a.hea wfdb-10.3.2/data/100a.hea --- wfdb-10.3.1/data/100a.hea Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/data/100a.hea Sun Feb 23 14:16:52 2003 @@ -0,0 +1,2 @@ +100a 0 360 650000 +# From mitdb/100 diff -Naur wfdb-10.3.1/data/Makefile wfdb-10.3.2/data/Makefile --- wfdb-10.3.1/data/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/data/Makefile Mon Feb 24 00:53:28 2003 @@ -33,12 +33,12 @@ # listing'. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -50,18 +50,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -108,7 +108,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -216,10 +216,10 @@ echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ # file: Makefile.tpl G. Moody 23 May 2000 -# Last revised: 13 December 2001 +# Last revised: 23 February 2003 # This section of the Makefile should not need to be changed. -DBFILES = 100s.dat 100s.atr *.hea *list wfdbcal +DBFILES = 100a.atr 100s.atr 100s.dat *.hea *list wfdbcal all: @echo Nothing to be made in `pwd`. diff -Naur wfdb-10.3.1/data/Makefile.tpl wfdb-10.3.2/data/Makefile.tpl --- wfdb-10.3.1/data/Makefile.tpl Thu Dec 13 14:11:32 2001 +++ wfdb-10.3.2/data/Makefile.tpl Sun Feb 23 14:08:15 2003 @@ -1,8 +1,8 @@ # file: Makefile.tpl G. Moody 23 May 2000 -# Last revised: 13 December 2001 +# Last revised: 23 February 2003 # This section of the Makefile should not need to be changed. -DBFILES = 100s.dat 100s.atr *.hea *list wfdbcal +DBFILES = 100a.atr 100s.atr 100s.dat *.hea *list wfdbcal all: @echo Nothing to be made in `pwd`. diff -Naur wfdb-10.3.1/doc/Makefile wfdb-10.3.2/doc/Makefile --- wfdb-10.3.1/doc/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/doc/Makefile Mon Feb 24 00:53:28 2003 @@ -134,12 +134,12 @@ # `make ug'. To print the WFDB Programmer's Guide, type `make pg'. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -151,18 +151,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -209,7 +209,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -316,8 +316,8 @@ lib-post-uninstall: echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ -# file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 11 March 2002 +# file: Makefile.tpl G. Moody 24 May 2000 +# Last revised: 24 February 2003 # Change the settings below as appropriate for your setup. # Set COLORS to 'color' if you have a color printer and would like to print @@ -364,7 +364,7 @@ # MANDIR is the root of the man page directory tree. On most systems, this is # something like /usr/man or /usr/local/man (type 'man man' to find out). -MANDIR = /usr/local/man +MANDIR = $(WFDBROOT)/local/man # MAN1, MAN3, MAN5, and MAN7 are the directories in which local man pages for # section 1 (commands), section 3 (libraries), section 5 (formats), and diff -Naur wfdb-10.3.1/doc/Makefile.tpl wfdb-10.3.2/doc/Makefile.tpl --- wfdb-10.3.1/doc/Makefile.tpl Mon Jun 24 10:19:00 2002 +++ wfdb-10.3.2/doc/Makefile.tpl Mon Feb 24 00:22:40 2003 @@ -1,5 +1,5 @@ -# file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 11 March 2002 +# file: Makefile.tpl G. Moody 24 May 2000 +# Last revised: 24 February 2003 # Change the settings below as appropriate for your setup. # Set COLORS to 'color' if you have a color printer and would like to print @@ -46,7 +46,7 @@ # MANDIR is the root of the man page directory tree. On most systems, this is # something like /usr/man or /usr/local/man (type 'man man' to find out). -MANDIR = /usr/local/man +MANDIR = $(WFDBROOT)/local/man # MAN1, MAN3, MAN5, and MAN7 are the directories in which local man pages for # section 1 (commands), section 3 (libraries), section 5 (formats), and diff -Naur wfdb-10.3.1/doc/wag-src/Makefile wfdb-10.3.2/doc/wag-src/Makefile --- wfdb-10.3.1/doc/wag-src/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/doc/wag-src/Makefile Mon Feb 24 00:53:28 2003 @@ -59,12 +59,12 @@ # PostScript 'make wag.ps' (requires troff, tbl, latex, and dvips) # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -76,18 +76,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -134,7 +134,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -242,7 +242,7 @@ echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 7 November 2002 +# Last revised: 24 February 2003 # Change the settings below as appropriate for your setup. # D2PARGS is a list of options for dvips. Uncomment one of these to set the @@ -261,7 +261,7 @@ # MANDIR is the root of the man page directory tree. On most systems, this is # something like /usr/man or /usr/local/man (type 'man man' to find out). -MANDIR = /usr/local/man +MANDIR = $(WFDBROOT)/share/man # MAN1, MAN3, MAN5, and MAN7 are the directories in which local man pages for # section 1 (commands), section 3 (libraries), section 5 (formats), and @@ -384,18 +384,21 @@ test -d $(MAN5) || ( mkdir -p $(MAN5); $(SETDPERMISSIONS) $(MAN5) ) test -d $(MAN7) || ( mkdir -p $(MAN7); $(SETDPERMISSIONS) $(MAN7) ) ./maninst.sh $(MAN1) $(MAN3) $(MAN5) $(MAN7) "$(SETPERMISSIONS)" - $(LN) $(MAN1)/a2m.1 $(MAN1)/ad2m.1 - $(LN) $(MAN1)/a2m.1 $(MAN1)/ahaconvert.1 - $(LN) $(MAN1)/a2m.1 $(MAN1)/m2a.1 - $(LN) $(MAN1)/a2m.1 $(MAN1)/md2a.1 - $(LN) $(MAN1)/ann2rr.1 $(MAN1)/rr2ann.1 - $(LN) $(MAN1)/hrfft.1 $(MAN1)/hrlomb.1 - $(LN) $(MAN1)/hrfft.1 $(MAN1)/hrmem.1 - $(LN) $(MAN1)/hrfft.1 $(MAN1)/hrplot.1 - $(LN) $(MAN1)/plot2d.1 $(MAN1)/plot3d.1 - $(LN) $(MAN1)/setwfdb.1 $(MAN1)/cshsetwfdb.1 - $(LN) $(MAN1)/view.1 $(MAN1)/vsetup.1 - $(LN) $(MAN1)/wave.1 $(MAN1)/gtkwave.1 + cd $(MAN1); $(LN) a2m.1 ad2m.1 + cd $(MAN1); $(LN) a2m.1 ahaconvert.1 + cd $(MAN1); $(LN) a2m.1 m2a.1 + cd $(MAN1); $(LN) a2m.1 md2a.1 + cd $(MAN1); $(LN) ann2rr.1 rr2ann.1 + cd $(MAN1); $(LN) edf2mit.1 $(MAN1)mit2edf.1 + cd $(MAN1); $(LN) hrfft.1 hrlomb.1 + cd $(MAN1); $(LN) hrfft.1 hrmem.1 + cd $(MAN1); $(LN) hrfft.1 hrplot.1 + cd $(MAN1); $(LN) plot2d.1 plot3d.1 + cd $(MAN1); $(LN) pnnlist.1 pNNx.1 + cd $(MAN1); $(LN) setwfdb.1 cshsetwfdb.1 + cd $(MAN1); $(LN) view.1 vsetup.1 + cd $(MAN1); $(LN) wav2mit.1 mit2wav.1 + cd $(MAN1); $(LN) wave.1 gtkwave.1 # 'make wag.pdf': format the WFDB Applications Guide as PDF wag.pdf: wag0.ps diff -Naur wfdb-10.3.1/doc/wag-src/Makefile.tpl wfdb-10.3.2/doc/wag-src/Makefile.tpl --- wfdb-10.3.1/doc/wag-src/Makefile.tpl Thu Nov 7 21:30:11 2002 +++ wfdb-10.3.2/doc/wag-src/Makefile.tpl Mon Feb 24 00:41:25 2003 @@ -1,5 +1,5 @@ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 7 November 2002 +# Last revised: 24 February 2003 # Change the settings below as appropriate for your setup. # D2PARGS is a list of options for dvips. Uncomment one of these to set the @@ -18,7 +18,7 @@ # MANDIR is the root of the man page directory tree. On most systems, this is # something like /usr/man or /usr/local/man (type 'man man' to find out). -MANDIR = /usr/local/man +MANDIR = $(WFDBROOT)/share/man # MAN1, MAN3, MAN5, and MAN7 are the directories in which local man pages for # section 1 (commands), section 3 (libraries), section 5 (formats), and @@ -141,18 +141,21 @@ test -d $(MAN5) || ( mkdir -p $(MAN5); $(SETDPERMISSIONS) $(MAN5) ) test -d $(MAN7) || ( mkdir -p $(MAN7); $(SETDPERMISSIONS) $(MAN7) ) ./maninst.sh $(MAN1) $(MAN3) $(MAN5) $(MAN7) "$(SETPERMISSIONS)" - $(LN) $(MAN1)/a2m.1 $(MAN1)/ad2m.1 - $(LN) $(MAN1)/a2m.1 $(MAN1)/ahaconvert.1 - $(LN) $(MAN1)/a2m.1 $(MAN1)/m2a.1 - $(LN) $(MAN1)/a2m.1 $(MAN1)/md2a.1 - $(LN) $(MAN1)/ann2rr.1 $(MAN1)/rr2ann.1 - $(LN) $(MAN1)/hrfft.1 $(MAN1)/hrlomb.1 - $(LN) $(MAN1)/hrfft.1 $(MAN1)/hrmem.1 - $(LN) $(MAN1)/hrfft.1 $(MAN1)/hrplot.1 - $(LN) $(MAN1)/plot2d.1 $(MAN1)/plot3d.1 - $(LN) $(MAN1)/setwfdb.1 $(MAN1)/cshsetwfdb.1 - $(LN) $(MAN1)/view.1 $(MAN1)/vsetup.1 - $(LN) $(MAN1)/wave.1 $(MAN1)/gtkwave.1 + cd $(MAN1); $(LN) a2m.1 ad2m.1 + cd $(MAN1); $(LN) a2m.1 ahaconvert.1 + cd $(MAN1); $(LN) a2m.1 m2a.1 + cd $(MAN1); $(LN) a2m.1 md2a.1 + cd $(MAN1); $(LN) ann2rr.1 rr2ann.1 + cd $(MAN1); $(LN) edf2mit.1 $(MAN1)mit2edf.1 + cd $(MAN1); $(LN) hrfft.1 hrlomb.1 + cd $(MAN1); $(LN) hrfft.1 hrmem.1 + cd $(MAN1); $(LN) hrfft.1 hrplot.1 + cd $(MAN1); $(LN) plot2d.1 plot3d.1 + cd $(MAN1); $(LN) pnnlist.1 pNNx.1 + cd $(MAN1); $(LN) setwfdb.1 cshsetwfdb.1 + cd $(MAN1); $(LN) view.1 vsetup.1 + cd $(MAN1); $(LN) wav2mit.1 mit2wav.1 + cd $(MAN1); $(LN) wave.1 gtkwave.1 # 'make wag.pdf': format the WFDB Applications Guide as PDF wag.pdf: wag0.ps diff -Naur wfdb-10.3.1/doc/wag-src/a2m.1 wfdb-10.3.2/doc/wag-src/a2m.1 --- wfdb-10.3.1/doc/wag-src/a2m.1 Tue Aug 6 14:50:06 2002 +++ wfdb-10.3.2/doc/wag-src/a2m.1 Sun Feb 23 11:57:33 2003 @@ -1,4 +1,4 @@ -.TH A2M 1 "6 August 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.TH A2M 1 "23 February 2003" "WFDB 10.3.2" "WFDB Applications Guide" .SH NAME a2m, ad2m, ahaconvert, m2a, md2a \- converting between MIT and AHA DB formats .SH SYNOPSIS @@ -104,7 +104,7 @@ .br \fBahaconvert /mnt/cdrom/?[23]??.cmp\fR .br -(The pattern '\fB?[23]2??\fR' matches the record names of the short-format +(The pattern '\fB?[23]??\fR' matches the record names of the short-format records.) .PP To convert the long-format records only, type: diff -Naur wfdb-10.3.1/doc/wag-src/ann2rr.1 wfdb-10.3.2/doc/wag-src/ann2rr.1 --- wfdb-10.3.1/doc/wag-src/ann2rr.1 Fri Nov 1 11:08:41 2002 +++ wfdb-10.3.2/doc/wag-src/ann2rr.1 Sat Feb 8 16:52:40 2003 @@ -1,4 +1,4 @@ -.TH ANN2RR 1 "1 November 2002" "WFDB 10.3.0" "WFDB Applications Guide" +.TH ANN2RR 1 "8 February 2003" "WFDB 10.3.2" "WFDB Applications Guide" .SH NAME ann2rr, rr2ann \- convert annotation files to interval lists and vice versa .SH SYNOPSIS @@ -17,6 +17,11 @@ intervals (use \fBsampfreq\fR(1) to determine the sampling frequency of the input record if necessary). Options for \fBann2rr\fR include: .TP +\fB-A\fR +Print all intervals between annotations. By default, \fBann2rr\fR prints +only RR intervals (those between QRS (beat) annotations). This option +overrides the \fB-c\fR and \fB-p\fR options. +.TP \fB-c\fR Print intervals between consecutive valid annotations only. (See discussion below). @@ -28,8 +33,17 @@ \fB-h\fR Print a usage summary. .TP +\fB-i\fR \fIformat\fR +Print intervals in the specified \fIformat\fR. By default, intervals are +printed in units of sample intervals. Other \fIformat\fRs include \fBs\fR +(seconds), \fBm\fR (minutes), \fBh\fR (hours), and \fBt\fR (time interval +in hh:mm:ss format). Formats \fBs\fR, \fBm\fR, and \fBh\fR may be followed +by an integer between 0 and 15 inclusive, specifying the number of decimal +places (default: 3). For example, use the option \fB-is8\fR to obtain +intervals in seconds with 8 decimal places. +.TP \fB-p\fR \fItype\fR [ \fItype\fR ... ] -Print intervals between annotations of the specified \fItypes\fR only. +Print intervals ended by annotations of the specified \fItypes\fR only. The \fItype\fR arguments should be annotation mnemonics (e.g., \fBN\fR), as normally printed by \fBrdann\fR(1) in the third column. More than one \fB-p\fR option may be used in a single command, and each \fB-p\fR option may @@ -38,33 +52,51 @@ mnemonics do not begin with ``-'', but modification labels in an annotation file may define such mnemonics). .TP +\fB-p\fR \fItype\fR [ \fItype\fR ... ] +Print intervals begun by annotations of the specified \fItypes\fR only. +.TP \fB-t\fR \fItime\fR Stop at the specified \fItime\fR. .TP -\fB-v\fR, \fB-vs\fR, \fB-vm\fR, \fB-vh\fR, \fB-V\fR, \fB-Vs\fR, \fB-Vm\fR, \fB-Vh\fR -Print the elapsed times from the beginning of the record to the annotations -that begin each interval, as sample number (using \fB-v\fR), or in seconds -(using \fB-vs\fR), minutes (using \fB-vm\fR), or hours (using \fB-vh\fR) -before each heart rate value. The options \fB-V\fR, \fB-Vs\fR, \fB-Vm\fR, and -\fB-Vh\fR work in the same way, but the printed times are those for the -annotations that end the intervals. Only one of these options can be used at -a time; if none is chosen, only the RR intervals are printed, in units of -sample intervals. When using \fB-vs\fR, \fB-vm\fR, \fB-vh\fR, \fB-Vs\fR, -\fB-Vm\fR, or \fB-Vh\fR, intervals are printed in units of seconds. +\fB-v\fR \fIformat\fR +Print final times (the times of occurrence of the annotations that end each +interval). This option accepts all of the \fIformat\fRs defined for \fB-i\fR, +as well as \fBT\fR (to print the date and time in [hh:mm:ss dd/mm/yyyy] if the +starting time and date have been recorded in the header file for \fIrecord\fR). +If this option is chosen, the times appear at the end of each line of output. +.TP +\fB-V\fR \fIformat\fR +Print initial times (the times of occurrence of the annotations that begin each +interval). Any of the \fIformat\fRs usable for the \fB-v\fR option may be used +with \fB-V\fR. If this option is chosen, the times appear at the beginning of +each line of output. .TP \fB-w\fR -Print the type (\fBN\fR, \fBV\fR, etc., as for \fB-p\fR above) of the -annotation that ends each interval, at the end of each line of output. +Print final annotations (the types (\fBN\fR, \fBV\fR, etc., as for \fB-p\fR +above) of the annotations that end each interval), immediately following the +intervals in each line of output. +.TP +\fB-W\fR +Print initial annotations (the types of the annotations that end each +interval), immediately before the interval in each line of output. .PP The \fB-c\fR option, used without the \fB-p\fR option, causes \fBann2rr\fR to filter out intervals between beats that have intervening non-beat annotations, -such as rhythm or signal quality change annotations. Used with the \fB-p\fR -option, the \fB-c\fR option causes \fBann2rr\fR to reject intervals between -annotations of the type(s) specified by \fB-p\fR if there are annotations of -any other types intervening; thus, for example, the combination of \fB-c\fR -and \fB-p N\fR would yield only intervals between consecutive normal beats, -and intervals between pairs of normal beats surrounding an ectopic beat would -be discarded from the output. +such as rhythm or signal quality change annotations. Used with the \fB-P\fR +and \fB-p\fR options, the \fB-c\fR option causes \fBann2rr\fR to reject +intervals between annotations of the type(s) specified by \fB-p\fR if there are +annotations of any other types intervening; thus, for example, +``\fB-c -P N -p N\fR'' yields only intervals between consecutive normal beats, +and intervals between pairs of normal beats surrounding an ectopic beat are +discarded from the output. As another example, ``\fB-c -P N -p V\fR'' yields +premature ventricular coupling intervals only (a coupling interval is the +interval between a normal beat and an immediately following premature +ventricular contraction). +.PP +The default output contains a single column of intervals only; by using the +\fB-v\fR, \fB-V\fR, \fB-w\fR, and \fB-W\fR options, up to five columns, +separated by tabs, may be output. The order of the columns is fixed (initial +times, initial annotations, intervals, final annotations, final times). .SS "rr2ann" .PP @@ -81,9 +113,9 @@ Options for \fBrr2ann\fR include: .TP \fB-F\fR \fIfrequency\fR -Assume the specified sampling \fIfrequency\fR. This option has no effect unless -it is necessary for \fBrr2ann\fR to create a header file; in this case, a sampling -frequency of 250 Hz is assumed if the \fB-F\fR option is omitted. +Assume the specified sampling \fIfrequency\fR. This option has no effect +unless it is necessary for \fBrr2ann\fR to create a header file; in this case, +a sampling frequency of 250 Hz is assumed if the \fB-F\fR option is omitted. .TP \fB-h\fR Print a usage summary. diff -Naur wfdb-10.3.1/doc/wag-src/fixag.sh wfdb-10.3.2/doc/wag-src/fixag.sh --- wfdb-10.3.1/doc/wag-src/fixag.sh Wed Aug 7 11:56:08 2002 +++ wfdb-10.3.2/doc/wag-src/fixag.sh Mon Feb 24 01:20:31 2003 @@ -1,6 +1,6 @@ #! /bin/sh # file: fixag.sh G. Moody 10 April 1997 -# Last revised: 7 August 2002 +# Last revised: 24 February 2003 # # Post-process WFDB Applications Guide HTML files @@ -20,6 +20,7 @@ sed 's/\.\(.\)\.htm/-\1.htm/g' >$G.htm done mv -f evfootnode.htm evfoot.htm +mv -f view-d-1.htm view-1.htm for i in *.htm do diff -Naur wfdb-10.3.1/doc/wag-src/imageplt.1 wfdb-10.3.2/doc/wag-src/imageplt.1 --- wfdb-10.3.1/doc/wag-src/imageplt.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/doc/wag-src/imageplt.1 Thu Dec 19 17:14:24 2002 @@ -0,0 +1,48 @@ +.TH IMAGEPLT 1 "19 December 2002" "plt 2.3" "WFDB Applications Guide" +.SH NAME +imageplt \- plot a greyscale image +.SH SYNOPSIS +\fBimageplt -d\fR \fInrows\fR \fIncols\fR [ \fIoptions ...\fR ] [ \fIfile\fR ] +.SH DESCRIPTION +.PP +\fBimageplt\fR provides a simple way to plot a greyscale image using +\fBplt\fR(1). The required arguments, \fInrows\fR and \fIncols\fR, +specify the numbers of rows and columns in the image. The input \fIfile\fR +(or the standard input, if no input file is specified) contains only the +grey levels for each pixel (0 = white, 1 = black). Each entry is an +ASCII-coded decimal floating point number, separated from adjacent entries +by whitespace (one or more spaces, tabs, or newlines). The first \fInrows\fR +entries are the grey levels for column 0 of the image, botttom to top, and +each successive column from left to right of the image follows. If \fInrows\fR +is small, it may be convenient to arrange the image file in columns and rows +corresponding to those of the image, but this is not necessary. In no case +should the length of a line of input exceed 50000 bytes (defined as MAXLEN +in the source). +.PP +\fIOptions\fR include: +.TP +\fB-n\fR +Generate a negative image (1 = white, 0 = black). +.TP +\fB-x\fR \fIxmin\fR \fIxmax\fR +Specify the range of the x-coordinates (default: \fIxmin\fR=0, +\fIxmax\fR=\fInrows\fR-1). +.TP +\fB-y\fR \fIymin\fR \fIymax\fR +Specify the range of the y-coordinates (default: \fIymin\fR=0, +\fIymax\fR=\fIncols\fR-1). +.PP +The output of \fIimageplt\fR is text in three columns, to be plotted using +the \fB-pc\fR option of \fBplt\fR, as in: +.IP +imageplt -d 10 10 foo | plt 0 1 2 -pc +.SH SEE ALSO +.PP +\fBplt\fR(1), \fBpltf\fR(1) +.SH AVAILABILITY +\fBimageplt\fR is available as part of the \fBplt\fR package in +PhysioToolkit (see \fBSOURCES\fR below) under the GPL. +.SH AUTHOR +George B. Moody (\fBgeorge@mit.edu\fR) +.SH SOURCE +\fBhttp://www.physionet.org/physiotools/plt/misc/imageplt.c\fR diff -Naur wfdb-10.3.1/doc/wag-src/nguess.1 wfdb-10.3.2/doc/wag-src/nguess.1 --- wfdb-10.3.1/doc/wag-src/nguess.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/doc/wag-src/nguess.1 Mon Feb 17 07:18:11 2003 @@ -0,0 +1,102 @@ +.TH NGUESS 1 "17 February 2003" "WFDB 10.3.2" "WFDB Applications Guide" +.SH NAME +nguess \- guess the times of missing normal beats in an annotation file +.SH SYNOPSIS +\fBnguess -r\fR \fIrecord\fR \fB-a\fR \fIinput-annotator\fR [ \fIoptions\fR ... ] +.SH DESCRIPTION +.PP +This program copies its input (a WFDB annotation file containing beat +annotations), removing annotations of events other than sinus beats, and +interpolating additional Q (unknown beat) annotations at times when sinus beats +are expected. Intervals between sinus beats are predicted using a predictor +array as described by Paul Schluter ("The design and evaluation of a bedside +cardiac arrhythmia monitor"; Ph.D. thesis, MIT Dept. of Electrical +Engineering, 1981). When the predictions are inconsistent with the known sinus +beats, as may occur in extreme noise or in highly irregular rhythms such as +atrial fibrillation, no interpolations are made. +.PP +Options for \fBnguess\fR include: +.TP +\fB-f\fR \fItime\fR +Begin at the specified \fItime\fR. By default, \fBnguess\fR starts at the +beginning of the record. +.TP +\fB-h\fR +Print a usage summary. +.TP +\fB-o\fR \fIoutput-annotator\fR +Write output to the annotation file specified by \fIoutput-annotator\fR +(default: \fBnguess\fR). +.TP +\fB-t\fR \fItime\fR +Stop at the specified \fItime\fR. +.PP +It should be understood that, as the name of this program implies, the Q labels +it generates represent, at best, good guesses about the times at which sinus +beats may be expected. Ideally, one should avoid having to make such guesses, +but some commonly-used techniques for study of heart rate variability (for +example, conventional methods for power spectral density estimation in the +frequency domain) require a uniformly sampled instantaneous heart rate signal, +such as can be obtained using \fBtach\fR(1) to process the output of +\fBnguess\fR. Other techniques, such as the Lomb periodogram method +implemented by \fBlomb\fR(1), can obtain frequency spectra from time series +with missing and irregularly spaced values, such as can be produced from a beat +annotation file using \fBihr\fR(1) without the need to use \fBnguess\fR. Use +\fBnguess\fR only when necessary and do not expect it to perform miracles; as +a rule of thumb, if the number of guesses (Q annotations) exceeds one or two +percent of the number of known sinus beats (N annotations), be exceedingly wary +of the guesses and consider using techniques such as \fBlomb\fR(1) that do not +require the use of \fBnguess\fR. Also as a general rule, \fBnguess\fR works +best when it is guessing the locations of sinus beats obscured by noise, or +those of sinus beats that were inhibited by isolated premature ventricular +beats; the underlying hypothesis of a quasi-continuous sinus rhythm, the basis +not only of \fBnguess\fR but also of all other algorithms for reconstructing +NN interval time series, is most suspect in the context of supraventricular +ectopic beats (which may reset the SA node, thus interrupting the sinus rhythm) +and consecutive ventricular ectopic beats. +.PP +The predictor array method is based on the observation that most of the +short-term variability in normal sinus inter-beat (NN) intervals is due to +respiratory sinus arrhythmia (RSA, the quasi-periodic modulation of heart rate +by respiration, which is most notable in young, healthy subjects and decreases +with age). Since respiration rate is (in humans and smaller mammals) +substantially slower than heart rate, it is possible to estimate the length of +the respiratory cycle in terms of some number of NN intervals. If, for +example, heart rate is around 60 beats per minute and respiration rate is +around 10 breaths per minute, one might expect that 6 NN intervals would +correspond to one breath, and that the current interval might be particularly +well-approximated by the sixth previous interval. Since we don't know the +ratio between heart and respiration rate a priori, we can observe how well each +of the previous \fBPBLEN\fR (a constant defined in \fBnguess.c\fR, see below) +intervals predicts the current interval on average. Thus we have \fBPBLEN\fR +predictors for each interval, some of which may be much better on average than +others. At any time, we know which predictor is (locally) the best, and we can +use that predictor to make a best guess of the location of the next sinus beat. +In subjects with significant RSA, the best predictor may be determined by the +length of the respiratory cycle; in others, the previous beat may be a better +predictor. For our purposes, it really doesn't matter which predictor is best, +only that the mean error of the best predictor is small. If the next known +sinus beat is at least 1.75 times as distant as the prediction, and if the +predictions are reasonably good on average, 'nguess' asserts that a gap exists +and fills it in with a Q annotation (or more than one, if the gap is +sufficiently long). +.SH ENVIRONMENT +.PP +It may be necessary to set and export the shell variable \fBWFDB\fR (see +\fBsetwfdb\fR(1)). +.SH FILES +.TP 22 +\fIrecord\fR.hea +header file +.TP 22 +\fIrecord\fR.\fIinput-annotator\fR +input annotation file (may contain any annotations) +.TP 22 +\fIrecord\fR.\fIoutput-annotator\fR +output annotation file (contains N and Q annotations only) +.SH SEE ALSO +\fBihr\fR(1), \fBlomb\fR(1), \fBsetwfdb\fR(1), \fBtach\fR(1) +.SH AUTHOR +George B. Moody (george@mit.edu) +.SH SOURCE +http://www.physionet.org/physiotools/wfdb/app/nguess.c diff -Naur wfdb-10.3.1/doc/wag-src/plt.1 wfdb-10.3.2/doc/wag-src/plt.1 --- wfdb-10.3.1/doc/wag-src/plt.1 Sun Nov 17 00:59:09 2002 +++ wfdb-10.3.2/doc/wag-src/plt.1 Thu Dec 19 16:01:58 2002 @@ -1,4 +1,4 @@ -.TH PLT 1 "17 November 2002" "plt 2.2" "WFDB Applications Guide" +.TH PLT 1 "19 December 2002" "plt 2.3" "WFDB Applications Guide" .SH NAME plt \- make 2-D plots .SH SYNOPSIS @@ -386,6 +386,8 @@ \fB/usr/lib/ps/plt.pro\fR PostScript prolog for plots printed using \fBlwcat\fR .SH SEE ALSO +.PP +\fBimageplt\fR(1), \fBpltf\fR(1) .PP The \fIplt Tutorial and Cookbook\fR (a book-length introduction to \fBplt\fR, included in the \fBplt\fR source package) contains many more examples. diff -Naur wfdb-10.3.1/doc/wag-src/pltf.1 wfdb-10.3.2/doc/wag-src/pltf.1 --- wfdb-10.3.1/doc/wag-src/pltf.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/doc/wag-src/pltf.1 Thu Dec 19 18:12:14 2002 @@ -0,0 +1,54 @@ +.TH PLT 1 "19 December 2002" "plt 2.3" "WFDB Applications Guide" +.SH NAME +pltf \- make function plots +.SH SYNOPSIS +\fBpltf\fR [ \fIexpression\fR [ \fIxmin\fR [ \fIxmax\fR [ \fIxinc\fR ] ] ] ] +.SH DESCRIPTION +.PP +\fBpltf\fR provides a simple way to use \fBbc\fR(1) and \fBplt\fR(1) +to generate plots of many common functions of a single variable. The +command-line arguments are interpreted according to their position; +\fBpltf\fR asks for values for any missing arguments. +.PP +The first argument, \fIexpression\fR, can be any expression valid as input +to \fBbc\fR(1), with the additional feature that the variable \fBx\fR may +appear anywhere in the expression where a number would be allowed by \fBbc\fR. +Some examples of valid expressions are: +.IP +\fBx^3+3*x^2+3*x+1\fR +.IP +\fB(x + 1)^3\fR +.IP +\fBs(sqrt(x^2))\fR +.PP +The first two of these are equivalent; note that whitespace and parentheses +are allowed in expressions, although it is necessary to enclose such +expressions in double quotes (e.g., \fB"(x + 1)*e(x)"\fR) when entering them as +command-line arguments in order to protect them from the shell. The +last expression is the sine of the square root of x squared; see \fBbc\fR(1) +for a complete list of available special functions, or invoke \fBpltf\fR +with no command-line arguments to obtain a list. +.PP +The second and third arguments specify the domain of the function (the +values over which \fBx\fR should vary), and the fourth argument specifies the +\fBx\fR-increment (the difference between consecutive values of \fBx\fR for +which the expression is to be evaluated). +.PP +\fBpltf\fR is a shell script that uses a helper application, \fBftable\fR, to +prepare input for \fBbc -l\fR. Invoke \fBftable\fR directly (using the same +arguments as for \fBpltf\fR) if you need to change the format of the plot +or make a printed version of it. See the source for \fBpltf\fR to see how to +do this. +.SH SEE ALSO +.PP +\fBimageplt\fR(1), \fBplt\fR(1) +.SH AVAILABILITY +\fBpltf\fR is available as part of the \fBplt\fR package in +PhysioToolkit (see \fBSOURCES\fR below) under the GPL. +.SH AUTHOR +George B. Moody (\fBgeorge@mit.edu\fR) +.SH SOURCES +.PP +\fBhttp://www.physionet.org/physiotools/plt/misc/pltf\fR +.PP +\fBhttp://www.physionet.org/physiotools/plt/misc/ftable.c\fR diff -Naur wfdb-10.3.1/doc/wag-src/pnnlist.1 wfdb-10.3.2/doc/wag-src/pnnlist.1 --- wfdb-10.3.1/doc/wag-src/pnnlist.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/doc/wag-src/pnnlist.1 Sat Feb 22 14:49:22 2003 @@ -0,0 +1,113 @@ +.TH PNNLIST 1 "22 February 2003" "WFDB 10.3.2" "WFDB Applications Guide" +.SH NAME +pnnlist, pNNx \- derive pNNx statistics from an annotation interval list or an annotation file +.SH SYNOPSIS +\fBpnnlist\fR [ \fIoptions\fR ... ] +\fBpNNx -r\fR \fIrecord\fR \fB-a\fR \fIinput-annotator\fR [ \fIoptions\fR ... ] +.SH DESCRIPTION +.PP +These programs derive \fIpNNx\fR, time domain measures of heart rate +variability defined for any time interval \fIx\fR as the fraction of +consecutive normal sinus (NN) intervals that differ by more than \fIx\fR. +Conventionally, such measures have been applied to assess parasympathetic +activity using \fIx\fR = 50 milliseconds (yielding the widely-cited \fIpNN50\fR +statistic). +.SS pnnlist +.PP +This program takes as standard input an annotation interval list, containing +intervals in seconds and the (beat and non-beat) annotations that terminate +each interval; and outputs on standard output each unique NN increment (x) in +milliseconds, and the percentage of NN interval increments (pNNx) greater +than x. +.PP +Options for \fBpnnlist\fR may include: +.TP +\fB-h\fR +Print this usage summary. +.TP +\fB-i\fR \fIinc\fR +Compute and output pNNx for x = 0, \fIinc\fR, \fI2*inc\fR, ... milliseconds. +.TP +\fB-p\fR +Compute and output increments as percentage of initial intervals. +.TP +\fB-s\fR +Compute and output separate distributions of positive and negative intervals. +.SS pNNx +.PP +This shell script invokes \fBann2rr\fR(1) and \fBpnnlist\fR to obtain pNNx +statistics using a beat annotation file as input. The input file must be +specified using the \fB-r\fR \fIrecord\fR and \fB-a\fR \fIannotator\fR +arguments. +.PP +Options for \fBpNNx\fR may include any of those usable with \fBpnnlist\fR, +as well as: +.TP +\fB-f\fR \fItime\fR +Begin at the specified \fItime\fR. By default, \fBpNNx\fR starts at the +beginning of the record. +.TP +\fB-t\fR \fItime\fR +Stop at the specified \fItime\fR. +.SH EXAMPLES +.PP +These commands are functionally identical: +.br + \fBann2rr -r nsrdb/16265 -a atr -A -i s8 -w | pnnlist\fR +.br + \fBpNNx -r nsrdb/16265 -a atr\fR +.PP +Each of these commands reads the \fBatr\fR (reference) annotations for +MIT-BIH Normal Sinus Rhythm Database (\fBnsrdb\fR) record 16265 (downloading +them directly from PhysioNet if the annotation file has not previously been +downloaded into a local \fBnsrdb\fR directory. These commands will then print +each unique NN interval increment in milliseconds along with the percentage of +intervals greater than that value. Both of the examples above produce the +same output; the first few lines are shown below: +.br + 0 89.2738 +.br + 7.8125 69.4564 +.br + 15.625 53.3662 +.br + 23.4375 40.8539 +.br + 31.25 31.4265 +.br + 39.0625 24.1817 +.br + 46.875 18.4763 +.br + 54.6875 14.1261 +.br + 62.5 10.7312 +.br + 70.3125 8.06025 +.br + 78.125 6.09401 +.br + 85.9375 4.56975 +.br + 93.75 3.47841 +.br + 101.562 2.66896 +.br + . +.br + . +.br + . + +.SH ENVIRONMENT +.PP +It may be necessary to set and export the shell variable \fBWFDB\fR (see +\fBsetwfdb\fR(1)). +.SH SEE ALSO +\fBann2rr\fR(1), \fBsetwfdb\fR(1) +.SH AUTHOR +Joe E. Mietus (joe at physionet dot org) +.SH SOURCE +http://www.physionet.org/physiotools/pNNx/pNNx.src/pnnlist.c +.br +http://www.physionet.org/physiotools/pNNx/pNNx.src/pNNx diff -Naur wfdb-10.3.1/doc/wag-src/view-dos.1 wfdb-10.3.2/doc/wag-src/view-dos.1 --- wfdb-10.3.1/doc/wag-src/view-dos.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/doc/wag-src/view-dos.1 Wed Jul 31 23:52:21 2002 @@ -0,0 +1,191 @@ +'\" t +.TH VIEW 1 "31 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.SH NAME +view, vsetup \- WFDB browser for MS-DOS +.SH SYNOPSIS +\fBview\fR +.br +\fBview\fR \fIrecord\fR +.br +\fBview\fR \fIrecord annotator\fR +.br +\fBview\fR \fIrecord annotator time\fR +.br +\fBview\fR \fIrecord annotator type\fR +.br +\fBvsetup\fR +.br +\fBvsetup -s\fR \fIfile \fR +.br +\fBvsetup\fR \fImode\fR +.SH DESCRIPTION +.PP +This program reads one or more signal files and an annotation file (if one is +available), and displays the signals with annotations at the standard +chart recorder scale of 25 mm/sec and 10 mm/mV on systems equipped with +a CGA, Hercules, EGA, VGA, or compatible graphics display adapter. Run +\fBvsetup\fR to determine a suitable display mode and scaling constants before +using \fBview\fR for the first time (see \fBvsetup\fR below). +.PP +If no \fIrecord\fR is specified on the command line, \fBview\fR asks for a +record name when it starts. If no \fIannotator\fR is specified on the command +line, \fBview\fR attempts to find an annotation file named \fIrecord\fB.atr\fR; +otherwise, it attempts to find one named \fIrecord\fB.\fIannotator\fR. +If the annotation file does not exist or cannot be read, \fBview\fR simply +displays the signals. A \fItime\fR argument, if present, causes \fBview\fR +to display its first screenful such that the left-hand edge of the screen +corresponds to the specified time. A \fItype\fR argument, if present, causes +\fBview\fR to search for the first occurrence of the specified annotation type +in the annotation file, and to center the first screenful on that annotation +if possible. +.PP +\fBview\fR is an interactive program. Once the first screenful has been +displayed, \fBview\fR waits for additional commands, which can be typed in the +prompt area near the bottom of the screen, and which are executed when you +press ENTER. These commands can be in any of the formats permissible for +\fItime\fR or \fItype\fR command-line arguments; such commands have the same +effect as if given on the command line. You may also merely press ENTER to see +the next screenful; if the previous action involved searching for an +annotation, this will cause \fBview\fR to search for the next occurrence of the +same annotation type that does not already appear on the screen. The \fBg\fR +command may be used to turn the grid display on or off; initially, the grid +display is off. When the grid is visible, it marks 0.2 second and 0.5 +millivolt intervals. The \fBm\fR command may be used to turn annotation +marker bars (dotted lines above and below each annotation showing the exact +location of the annotation fiducial mark) on or off; initially, annotation +marker bars are on. Finally, use the \fBx\fR command to exit from \fBview\fR +and return to the DOS prompt. +.PP +Current versions of \fBview\fR (4.0 and later) support the use of a mouse to +navigate through the record. If a mouse is available, \fBview\fR displays +buttons at the bottom of the screen; click left on these to move forward +or backward by whole or half screenfuls. If the mouse pointer is above the +level of the buttons, clicking left or right moves the pointer left or right +one annotation at a time, recentering the display if the pointer would +otherwise move out of the display region. +.PP +\fBvsetup\fR is used to calibrate your monitor for \fBview\fR. If \fBvsetup\fR +is able to identify a usable graphics mode, it will ask you to measure the +dimensions of a rectangle that it draws on your screen. When it finishes, it +will print instructions for setting an environment variable that is required +by \fBview\fR, unless you have used the \fB-s\fR option; in the latter case, +the MS-DOS command needed to set the variable is appended to the specified +\fIfile\fR. If your graphics adapter is capable of several display modes, +and you prefer to use a different mode from that selected by \fBvsetup\fR, you +can run \fBvsetup\fR with an integer argument that corresponds to your +preferred \fImode\fR, from among the following: +.br +.TS +center; +r l. +\fIArgument Display mode\fR +4 320 x 200, 4 colors +5 320 x 200, 4 grey levels +6 640 x 200, black and white +8 720 x 348, black and white [1] +13 320 x 200, 16 colors +14 640 x 200, 16 colors +15 640 x 350, black and white +16 640 x 350, 4 or 16 colors +17 640 x 480, black and white +18 640 x 480, 16 colors +19 320 x 200, 256 colors [2] +258 800 x 600, 16 colors [3] +259 800 x 600, 256 colors [2,3] +260 1024 x 768, 16 colors [3] +261 1024 x 768, 256 colors [2,3] +262 1280 x 1024, 16 colors [3] +263 1280 x 1024, 256 colors [2,3] +.TE +.PP +[1] Mode 8 can be used only with a Hercules Graphics Card, Graphics Card Plus, +Incolor Card, or a compatible. To use mode 8 with one of these cards, load +\fImsherc.com\fR (from the \fIbin\fR directory of your CD-ROM or software +distribution diskette, or from your Microsoft C, Pascal, or Fortran compiler +diskettes) before using \fBvsetup\fR or \fBview\fR. Do so by typing +\fImsherc\fR from within the directory where you find \fImsherc.com\fR (you +may wish to include this step in your \fIautoexec.bat\fR). If you have both a +Hercules monochrome card and a color video card in the same system, type +\fImsherc /h\fR instead. +.PP +[2] \fBview\fR uses at most 5 colors, so the 256-color modes offer no advantage +over the 16-color modes. In the 16- and 256-color modes, the background is +white; in the 4-color and black-and-white modes, the background is black. +.PP +[3] These modes can be used only with a VESA-compatible SVGA and a compatible +monitor. \fBvsetup\fR will not identify these modes automatically, because +of the potential for damage to your monitor if your SVGA card supports these +modes but your monitor does not. \fBDo not attempt to use these modes unless +your monitor supports them. Otherwise, you risk damaging your monitor.\fR +.SH ENVIRONMENT +.TP +\fBWFDB\fR +The database path: a list of directories that contain database files. An +empty component is taken to refer to the current directory. All applications +built with the \fBwfdb\fR(3) library search for their database input files in +the order specified by \fBWFDB\fR. If \fBWFDB\fR is not set, searches are limited to the builtin WFDB path (see \fBsetwfdb\fR(1). Under MS-DOS, directory +names are separated by semicolons (;), and the format of \fBWFDB\fR is that of +the MS-DOS \fBPATH\fR variable (colons may be used following drive specifiers +within \fBWFDB\fR in this case). +.TP +\fBWFDBCAL\fR +The name of the WFDB calibration file (see \fBwfdbcal\fR(5)), which +must be in a directory named by \fBWFDB\fR (see immediately above). +This file is used by \fBview\fR to determine standard scales for +signals other than ECGs. If \fBWFDBCAL\fR is not set, or if the file +named by \fBWFDBCAL\fR is not readable, these signals may be drawn at +incorrect scales. +.TP +\fBVIEWF\fR +The pathname for the font file containing characters to be drawn by \fBview\fR. +\fBVIEWF\fR should name a Microsoft Windows-compatible `\fI.fon\fR' file. By +default, if \fBVIEWF\fR is not set, \fBview\fR checks the \fBPATH\fR variable +to see if Microsoft Windows is available, and uses \fImodern.fon\fR in the +Windows \fIsystem\fR subdirectory if so, or a file of the same name in the +current directory if not; otherwise, \fBview\fR uses text mode to draw +characters. If you are using \fBview\fR in a DOS box under MS-Windows 95, you +will probably find \fImodern.fon\fR in the Windows \fIfonts\fR subdirectory, +and you should set \fBVIEWF\fR accordingly. Note that text mode character +placement is constrained to text mode character cells; annotations shown using +text mode will not be placed as precisely as those shown using graphics mode. +.TP +\fBVIEWP\fR +Instructions for setting this variable are printed by \fBvsetup\fR. The +format for the command to do so is +.br + \fBset VIEWP=\fR\fImode,left,right,top,bottom,width,height\fR +.br +where \fImode\fR is one of those specified in the table above, \fIleft\fR, +\fIright\fR, \fItop\fR, and \fIbottom\fR are the pixel column and row numbers +corresponding to the edges of the display area to be used by \fBview\fR, and +\fIwidth\fR and \fIheight\fR are the dimensions of the display area in +millimeters. +.PP +After determining appropriate values for these variables, you may wish to add +commands for setting them to your \fIautoexec.bat\fR file. The standard +installation procedure determines appropriate values interactively and inserts +the necessary commands into \fIsetwfdb.bat\fR (see \fBsetwfdb\fR(1)). +.SH CD-ROM VERSIONS +The first edition of the MIT-BIH Arrhythmia Database CD-ROM, the first and +second editions of the European ST-T Database CD-ROM, and the first edition of +the MIT-BIH Polysomnographic Database CD-ROM contain versions of \fBview\fR +that do not support color or greyscale output, SVGA display modes, +\fBVIEWF\fR, annotation marker bar display, or mouse interaction. +.PP +Later editions of the MIT-BIH Arrhythmia Database CD-ROM and of the MIT-BIH +Polysomnographic Database CD-ROM contain a version of \fBview\fR that supports +all of these features. Note that version 4.0, included on the second editions +of these CD-ROMs, requires that the record name be supplied on the command +line. (As described above, earlier and later versions of \fBview\fR obtain the +record name interactively if it is not supplied on the command line.) +.SH SEE ALSO +\fBpschart\fR(1) (for PostScript), \fBwave\fR(1) (for X11), \fBwview\fR(1) +(for MS-Windows) +.br +\fBsetwfdb\fR(1) +.SH AUTHOR +George B. Moody (george@mit.edu) +.SH SOURCE +http://www.physionet.org/physiotools/wfdb/app/view.c +.br +http://www.physionet.org/physiotools/wfdb/app/vsetup.c diff -Naur wfdb-10.3.1/doc/wag-src/view.1 wfdb-10.3.2/doc/wag-src/view.1 --- wfdb-10.3.1/doc/wag-src/view.1 Wed Jul 31 23:52:21 2002 +++ wfdb-10.3.2/doc/wag-src/view.1 Wed Dec 31 19:00:00 1969 @@ -1,191 +0,0 @@ -'\" t -.TH VIEW 1 "31 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" -.SH NAME -view, vsetup \- WFDB browser for MS-DOS -.SH SYNOPSIS -\fBview\fR -.br -\fBview\fR \fIrecord\fR -.br -\fBview\fR \fIrecord annotator\fR -.br -\fBview\fR \fIrecord annotator time\fR -.br -\fBview\fR \fIrecord annotator type\fR -.br -\fBvsetup\fR -.br -\fBvsetup -s\fR \fIfile \fR -.br -\fBvsetup\fR \fImode\fR -.SH DESCRIPTION -.PP -This program reads one or more signal files and an annotation file (if one is -available), and displays the signals with annotations at the standard -chart recorder scale of 25 mm/sec and 10 mm/mV on systems equipped with -a CGA, Hercules, EGA, VGA, or compatible graphics display adapter. Run -\fBvsetup\fR to determine a suitable display mode and scaling constants before -using \fBview\fR for the first time (see \fBvsetup\fR below). -.PP -If no \fIrecord\fR is specified on the command line, \fBview\fR asks for a -record name when it starts. If no \fIannotator\fR is specified on the command -line, \fBview\fR attempts to find an annotation file named \fIrecord\fB.atr\fR; -otherwise, it attempts to find one named \fIrecord\fB.\fIannotator\fR. -If the annotation file does not exist or cannot be read, \fBview\fR simply -displays the signals. A \fItime\fR argument, if present, causes \fBview\fR -to display its first screenful such that the left-hand edge of the screen -corresponds to the specified time. A \fItype\fR argument, if present, causes -\fBview\fR to search for the first occurrence of the specified annotation type -in the annotation file, and to center the first screenful on that annotation -if possible. -.PP -\fBview\fR is an interactive program. Once the first screenful has been -displayed, \fBview\fR waits for additional commands, which can be typed in the -prompt area near the bottom of the screen, and which are executed when you -press ENTER. These commands can be in any of the formats permissible for -\fItime\fR or \fItype\fR command-line arguments; such commands have the same -effect as if given on the command line. You may also merely press ENTER to see -the next screenful; if the previous action involved searching for an -annotation, this will cause \fBview\fR to search for the next occurrence of the -same annotation type that does not already appear on the screen. The \fBg\fR -command may be used to turn the grid display on or off; initially, the grid -display is off. When the grid is visible, it marks 0.2 second and 0.5 -millivolt intervals. The \fBm\fR command may be used to turn annotation -marker bars (dotted lines above and below each annotation showing the exact -location of the annotation fiducial mark) on or off; initially, annotation -marker bars are on. Finally, use the \fBx\fR command to exit from \fBview\fR -and return to the DOS prompt. -.PP -Current versions of \fBview\fR (4.0 and later) support the use of a mouse to -navigate through the record. If a mouse is available, \fBview\fR displays -buttons at the bottom of the screen; click left on these to move forward -or backward by whole or half screenfuls. If the mouse pointer is above the -level of the buttons, clicking left or right moves the pointer left or right -one annotation at a time, recentering the display if the pointer would -otherwise move out of the display region. -.PP -\fBvsetup\fR is used to calibrate your monitor for \fBview\fR. If \fBvsetup\fR -is able to identify a usable graphics mode, it will ask you to measure the -dimensions of a rectangle that it draws on your screen. When it finishes, it -will print instructions for setting an environment variable that is required -by \fBview\fR, unless you have used the \fB-s\fR option; in the latter case, -the MS-DOS command needed to set the variable is appended to the specified -\fIfile\fR. If your graphics adapter is capable of several display modes, -and you prefer to use a different mode from that selected by \fBvsetup\fR, you -can run \fBvsetup\fR with an integer argument that corresponds to your -preferred \fImode\fR, from among the following: -.br -.TS -center; -r l. -\fIArgument Display mode\fR -4 320 x 200, 4 colors -5 320 x 200, 4 grey levels -6 640 x 200, black and white -8 720 x 348, black and white [1] -13 320 x 200, 16 colors -14 640 x 200, 16 colors -15 640 x 350, black and white -16 640 x 350, 4 or 16 colors -17 640 x 480, black and white -18 640 x 480, 16 colors -19 320 x 200, 256 colors [2] -258 800 x 600, 16 colors [3] -259 800 x 600, 256 colors [2,3] -260 1024 x 768, 16 colors [3] -261 1024 x 768, 256 colors [2,3] -262 1280 x 1024, 16 colors [3] -263 1280 x 1024, 256 colors [2,3] -.TE -.PP -[1] Mode 8 can be used only with a Hercules Graphics Card, Graphics Card Plus, -Incolor Card, or a compatible. To use mode 8 with one of these cards, load -\fImsherc.com\fR (from the \fIbin\fR directory of your CD-ROM or software -distribution diskette, or from your Microsoft C, Pascal, or Fortran compiler -diskettes) before using \fBvsetup\fR or \fBview\fR. Do so by typing -\fImsherc\fR from within the directory where you find \fImsherc.com\fR (you -may wish to include this step in your \fIautoexec.bat\fR). If you have both a -Hercules monochrome card and a color video card in the same system, type -\fImsherc /h\fR instead. -.PP -[2] \fBview\fR uses at most 5 colors, so the 256-color modes offer no advantage -over the 16-color modes. In the 16- and 256-color modes, the background is -white; in the 4-color and black-and-white modes, the background is black. -.PP -[3] These modes can be used only with a VESA-compatible SVGA and a compatible -monitor. \fBvsetup\fR will not identify these modes automatically, because -of the potential for damage to your monitor if your SVGA card supports these -modes but your monitor does not. \fBDo not attempt to use these modes unless -your monitor supports them. Otherwise, you risk damaging your monitor.\fR -.SH ENVIRONMENT -.TP -\fBWFDB\fR -The database path: a list of directories that contain database files. An -empty component is taken to refer to the current directory. All applications -built with the \fBwfdb\fR(3) library search for their database input files in -the order specified by \fBWFDB\fR. If \fBWFDB\fR is not set, searches are limited to the builtin WFDB path (see \fBsetwfdb\fR(1). Under MS-DOS, directory -names are separated by semicolons (;), and the format of \fBWFDB\fR is that of -the MS-DOS \fBPATH\fR variable (colons may be used following drive specifiers -within \fBWFDB\fR in this case). -.TP -\fBWFDBCAL\fR -The name of the WFDB calibration file (see \fBwfdbcal\fR(5)), which -must be in a directory named by \fBWFDB\fR (see immediately above). -This file is used by \fBview\fR to determine standard scales for -signals other than ECGs. If \fBWFDBCAL\fR is not set, or if the file -named by \fBWFDBCAL\fR is not readable, these signals may be drawn at -incorrect scales. -.TP -\fBVIEWF\fR -The pathname for the font file containing characters to be drawn by \fBview\fR. -\fBVIEWF\fR should name a Microsoft Windows-compatible `\fI.fon\fR' file. By -default, if \fBVIEWF\fR is not set, \fBview\fR checks the \fBPATH\fR variable -to see if Microsoft Windows is available, and uses \fImodern.fon\fR in the -Windows \fIsystem\fR subdirectory if so, or a file of the same name in the -current directory if not; otherwise, \fBview\fR uses text mode to draw -characters. If you are using \fBview\fR in a DOS box under MS-Windows 95, you -will probably find \fImodern.fon\fR in the Windows \fIfonts\fR subdirectory, -and you should set \fBVIEWF\fR accordingly. Note that text mode character -placement is constrained to text mode character cells; annotations shown using -text mode will not be placed as precisely as those shown using graphics mode. -.TP -\fBVIEWP\fR -Instructions for setting this variable are printed by \fBvsetup\fR. The -format for the command to do so is -.br - \fBset VIEWP=\fR\fImode,left,right,top,bottom,width,height\fR -.br -where \fImode\fR is one of those specified in the table above, \fIleft\fR, -\fIright\fR, \fItop\fR, and \fIbottom\fR are the pixel column and row numbers -corresponding to the edges of the display area to be used by \fBview\fR, and -\fIwidth\fR and \fIheight\fR are the dimensions of the display area in -millimeters. -.PP -After determining appropriate values for these variables, you may wish to add -commands for setting them to your \fIautoexec.bat\fR file. The standard -installation procedure determines appropriate values interactively and inserts -the necessary commands into \fIsetwfdb.bat\fR (see \fBsetwfdb\fR(1)). -.SH CD-ROM VERSIONS -The first edition of the MIT-BIH Arrhythmia Database CD-ROM, the first and -second editions of the European ST-T Database CD-ROM, and the first edition of -the MIT-BIH Polysomnographic Database CD-ROM contain versions of \fBview\fR -that do not support color or greyscale output, SVGA display modes, -\fBVIEWF\fR, annotation marker bar display, or mouse interaction. -.PP -Later editions of the MIT-BIH Arrhythmia Database CD-ROM and of the MIT-BIH -Polysomnographic Database CD-ROM contain a version of \fBview\fR that supports -all of these features. Note that version 4.0, included on the second editions -of these CD-ROMs, requires that the record name be supplied on the command -line. (As described above, earlier and later versions of \fBview\fR obtain the -record name interactively if it is not supplied on the command line.) -.SH SEE ALSO -\fBpschart\fR(1) (for PostScript), \fBwave\fR(1) (for X11), \fBwview\fR(1) -(for MS-Windows) -.br -\fBsetwfdb\fR(1) -.SH AUTHOR -George B. Moody (george@mit.edu) -.SH SOURCE -http://www.physionet.org/physiotools/wfdb/app/view.c -.br -http://www.physionet.org/physiotools/wfdb/app/vsetup.c diff -Naur wfdb-10.3.1/doc/wag-src/wav2mit.1 wfdb-10.3.2/doc/wag-src/wav2mit.1 --- wfdb-10.3.1/doc/wag-src/wav2mit.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/doc/wag-src/wav2mit.1 Wed Feb 12 16:14:44 2003 @@ -0,0 +1,87 @@ +.TH WAV2MIT 1 "12 February 2003" "WFDB 10.3.2" "WFDB Applications Guide" +.SH NAME +wav2mit, mit2wav \- convert between .wav and MIT formats +.SH SYNOPSIS +\fBwav2mit -i\fR \fIfile\fR\fB.wav\fR [ \fIoptions\fR ... ] +.br +\fBmit2wav -o\fR \fIfile\fR\fB.wav\fR \fB-r\fR \fIrecord\fR [ \fIoptions\fR ... ] +.SH DESCRIPTION +.PP +These programs convert files in the widely-used \fB.wav\fR audio file +format into MIT-format files (as used in PhysioBank) and vice versa. +Most \fB.wav\fR files are already written in an MIT-compatible format, +although the reverse is not true. (An embedded header is required +by \fB.wav\fR format, and is allowed but is not usually present in MIT-format +signal files.) +.PP +\fBwav2mit\fR creates a WFDB (MIT-format) record from \fIfile\fR\fB.wav\fR. +If the input file is written in an MIT-compatible signal file format, +all that is required in this case is to create a suitable +MIT-format \fB.hea\fR header file that describes the \fB.wav\fR file's format. +Some \fB.wav\fR files are written using variants of the format that are not +compatible with MIT format; the current version of \fBwav2mit\fR does not +attempt to convert such files, but warns that they are not compatible. +Options for \fBwav2mit\fR include: +.TP +\fB-h\fR +Print a brief usage summary. +.TP +\fB-r\fR \fIrecord\fR +Create the specified \fIrecord\fR (default: use the base name of the input +file as the record name). +.PP +\fBmit2wav\fR reads the specified MIT-format \fIrecord\fR (header and signal +files) and creates a \fB.wav\fR file containing the same data. Note that +much of the data description contained in the MIT-format header file cannot +be preserved in the \fB.wav\fR file. Options for \fBmit2wav\fR include: +.TP +\fB-h\fR +Print a brief usage summary. +.TP +\fB-n\fR \fIrecord\fR +Create a header file for the output (\fB.wav\fR) signal file, so that it +can be read by WFDB applications as the specified \fIrecord\fR. + +.PP +It may be possible to create analog signals by playing the .wav file through +a sound card, but you should be aware of the following potential pitfalls: +.IP +Your sound card, and the software that comes with it, may not be able to +play \fB.wav\fR files containing three or more signals. If this is a problem, +you will need to extract one or two signals to include in the \fB.wav\fR file +from your original recording (for example, using \fBxform\fR(1)). +.IP +Your sound card and its software may be unable to play \fB.wav\fR files at +other than certain fixed sampling frequencies (typically 11025, 22050, and +44100 Hz). If this is a problem, you will need to resample the input at one of +the frequencies supported by your sound card (for example, using +\fBxform\fR(1)) before converting it to \fB.wav\fR format using this program. +.IP +Your sound card may not be able to reproduce the frequencies present in +the input. This is \fIvery\fR likely if you are trying to recreate physiologic +signals such as ECGs (with most of the useful information in the 0.1 to 30 +Hz band) using a consumer sound card (which probably does not reproduce +frequencies below the lower limit of human hearing (around 30 Hz). One +possible solution to this problem is to create a digital signal containing +a higher-frequency carrier signal, amplitude-modulated by the signal of +interest, and to convert this AM signal into a \fB.wav\fR file; on playback, +an analog AM demodulator would then recover the original low-frequency +signal of interest. If you successfully implement this solution, please +send details to the author. +.SH ENVIRONMENT +.PP +It may be necessary to set and export the shell variable \fBWFDB\fR (see +\fBsetwfdb\fR(1)). +.SH AVAILABILITY +These programs are provided in the \fIconvert\fR directory of the WFDB Software +Package. Run \fBmake\fR in that directory to compile and install them if they +have not been installed already. +.SH SEE ALSO +\fBa2m\fR(1), \fBedf2mit\fR, \fBsnip\fR(1), \fBxform\fR(1), \fBwfdb\fR(3), +\fBheader\fR(5) +.SH AUTHOR +George B. Moody (george@mit.edu) +.SH SOURCES +http://www.physionet.org/physiotools/wfdb/convert/wav2mit.c +.br +http://www.physionet.org/physiotools/wfdb/convert/mit2wav.c diff -Naur wfdb-10.3.1/doc/wpg-src/Makefile wfdb-10.3.2/doc/wpg-src/Makefile --- wfdb-10.3.1/doc/wpg-src/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/doc/wpg-src/Makefile Mon Feb 24 00:53:28 2003 @@ -65,12 +65,12 @@ # wpg.info' again. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -82,18 +82,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -140,7 +140,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. diff -Naur wfdb-10.3.1/doc/wpg-src/fixpg.sh wfdb-10.3.2/doc/wpg-src/fixpg.sh --- wfdb-10.3.1/doc/wpg-src/fixpg.sh Sun Jul 21 23:59:02 2002 +++ wfdb-10.3.2/doc/wpg-src/fixpg.sh Tue Jan 28 09:57:49 2003 @@ -42,3 +42,8 @@ if [ "x$R" != "x" ]; then ln -s $R strtim.htm else echo "Can't find strtim.htm" fi + +R=`grep -l "Compiling a Program with the WFDB Library " *.htm` +if [ "x$R" != "x" ]; then ln -s $R compiling.htm +else echo "Can't find compiling.htm" +fi diff -Naur wfdb-10.3.1/doc/wug-src/Makefile wfdb-10.3.2/doc/wug-src/Makefile --- wfdb-10.3.1/doc/wug-src/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/doc/wug-src/Makefile Mon Feb 24 00:53:28 2003 @@ -55,12 +55,12 @@ # PostScript 'make wug.ps' (requires latex and dvips) # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -72,18 +72,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -130,7 +130,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. diff -Naur wfdb-10.3.1/doc/wug-src/README wfdb-10.3.2/doc/wug-src/README --- wfdb-10.3.1/doc/wug-src/README Thu Dec 20 15:19:44 2001 +++ wfdb-10.3.2/doc/wug-src/README Tue Jan 28 11:21:11 2003 @@ -1,5 +1,5 @@ file: README G. Moody 7 September 1989 - Last revised: 20 December 2001 + Last revised: 28 January 2003 This directory contains the LaTeX source for the WAVE User's Guide. Under Unix, Linux, or under MS-Windows with the Cygwin toolkit, this material can be @@ -7,10 +7,10 @@ you have the necessary formatting software. Here is a brief list of available formats and the commands needed to produce them: - printed copy 'make ug' (requires troff, latex, dvips, and a printer) - HTML 'make ug.html' (requires latex2html and perl) - PDF 'make ug.pdf' (requires pdflatex) - PostScript 'make ug.ps' (requires latex and dvips) + printed copy 'make wug' (requires troff, latex, dvips, and a printer) + HTML 'make wug.html' (requires latex2html and perl) + PDF 'make wug.pdf' (requires pdflatex) + PostScript 'make wug.ps' (requires latex and dvips) All of these, with the exception of printed copies, can be downloaded from PhysioNet (look in http://www.physionet.org/physiotools/manuals.shtml). diff -Naur wfdb-10.3.1/doc/wug-src/wug0.tex wfdb-10.3.2/doc/wug-src/wug0.tex --- wfdb-10.3.1/doc/wug-src/wug0.tex Wed Aug 7 23:00:16 2002 +++ wfdb-10.3.2/doc/wug-src/wug0.tex Wed Feb 12 16:41:19 2003 @@ -1964,6 +1964,7 @@ Start}, {\sf End}, and {\sf Signal} fields of the {\sf Analyze} window, and running {\tt sqrs}, until you are familiar with the results. +\label{sec:analysis-example} \section{Analysis example: Generating a heart rate signal} In the rest of this exercise, we'll develop a command for generating a heart rate signal, add it to the \WAVE{} menu, and test it. First, set the {\sf @@ -6320,6 +6321,16 @@ signal windows with the master at any time. By synchronizing, we mean that the other windows are redrawn as necessary so that the times shown in their lower left corners match that shown in the master signal window. + +It is also possible to synchronize by clicking on a point of interest in the +master signal window. To do this, press and hold \keycap{Ctrl} while clicking +with the middle mouse button. The master signal window will be unaffected, +but the other windows are redrawn so that they begin at the time corresponding +to the point of interest. This feature is particularly useful if you have +a derived record such as in the heart rate signal analysis example (see +section~\ref{sec:analysis-example}) open in the master signal window, and +the raw signals in another window; you can then click on a feature in the +derived signal and instantly see the corresponding raw signals. Remote-control applications such as {\tt wavescript} and {\tt wave-remote} can also start or control a \WAVE{} process group. All signal windows in the diff -Naur wfdb-10.3.1/examples/Makefile wfdb-10.3.2/examples/Makefile --- wfdb-10.3.1/examples/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/examples/Makefile Mon Feb 24 00:53:28 2003 @@ -34,12 +34,12 @@ # `make clean' to remove them. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -51,18 +51,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -109,7 +109,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. diff -Naur wfdb-10.3.1/lib/Makefile wfdb-10.3.2/lib/Makefile --- wfdb-10.3.1/lib/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/lib/Makefile Mon Feb 24 00:53:28 2003 @@ -33,12 +33,12 @@ # type `make slib'. # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -50,7 +50,7 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # file: linux-slib.def G. Moody 31 May 2000 @@ -155,8 +155,8 @@ # `make lib-post-install' should be run after installing the WFDB library. lib-post-install: - cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_BASENAME) - cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_SONAME) + -(cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_SONAME)) + -(cd $(LIBDIR); ln -sf $(WFDBLIB_SONAME) $(WFDBLIB_BASENAME)) @$(LDCONFIG) || echo Warning: "$(LDCONFIG)" was unsuccessful lib-post-uninstall: @@ -200,7 +200,7 @@ # `make clean': also remove previously compiled versions of the library clean: - rm -f $(OFILES) libwfdb.* *~ + rm -f $(OFILES) libwfdb.* *~ wfdb.h wfdblib.h # `make TAGS': make an `emacs' TAGS file TAGS: $(HFILES) $(CFILES) diff -Naur wfdb-10.3.1/lib/Makefile.tpl wfdb-10.3.2/lib/Makefile.tpl --- wfdb-10.3.1/lib/Makefile.tpl Thu Nov 21 21:45:22 2002 +++ wfdb-10.3.2/lib/Makefile.tpl Wed Dec 18 14:43:07 2002 @@ -34,7 +34,7 @@ # `make clean': also remove previously compiled versions of the library clean: - rm -f $(OFILES) libwfdb.* *~ + rm -f $(OFILES) libwfdb.* *~ wfdb.h wfdblib.h # `make TAGS': make an `emacs' TAGS file TAGS: $(HFILES) $(CFILES) diff -Naur wfdb-10.3.1/lib/signal.c wfdb-10.3.2/lib/signal.c --- wfdb-10.3.1/lib/signal.c Wed Nov 27 15:55:38 2002 +++ wfdb-10.3.2/lib/signal.c Wed Feb 12 14:52:35 2003 @@ -1,10 +1,10 @@ /* file: signal.c G. Moody 13 April 1989 - Last revised: 22 November 2002 wfdblib 10.3.0 + Last revised: 12 February 2003 wfdblib 10.3.2 WFDB library functions for signals _______________________________________________________________________________ wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free @@ -202,6 +202,9 @@ static WFDB_Date bdate; /* base date (Julian date) */ static WFDB_Time nsamples; /* duration of signals (in samples) */ static double bcount; /* base count (counter value at sample 0) */ +static long prolog_bytes; /* length of prolog, as told to wfdbsetstart + (used only by setheader, if output signal + file(s) are not open) */ /* The next set of variables contains information about multi-segment records. The first two of them ('segments' and 'in_msrec') are used primarily as @@ -2263,11 +2266,13 @@ (void)wfdb_fprintf(oheader, "%s %d", siarray[s].fname, siarray[s].fmt); if (siarray[s].spf > 1) (void)wfdb_fprintf(oheader, "x%d", siarray[s].spf); - if (osd[s]->skew) + if (osd && osd[s]->skew) (void)wfdb_fprintf(oheader, ":%d", osd[s]->skew*siarray[s].spf); - if (ogd[osd[s]->info.group]->start) + if (ogd && ogd[osd[s]->info.group]->start) (void)wfdb_fprintf(oheader, "+%ld", ogd[osd[s]->info.group]->start); + else if (prolog_bytes) + (void)wfdb_fprintf(oheader, "+%ld", prolog_bytes); (void)wfdb_fprintf(oheader, " %g", siarray[s].gain); if (siarray[s].baseline != siarray[s].adczero) (void)wfdb_fprintf(oheader, "(%d)", siarray[s].baseline); @@ -2280,7 +2285,8 @@ (void)wfdb_fprintf(oheader, " %s", p); (void)wfdb_fprintf(oheader, "\r\n"); } - + prolog_bytes = 0L; + (void)wfdb_fflush(oheader); return (0); } @@ -2451,6 +2457,7 @@ { if (s < nosig) ogd[osd[s]->info.group]->start = bytes; + prolog_bytes = bytes; } FSTRING getinfo(record) diff -Naur wfdb-10.3.1/lib/wfdb.h wfdb-10.3.2/lib/wfdb.h --- wfdb-10.3.1/lib/wfdb.h Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/lib/wfdb.h Wed Dec 31 19:00:00 1969 @@ -1,378 +0,0 @@ -/* file: wfdb.h G. Moody 13 June 1983 - Last revised: 27 November 2002 wfdblib 10.3.1 -WFDB library type, constant, structure, and function interface definitions - -_______________________________________________________________________________ -wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 2002 George B. Moody - -This library is free software; you can redistribute it and/or modify it under -the terms of the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) any -later version. - -This library is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU Library General Public License for more -details. - -You should have received a copy of the GNU Library General Public License along -with this library; if not, write to the Free Software Foundation, Inc., 59 -Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -You may contact the author by e-mail (george@mit.edu) or postal mail -(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, -please visit PhysioNet (http://www.physionet.org/). -_______________________________________________________________________________ - -*/ - -#ifndef wfdb_WFDB_H /* avoid multiple definitions */ -#define wfdb_WFDB_H - -/* WFDB library version. */ -#define WFDB_MAJOR 10 -#define WFDB_MINOR 3 -#define WFDB_RELEASE 1 -#define WFDB_NETFILES 1 /* if 1, library includes code for HTTP, FTP clients */ - -/* Determine what type of compiler is being used. */ -#ifdef __STDC__ /* true for ANSI C compilers only */ -#define wfdb_PROTO /* function prototypes will be needed */ -#undef _WINDOWS /* we don't want MS-Windows API in this case */ -#undef _WIN32 /* ... or 32-bit MS-Windows API either */ -#endif - -#ifdef __cplusplus /* true for some C++ compilers */ -#define wfdb_CPP -#define wfdb_PROTO -#endif - -#ifdef c_plusplus /* true for some other C++ compilers */ -#define wfdb_CPP -#define wfdb_PROTO -#endif - -#ifdef _WIN32 /* true when compiling for 32-bit MS Windows */ -#ifndef _WINDOWS -#define _WINDOWS -#endif -#endif - -#ifdef _WINDOWS /* true when compiling for MS Windows */ -#define wfdb_PROTO -#endif - -#ifndef wfdb_PROTO /* should be true for K&R C compilers only */ -#define wfdb_KRC -#define signed -#endif - -/* Simple data types */ -typedef int WFDB_Sample; /* units are adus */ -typedef long WFDB_Time; /* units are sample intervals */ -typedef long WFDB_Date; /* units are days */ -typedef double WFDB_Frequency;/* units are Hz (samples/second/signal) */ -typedef double WFDB_Gain; /* units are adus per physical unit */ -typedef unsigned int WFDB_Group; /* signal group number */ -typedef unsigned int WFDB_Signal; /* signal number */ -typedef unsigned int WFDB_Annotator;/* annotator number */ - -/* Array sizes - Many older applications use the values of WFDB_MAXANN, WFDB_MAXSIG, and - WFDB_MAXSPF to determine array sizes, but (since WFDB library version 10.2) - there are no longer any fixed limits imposed by the WFDB library. -*/ -#define WFDB_MAXANN 2 /* maximum number of input or output annotators */ -#define WFDB_MAXSIG 32 /* maximum number of input or output signals */ -#define WFDB_MAXSPF 4 /* maximum number of samples per signal per frame */ -#define WFDB_MAXRNL 11 /* maximum length of record name */ -#define WFDB_MAXUSL 20 /* maximum length of WFDB_siginfo `.units' string */ -#define WFDB_MAXDSL 60 /* maximum length of WFDB_siginfo `.desc' string */ - -/* WFDB_anninfo '.stat' values */ -#define WFDB_READ 0 /* standard input annotation file */ -#define WFDB_WRITE 1 /* standard output annotation file */ -#define WFDB_AHA_READ 2 /* AHA-format input annotation file */ -#define WFDB_AHA_WRITE 3 /* AHA-format output annotation file */ - -/* WFDB_siginfo '.fmt' values -FMT_LIST is suitable as an initializer for a static array; it lists all of -the legal values for the format field in a WFDB_siginfo structure. - fmt meaning - 0 null signal (nothing read or written) - 8 8-bit first differences - 16 16-bit 2's complement amplitudes, low byte first - 61 16-bit 2's complement amplitudes, high byte first - 80 8-bit offset binary amplitudes - 160 16-bit offset binary amplitudes - 212 2 12-bit amplitudes bit-packed in 3 bytes - 310 3 10-bit amplitudes bit-packed in 4 bytes - 311 3 10-bit amplitudes bit-packed in 4 bytes -*/ -#define WFDB_FMT_LIST {0, 8, 16, 61, 80, 160, 212, 310, 311} -#define WFDB_NFMTS 9 /* number of items in FMT_LIST */ - -/* Default signal specifications */ -#define WFDB_DEFFREQ 250.0 /* default sampling frequency (Hz) */ -#define WFDB_DEFGAIN 200.0 /* default value for gain (adu/physical unit) */ -#define WFDB_DEFRES 12 /* default value for ADC resolution (bits) */ - -/* getvec operating modes */ -#define WFDB_LOWRES 0 /* return one sample per signal per frame */ -#define WFDB_HIGHRES 1 /* return each sample of oversampled signals, - duplicating samples of other signals */ -/* calinfo '.caltype' values -WFDB_AC_COUPLED and WFDB_DC_COUPLED are used in combination with the pulse -shape definitions below to characterize calibration pulses. */ -#define WFDB_AC_COUPLED 0 /* AC coupled signal */ -#define WFDB_DC_COUPLED 1 /* DC coupled signal */ -#define WFDB_CAL_SQUARE 2 /* square wave pulse */ -#define WFDB_CAL_SINE 4 /* sine wave pulse */ -#define WFDB_CAL_SAWTOOTH 6 /* sawtooth pulse */ -#define WFDB_CAL_UNDEF 8 /* undefined pulse shape */ - -/* Structure definitions */ -struct WFDB_siginfo { /* signal information structure */ - char *fname; /* filename of signal file */ - char *desc; /* signal description */ - char *units; /* physical units (mV unless otherwise specified) */ - WFDB_Gain gain; /* gain (ADC units/physical unit, 0: uncalibrated) */ - WFDB_Sample initval; /* initial value (that of sample number 0) */ - WFDB_Group group; /* signal group number */ - int fmt; /* format (8, 16, etc.) */ - int spf; /* samples per frame (>1 for oversampled signals) */ - int bsize; /* block size (for character special files only) */ - int adcres; /* ADC resolution in bits */ - int adczero; /* ADC output given 0 VDC input */ - int baseline; /* ADC output given 0 physical units input */ - long nsamp; /* number of samples (0: unspecified) */ - int cksum; /* 16-bit checksum of all samples */ -}; - -struct WFDB_calinfo { /* calibration information structure */ - double low; /* low level of calibration pulse in physical units */ - double high; /* high level of calibration pulse in physical units */ - double scale; /* customary plotting scale (physical units per cm) */ - char *sigtype; /* signal type */ - char *units; /* physical units */ - int caltype; /* calibration pulse type (see definitions above) */ -}; - -struct WFDB_anninfo { /* annotator information structure */ - char *name; /* annotator name */ - int stat; /* file type/access code (READ, WRITE, etc.) */ -}; - -struct WFDB_ann { /* annotation structure */ - WFDB_Time time; /* annotation time, in sample intervals from - the beginning of the record */ - char anntyp; /* annotation type (< ACMAX, see */ - signed char subtyp; /* annotation subtype */ - signed char chan; /* channel number */ - signed char num; /* annotator number */ - char *aux; /* pointer to auxiliary information */ -}; - -/* Composite data types */ -typedef struct WFDB_siginfo WFDB_Siginfo; -typedef struct WFDB_calinfo WFDB_Calinfo; -typedef struct WFDB_anninfo WFDB_Anninfo; -typedef struct WFDB_ann WFDB_Annotation; - -/* Function types */ -#ifndef _WINDOWS /* for everything *except* MS Windows applications */ -typedef char *FSTRING; -typedef WFDB_Date FDATE; -typedef double FDOUBLE; -typedef WFDB_Frequency FFREQUENCY; -typedef int FINT; -typedef long FLONGINT; -typedef WFDB_Sample FSAMPLE; -typedef WFDB_Time FSITIME; -typedef void FVOID; -#else -#ifndef _WIN32 /* for 16-bit MS Windows applications using the WFDB DLL */ - /* typedefs don't work properly with _far or _pascal -- must use #defines */ -#define FSTRING char _far * _pascal -#define FDATE WFDB_Date _far _pascal -#define FDOUBLE double _far _pascal -#define FFREQUENCY WFDB_Frequency _far _pascal -#define FINT int _far _pascal -#define FLONGINT long _far _pascal -#define FSAMPLE WFDB_Sample _far _pascal -#define FSITIME WFDB_Time _far _pascal -#define FVOID void _far _pascal -#else /* for 32-bit MS Windows applications using the WFDB DLL */ -#ifndef CALLBACK -#define CALLBACK __stdcall /* from windef.h */ -#endif -#define FSTRING __declspec (dllexport) char * CALLBACK -#define FDATE __declspec (dllexport) WFDB_Date CALLBACK -#define FDOUBLE __declspec (dllexport) double CALLBACK -#define FFREQUENCY __declspec (dllexport) WFDB_Frequency CALLBACK -#define FINT __declspec (dllexport) int CALLBACK -#define FLONGINT __declspec (dllexport) long CALLBACK -#define FSAMPLE __declspec (dllexport) WFDB_Sample CALLBACK -#define FSITIME __declspec (dllexport) WFDB_Time CALLBACK -#define FVOID __declspec (dllexport) void CALLBACK -#endif -#endif - -/* Specify C linkage for C++ compilers. */ -#ifdef wfdb_CPP -extern "C" { -#endif - -/* Define function prototypes for ANSI C compilers and C++ compilers */ -#ifdef wfdb_PROTO -extern FINT annopen(char *record, WFDB_Anninfo *aiarray, unsigned int nann); -extern FINT isigopen(char *record, WFDB_Siginfo *siarray, int nsig); -extern FINT osigopen(char *record, WFDB_Siginfo *siarray, unsigned int nsig); -extern FINT osigfopen(WFDB_Siginfo *siarray, unsigned int nsig); -extern FINT wfdbinit(char *record, WFDB_Anninfo *aiarray, unsigned int nann, - WFDB_Siginfo *siarray, unsigned int nsig); -extern FINT getspf(void); -extern FVOID setgvmode(int mode); -extern FINT setifreq(WFDB_Frequency freq); -extern FFREQUENCY getifreq(void); -extern FINT getvec(WFDB_Sample *vector); -extern FINT getframe(WFDB_Sample *vector); -extern FINT putvec(WFDB_Sample *vector); -extern FINT getann(WFDB_Annotator a, WFDB_Annotation *annot); -extern FINT ungetann(WFDB_Annotator a, WFDB_Annotation *annot); -extern FINT putann(WFDB_Annotator a, WFDB_Annotation *annot); -extern FINT isigsettime(WFDB_Time t); -extern FINT isgsettime(WFDB_Group g, WFDB_Time t); -extern FINT iannsettime(WFDB_Time t); -extern FSTRING ecgstr(int annotation_code); -extern FINT strecg(char *annotation_mnemonic_string); -extern FINT setecgstr(int annotation_code, char *annotation_mnemonic_string); -extern FSTRING annstr(int annotation_code); -extern FINT strann(char *annotation_mnemonic_string); -extern FINT setannstr(int annotation_code, char *annotation_mnemonic_string); -extern FSTRING anndesc(int annotation_code); -extern FINT setanndesc(int annotation_code, char *annotation_description); -extern FVOID iannclose(WFDB_Annotator a); -extern FVOID oannclose(WFDB_Annotator a); -extern FSTRING timstr(WFDB_Time t); -extern FSTRING mstimstr(WFDB_Time t); -extern FSITIME strtim(char *time_string); -extern FSTRING datstr(WFDB_Date d); -extern FDATE strdat(char *date_string); -extern FINT adumuv(WFDB_Signal s, WFDB_Sample a); -extern FSAMPLE muvadu(WFDB_Signal s, int microvolts); -extern FDOUBLE aduphys(WFDB_Signal s, WFDB_Sample a); -extern FSAMPLE physadu(WFDB_Signal s, double v); -extern FSAMPLE sample(WFDB_Signal s, WFDB_Time t); -extern FINT sample_valid(); -extern FINT calopen(char *calibration_filename); -extern FINT getcal(char *description, char *units, WFDB_Calinfo *cal); -extern FINT putcal(WFDB_Calinfo *cal); -extern FINT newcal(char *calibration_filename); -extern FVOID flushcal(void); -extern FSTRING getinfo(char *record); -extern FINT putinfo(char *info); -extern FINT newheader(char *record); -extern FINT setheader(char *record, WFDB_Siginfo *siarray, unsigned int nsig); -extern FINT setmsheader(char *record, char **segnames, unsigned int nsegments); -extern FINT wfdbgetskew(WFDB_Signal s); -extern FVOID wfdbsetskew(WFDB_Signal s, int skew); -extern FLONGINT wfdbgetstart(WFDB_Signal s); -extern FVOID wfdbsetstart(WFDB_Signal s, long bytes); -extern FVOID wfdbquit(void); -extern FFREQUENCY sampfreq(char *record); -extern FINT setsampfreq(WFDB_Frequency sampling_frequency); -extern FFREQUENCY getcfreq(void); -extern FVOID setcfreq(WFDB_Frequency counter_frequency); -extern FDOUBLE getbasecount(void); -extern FVOID setbasecount(double count); -extern FINT setbasetime(char *time_string); -extern FVOID wfdbquiet(void); -extern FVOID wfdbverbose(void); -extern FSTRING wfdberror(void); -extern FVOID setwfdb(char *database_path_string); -extern FSTRING getwfdb(void); -extern FINT setibsize(int input_buffer_size); -extern FINT setobsize(int output_buffer_size); -extern FSTRING wfdbfile(char *file_type, char *record); -extern FVOID wfdbflush(void); -#endif - -#ifdef wfdb_CPP -} -#endif - -#ifdef wfdb_KRC /* declare only function return types for K&R C compilers */ -extern FINT annopen(), isigopen(), osigopen(), wfdbinit(), getspf(), - setifreq(), getvec(), getframe(), putvec(), getann(), ungetann(), putann(), - isigsettime(), isgsettime(), iannsettime(), strecg(), setecgstr(), - strann(), setannstr(), setanndesc(), adumuv(), newheader(), setheader(), - setmsheader(), setsampfreq(), setbasetime(), putinfo(), setibsize(), - setobsize(), calopen(), getcal(), putcal(), newcal(), wfdbgetskew(), - sample_valid(); -extern FLONGINT wfdbgetstart(); -extern FSAMPLE muvadu(), physadu(), sample(); -extern FSTRING ecgstr(), annstr(), anndesc(), timstr(), mstimstr(), - datstr(), getwfdb(), getinfo(), wfdberror(), wfdbfile(); -extern FSITIME strtim(); -extern FDATE strdat(); -extern FVOID setgvmode(), wfdbquit(), wfdbquiet(), dbverbose(), setdb(), - wfdbflush(), setcfreq(), setbasecount(), flushcal(), wfdbsetskew(), - wfdbsetstart(); -extern FFREQUENCY getifreq(), sampfreq(), getcfreq(); -extern FDOUBLE aduphys(), getbasecount(); -#endif - -/* Remove local preprocessor definitions. */ -#ifdef wfdb_PROTO -#undef wfdb_PROTO -#endif - -#ifdef wfdb_CPP -#undef wfdb_CPP -#endif - -#ifdef wfdb_KRC -#undef wfdb_KRC -#undef signed -#endif - -/* Include some useful function declarations. This section includes standard - header files if available and provides alternative declarations for those - platforms that need them. - - The ANSI/ISO C standard requires conforming compilers to predefine __STDC__. - Non-conforming compilers for MS-Windows may or may not predefine _WINDOWS; - if you use such a compiler, you may need to define _WINDOWS manually. */ - -#if defined(__STDC__) || defined(_WINDOWS) -# include -#else -extern double atof(); -extern long atol(); -extern char *getenv(); -extern void exit(); -typedef long time_t; -# ifndef NOMALLOC_H -# include -# else -extern char *malloc(), *calloc(), *realloc(); -# endif -# ifdef ISPRINTF -extern int sprintf(); -# else -# ifndef MSDOS -extern char *sprintf(); -# endif -# endif -#endif - -#ifndef BSD -# include -#else /* for Berkeley UNIX only */ -# include -# define strchr index -#endif - -#endif diff -Naur wfdb-10.3.1/lib/wfdb.h0 wfdb-10.3.2/lib/wfdb.h0 --- wfdb-10.3.1/lib/wfdb.h0 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.2/lib/wfdb.h0 Wed Dec 18 14:37:27 2002 @@ -0,0 +1,378 @@ +/* file: wfdb.h G. Moody 13 June 1983 + Last revised: 17 December 2002 wfdblib 10.3.2 +WFDB library type, constant, structure, and function interface definitions + +_______________________________________________________________________________ +wfdb: a library for reading and writing annotated waveforms (time series data) +Copyright (C) 2002 George B. Moody + +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Library General Public License as published by the Free +Software Foundation; either version 2 of the License, or (at your option) any +later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU Library General Public License for more +details. + +You should have received a copy of the GNU Library General Public License along +with this library; if not, write to the Free Software Foundation, Inc., 59 +Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +You may contact the author by e-mail (george@mit.edu) or postal mail +(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, +please visit PhysioNet (http://www.physionet.org/). +_______________________________________________________________________________ + +*/ + +#ifndef wfdb_WFDB_H /* avoid multiple definitions */ +#define wfdb_WFDB_H + +/* WFDB library version. */ +#define WFDB_MAJOR 10 +#define WFDB_MINOR 3 +#define WFDB_RELEASE 2 +#define WFDB_NETFILES 1 /* if 1, library includes code for HTTP, FTP clients */ + +/* Determine what type of compiler is being used. */ +#ifdef __STDC__ /* true for ANSI C compilers only */ +#define wfdb_PROTO /* function prototypes will be needed */ +#undef _WINDOWS /* we don't want MS-Windows API in this case */ +#undef _WIN32 /* ... or 32-bit MS-Windows API either */ +#endif + +#ifdef __cplusplus /* true for some C++ compilers */ +#define wfdb_CPP +#define wfdb_PROTO +#endif + +#ifdef c_plusplus /* true for some other C++ compilers */ +#define wfdb_CPP +#define wfdb_PROTO +#endif + +#ifdef _WIN32 /* true when compiling for 32-bit MS Windows */ +#ifndef _WINDOWS +#define _WINDOWS +#endif +#endif + +#ifdef _WINDOWS /* true when compiling for MS Windows */ +#define wfdb_PROTO +#endif + +#ifndef wfdb_PROTO /* should be true for K&R C compilers only */ +#define wfdb_KRC +#define signed +#endif + +/* Simple data types */ +typedef int WFDB_Sample; /* units are adus */ +typedef long WFDB_Time; /* units are sample intervals */ +typedef long WFDB_Date; /* units are days */ +typedef double WFDB_Frequency;/* units are Hz (samples/second/signal) */ +typedef double WFDB_Gain; /* units are adus per physical unit */ +typedef unsigned int WFDB_Group; /* signal group number */ +typedef unsigned int WFDB_Signal; /* signal number */ +typedef unsigned int WFDB_Annotator;/* annotator number */ + +/* Array sizes + Many older applications use the values of WFDB_MAXANN, WFDB_MAXSIG, and + WFDB_MAXSPF to determine array sizes, but (since WFDB library version 10.2) + there are no longer any fixed limits imposed by the WFDB library. +*/ +#define WFDB_MAXANN 2 /* maximum number of input or output annotators */ +#define WFDB_MAXSIG 32 /* maximum number of input or output signals */ +#define WFDB_MAXSPF 4 /* maximum number of samples per signal per frame */ +#define WFDB_MAXRNL 11 /* maximum length of record name */ +#define WFDB_MAXUSL 20 /* maximum length of WFDB_siginfo `.units' string */ +#define WFDB_MAXDSL 60 /* maximum length of WFDB_siginfo `.desc' string */ + +/* WFDB_anninfo '.stat' values */ +#define WFDB_READ 0 /* standard input annotation file */ +#define WFDB_WRITE 1 /* standard output annotation file */ +#define WFDB_AHA_READ 2 /* AHA-format input annotation file */ +#define WFDB_AHA_WRITE 3 /* AHA-format output annotation file */ + +/* WFDB_siginfo '.fmt' values +FMT_LIST is suitable as an initializer for a static array; it lists all of +the legal values for the format field in a WFDB_siginfo structure. + fmt meaning + 0 null signal (nothing read or written) + 8 8-bit first differences + 16 16-bit 2's complement amplitudes, low byte first + 61 16-bit 2's complement amplitudes, high byte first + 80 8-bit offset binary amplitudes + 160 16-bit offset binary amplitudes + 212 2 12-bit amplitudes bit-packed in 3 bytes + 310 3 10-bit amplitudes bit-packed in 4 bytes + 311 3 10-bit amplitudes bit-packed in 4 bytes +*/ +#define WFDB_FMT_LIST {0, 8, 16, 61, 80, 160, 212, 310, 311} +#define WFDB_NFMTS 9 /* number of items in FMT_LIST */ + +/* Default signal specifications */ +#define WFDB_DEFFREQ 250.0 /* default sampling frequency (Hz) */ +#define WFDB_DEFGAIN 200.0 /* default value for gain (adu/physical unit) */ +#define WFDB_DEFRES 12 /* default value for ADC resolution (bits) */ + +/* getvec operating modes */ +#define WFDB_LOWRES 0 /* return one sample per signal per frame */ +#define WFDB_HIGHRES 1 /* return each sample of oversampled signals, + duplicating samples of other signals */ +/* calinfo '.caltype' values +WFDB_AC_COUPLED and WFDB_DC_COUPLED are used in combination with the pulse +shape definitions below to characterize calibration pulses. */ +#define WFDB_AC_COUPLED 0 /* AC coupled signal */ +#define WFDB_DC_COUPLED 1 /* DC coupled signal */ +#define WFDB_CAL_SQUARE 2 /* square wave pulse */ +#define WFDB_CAL_SINE 4 /* sine wave pulse */ +#define WFDB_CAL_SAWTOOTH 6 /* sawtooth pulse */ +#define WFDB_CAL_UNDEF 8 /* undefined pulse shape */ + +/* Structure definitions */ +struct WFDB_siginfo { /* signal information structure */ + char *fname; /* filename of signal file */ + char *desc; /* signal description */ + char *units; /* physical units (mV unless otherwise specified) */ + WFDB_Gain gain; /* gain (ADC units/physical unit, 0: uncalibrated) */ + WFDB_Sample initval; /* initial value (that of sample number 0) */ + WFDB_Group group; /* signal group number */ + int fmt; /* format (8, 16, etc.) */ + int spf; /* samples per frame (>1 for oversampled signals) */ + int bsize; /* block size (for character special files only) */ + int adcres; /* ADC resolution in bits */ + int adczero; /* ADC output given 0 VDC input */ + int baseline; /* ADC output given 0 physical units input */ + long nsamp; /* number of samples (0: unspecified) */ + int cksum; /* 16-bit checksum of all samples */ +}; + +struct WFDB_calinfo { /* calibration information structure */ + double low; /* low level of calibration pulse in physical units */ + double high; /* high level of calibration pulse in physical units */ + double scale; /* customary plotting scale (physical units per cm) */ + char *sigtype; /* signal type */ + char *units; /* physical units */ + int caltype; /* calibration pulse type (see definitions above) */ +}; + +struct WFDB_anninfo { /* annotator information structure */ + char *name; /* annotator name */ + int stat; /* file type/access code (READ, WRITE, etc.) */ +}; + +struct WFDB_ann { /* annotation structure */ + WFDB_Time time; /* annotation time, in sample intervals from + the beginning of the record */ + char anntyp; /* annotation type (< ACMAX, see */ + signed char subtyp; /* annotation subtype */ + signed char chan; /* channel number */ + signed char num; /* annotator number */ + char *aux; /* pointer to auxiliary information */ +}; + +/* Composite data types */ +typedef struct WFDB_siginfo WFDB_Siginfo; +typedef struct WFDB_calinfo WFDB_Calinfo; +typedef struct WFDB_anninfo WFDB_Anninfo; +typedef struct WFDB_ann WFDB_Annotation; + +/* Function types */ +#ifndef _WINDOWS /* for everything *except* MS Windows applications */ +typedef char *FSTRING; +typedef WFDB_Date FDATE; +typedef double FDOUBLE; +typedef WFDB_Frequency FFREQUENCY; +typedef int FINT; +typedef long FLONGINT; +typedef WFDB_Sample FSAMPLE; +typedef WFDB_Time FSITIME; +typedef void FVOID; +#else +#ifndef _WIN32 /* for 16-bit MS Windows applications using the WFDB DLL */ + /* typedefs don't work properly with _far or _pascal -- must use #defines */ +#define FSTRING char _far * _pascal +#define FDATE WFDB_Date _far _pascal +#define FDOUBLE double _far _pascal +#define FFREQUENCY WFDB_Frequency _far _pascal +#define FINT int _far _pascal +#define FLONGINT long _far _pascal +#define FSAMPLE WFDB_Sample _far _pascal +#define FSITIME WFDB_Time _far _pascal +#define FVOID void _far _pascal +#else /* for 32-bit MS Windows applications using the WFDB DLL */ +#ifndef CALLBACK +#define CALLBACK __stdcall /* from windef.h */ +#endif +#define FSTRING __declspec (dllexport) char * CALLBACK +#define FDATE __declspec (dllexport) WFDB_Date CALLBACK +#define FDOUBLE __declspec (dllexport) double CALLBACK +#define FFREQUENCY __declspec (dllexport) WFDB_Frequency CALLBACK +#define FINT __declspec (dllexport) int CALLBACK +#define FLONGINT __declspec (dllexport) long CALLBACK +#define FSAMPLE __declspec (dllexport) WFDB_Sample CALLBACK +#define FSITIME __declspec (dllexport) WFDB_Time CALLBACK +#define FVOID __declspec (dllexport) void CALLBACK +#endif +#endif + +/* Specify C linkage for C++ compilers. */ +#ifdef wfdb_CPP +extern "C" { +#endif + +/* Define function prototypes for ANSI C compilers and C++ compilers */ +#ifdef wfdb_PROTO +extern FINT annopen(char *record, WFDB_Anninfo *aiarray, unsigned int nann); +extern FINT isigopen(char *record, WFDB_Siginfo *siarray, int nsig); +extern FINT osigopen(char *record, WFDB_Siginfo *siarray, unsigned int nsig); +extern FINT osigfopen(WFDB_Siginfo *siarray, unsigned int nsig); +extern FINT wfdbinit(char *record, WFDB_Anninfo *aiarray, unsigned int nann, + WFDB_Siginfo *siarray, unsigned int nsig); +extern FINT getspf(void); +extern FVOID setgvmode(int mode); +extern FINT setifreq(WFDB_Frequency freq); +extern FFREQUENCY getifreq(void); +extern FINT getvec(WFDB_Sample *vector); +extern FINT getframe(WFDB_Sample *vector); +extern FINT putvec(WFDB_Sample *vector); +extern FINT getann(WFDB_Annotator a, WFDB_Annotation *annot); +extern FINT ungetann(WFDB_Annotator a, WFDB_Annotation *annot); +extern FINT putann(WFDB_Annotator a, WFDB_Annotation *annot); +extern FINT isigsettime(WFDB_Time t); +extern FINT isgsettime(WFDB_Group g, WFDB_Time t); +extern FINT iannsettime(WFDB_Time t); +extern FSTRING ecgstr(int annotation_code); +extern FINT strecg(char *annotation_mnemonic_string); +extern FINT setecgstr(int annotation_code, char *annotation_mnemonic_string); +extern FSTRING annstr(int annotation_code); +extern FINT strann(char *annotation_mnemonic_string); +extern FINT setannstr(int annotation_code, char *annotation_mnemonic_string); +extern FSTRING anndesc(int annotation_code); +extern FINT setanndesc(int annotation_code, char *annotation_description); +extern FVOID iannclose(WFDB_Annotator a); +extern FVOID oannclose(WFDB_Annotator a); +extern FSTRING timstr(WFDB_Time t); +extern FSTRING mstimstr(WFDB_Time t); +extern FSITIME strtim(char *time_string); +extern FSTRING datstr(WFDB_Date d); +extern FDATE strdat(char *date_string); +extern FINT adumuv(WFDB_Signal s, WFDB_Sample a); +extern FSAMPLE muvadu(WFDB_Signal s, int microvolts); +extern FDOUBLE aduphys(WFDB_Signal s, WFDB_Sample a); +extern FSAMPLE physadu(WFDB_Signal s, double v); +extern FSAMPLE sample(WFDB_Signal s, WFDB_Time t); +extern FINT sample_valid(); +extern FINT calopen(char *calibration_filename); +extern FINT getcal(char *description, char *units, WFDB_Calinfo *cal); +extern FINT putcal(WFDB_Calinfo *cal); +extern FINT newcal(char *calibration_filename); +extern FVOID flushcal(void); +extern FSTRING getinfo(char *record); +extern FINT putinfo(char *info); +extern FINT newheader(char *record); +extern FINT setheader(char *record, WFDB_Siginfo *siarray, unsigned int nsig); +extern FINT setmsheader(char *record, char **segnames, unsigned int nsegments); +extern FINT wfdbgetskew(WFDB_Signal s); +extern FVOID wfdbsetskew(WFDB_Signal s, int skew); +extern FLONGINT wfdbgetstart(WFDB_Signal s); +extern FVOID wfdbsetstart(WFDB_Signal s, long bytes); +extern FVOID wfdbquit(void); +extern FFREQUENCY sampfreq(char *record); +extern FINT setsampfreq(WFDB_Frequency sampling_frequency); +extern FFREQUENCY getcfreq(void); +extern FVOID setcfreq(WFDB_Frequency counter_frequency); +extern FDOUBLE getbasecount(void); +extern FVOID setbasecount(double count); +extern FINT setbasetime(char *time_string); +extern FVOID wfdbquiet(void); +extern FVOID wfdbverbose(void); +extern FSTRING wfdberror(void); +extern FVOID setwfdb(char *database_path_string); +extern FSTRING getwfdb(void); +extern FINT setibsize(int input_buffer_size); +extern FINT setobsize(int output_buffer_size); +extern FSTRING wfdbfile(char *file_type, char *record); +extern FVOID wfdbflush(void); +#endif + +#ifdef wfdb_CPP +} +#endif + +#ifdef wfdb_KRC /* declare only function return types for K&R C compilers */ +extern FINT annopen(), isigopen(), osigopen(), wfdbinit(), getspf(), + setifreq(), getvec(), getframe(), putvec(), getann(), ungetann(), putann(), + isigsettime(), isgsettime(), iannsettime(), strecg(), setecgstr(), + strann(), setannstr(), setanndesc(), adumuv(), newheader(), setheader(), + setmsheader(), setsampfreq(), setbasetime(), putinfo(), setibsize(), + setobsize(), calopen(), getcal(), putcal(), newcal(), wfdbgetskew(), + sample_valid(); +extern FLONGINT wfdbgetstart(); +extern FSAMPLE muvadu(), physadu(), sample(); +extern FSTRING ecgstr(), annstr(), anndesc(), timstr(), mstimstr(), + datstr(), getwfdb(), getinfo(), wfdberror(), wfdbfile(); +extern FSITIME strtim(); +extern FDATE strdat(); +extern FVOID setgvmode(), wfdbquit(), wfdbquiet(), dbverbose(), setdb(), + wfdbflush(), setcfreq(), setbasecount(), flushcal(), wfdbsetskew(), + wfdbsetstart(); +extern FFREQUENCY getifreq(), sampfreq(), getcfreq(); +extern FDOUBLE aduphys(), getbasecount(); +#endif + +/* Remove local preprocessor definitions. */ +#ifdef wfdb_PROTO +#undef wfdb_PROTO +#endif + +#ifdef wfdb_CPP +#undef wfdb_CPP +#endif + +#ifdef wfdb_KRC +#undef wfdb_KRC +#undef signed +#endif + +/* Include some useful function declarations. This section includes standard + header files if available and provides alternative declarations for those + platforms that need them. + + The ANSI/ISO C standard requires conforming compilers to predefine __STDC__. + Non-conforming compilers for MS-Windows may or may not predefine _WINDOWS; + if you use such a compiler, you may need to define _WINDOWS manually. */ + +#if defined(__STDC__) || defined(_WINDOWS) +# include +#else +extern double atof(); +extern long atol(); +extern char *getenv(); +extern void exit(); +typedef long time_t; +# ifndef NOMALLOC_H +# include +# else +extern char *malloc(), *calloc(), *realloc(); +# endif +# ifdef ISPRINTF +extern int sprintf(); +# else +# ifndef MSDOS +extern char *sprintf(); +# endif +# endif +#endif + +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif + +#endif diff -Naur wfdb-10.3.1/lib/wfdblib.h wfdb-10.3.2/lib/wfdblib.h --- wfdb-10.3.1/lib/wfdblib.h Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/lib/wfdblib.h Wed Dec 31 19:00:00 1969 @@ -1,336 +0,0 @@ -/* file: wfdblib.h G. Moody 13 April 1989 - Last revised: 14 November 2002 wfdblib 10.3.0 -External definitions for WFDB library private functions - -_______________________________________________________________________________ -wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 2002 George B. Moody - -This library is free software; you can redistribute it and/or modify it under -the terms of the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) any -later version. - -This library is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU Library General Public License for more -details. - -You should have received a copy of the GNU Library General Public License along -with this library; if not, write to the Free Software Foundation, Inc., 59 -Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -You may contact the author by e-mail (george@mit.edu) or postal mail -(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, -please visit PhysioNet (http://www.physionet.org/). -_______________________________________________________________________________ - -These definitions may be included in WFDB library source files to permit them -to share information about library private functions, which are not intended -to be invoked directly by user programs. By convention, all externally defined -symbols reserved to the library begin with the characters "wfdb_". -*/ - -#include "wfdb.h" - -/* Define the symbol _WINDLL if this library is to be compiled as a Microsoft - Windows DLL. Note that a DLL's private functions (such as those listed - below) *cannot* be called by Windows user programs, which can call only DLL - functions that use the Pascal calling interface (see wfdb.h). To compile - this library for use in a Microsoft Windows application, but *not* as a DLL, - define the symbol _WINDOWS instead of _WINDLL. */ -/* #define _WINDLL */ - -#if defined(_WINDLL) && !defined(_WINDOWS) -#define _WINDOWS -#endif - -#if defined(_WIN16) && !defined(_WINDOWS) -#define _WINDOWS -#endif - -#if defined(_WIN32) && !defined(_WINDOWS) -#define _WINDOWS -#endif - -#if defined(_WINDOWS) && !defined (_WIN16) && !defined(_WIN32) -#define _WIN16 -#endif - -#if defined(_WINDLL) -#define WFDBANNSORT 0 -#endif - -/* Define the symbol MSDOS if this library is to be used under MS-DOS or MS - Windows. Note: MSDOS is predefined by some MS-DOS and MS Windows compilers. -*/ -#if defined(_WINDOWS) -# if !defined(MSDOS) -# define MSDOS -# endif -#endif - -/* Uncomment the next line if this software is to be compiled on a Macintosh.*/ -/* #define MAC */ -/* Macintosh users only: If the version of "ISO 9660 File Access" in the - "System:Extensions" folder is earlier than 5.0, either update your system - software (recommended) or uncomment the next line. */ -/* #define FIXISOCD */ - -/* DEFWFDB is the default value of the WFDB path if the WFDB environment - variable is not set. This value is edited by the configuration script - (../configure), which also edits this block of comments to match. - - In most cases, it is sufficient to use the string ". /usr/database" for - this purpose, thus restricting the search for WFDB files to the current - directory ("."), followed by /usr/database). - - If WFDB_NETFILES support is enabled, the setting below adds the - web-accessible PhysioBank databases to the default path; you may wish to - change this to use a nearby PhysioNet mirror (for a list of mirrors, see - http://www.physionet.org/mirrors/). DEFWFDB must not be NULL, however. - The default given below for the Macintosh specifies that the WFDB path is to - be read from the file udb/dbpath.mac on the third edition of the MIT-BIH - Arrhythmia Database CD-ROM (which has a volume name of `MITADB3'); you may - prefer to use a file on a writable disk for this purpose to make - reconfiguration possible. See getwfdb() in wfdbio.c for further - information. -*/ -#ifdef MAC -# ifdef FIXISOCD -# define DEFWFDB "@MITADB3:UDB:DBPATH.MAC;1" -# else -# define DEFWFDB "@MITADB3:UDB:DBPATH.MAC" -# define __STDC__ -# endif -#else -# if WFDB_NETFILES -# define DEFWFDB ". /usr/database http://www.physionet.org/physiobank/database" -# else -# define DEFWFDB ". /usr/database" -# endif -#endif - -/* DEFWFDBCAL is the name of the default WFDB calibration file, used if the - WFDBCAL environment variable is not set. This name need not include path - information if the calibration file is located in a directory included in - the WFDB path. The value given below is the name of the standard - calibration file supplied on the various CD-ROM databases. DEFWFDBCAL may - be NULL if you prefer not to have a default calibration file. See calopen() - in calib.c for further information. */ -#define DEFWFDBCAL "wfdbcal" - -/* WFDB applications may write annotations out-of-order, but in almost all - cases, they expect that annotations they read must be in order. The - environment variable WFDBANNSORT specifies if wfdbquit() should attempt to - sort annotations in any output annotation files before closing them (it - does this if WFDBANNSORT is non-zero, or if WFDBANNSORT is not set, and - DEFWFDBANNSORT is non-zero). */ -#define DEFWFDBANNSORT 1 - -/* When reading multifrequency records, getvec() can operate in two modes: - WFDB_LOWRES (returning one sample per signal per frame), or WFDB_HIGHRES - (returning each sample of any oversampled signals, and duplicating samples - of other signals as necessary). If the operating mode is not selected by - invoking setgvmode(), the value of the environment variable WFDBGVMODE - determines the mode (0: WFDB_LOWRES, non-zero: WFDB_HIGHRES); if WFDBGVMODE - is not set, the value of DEFWFDBMODE determines the mode. */ -#define DEFWFDBGVMODE WFDB_LOWRES - -/* putenv() is available in POSIX, SVID, and BSD Unices and in MS-DOS and - 32-bit MS Windows, but not under 16-bit MS Windows or under MacOS. If it is - available, getwfdb() (in wfdbio.c) detects when the environment variables - WFDB, WFDBCAL, WFDBANNSORT, and WFDBGVMODE are not set, and sets them - according to DEFWFDB, DEFWFDBCAL, DEFWFDBANNSORT, and DEFWFDBGVMODE as - needed using putenv(). This feature is useful mainly for programs such as - WAVE, where these variables are set interactively and it is useful to show - their default values to the user; setwfdb() and getwfdb() do not depend on - it. -*/ -#if !defined(_WIN16) && !defined(MAC) -#define HAS_PUTENV -#endif - -#ifndef FILE -#include -/* stdin/stdout may not be defined in some environments (e.g., for MS Windows - DLLs). Defining them as NULL here allows the WFDB library to be compiled in - such environments (it does not allow use of stdin/stdout when the operating - environment does not provide them, however). */ -#ifndef stdin -#define stdin NULL -#endif -#ifndef stdout -#define stdout NULL -#endif -#endif - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -/* Structures used by internal WFDB library functions only */ -struct netfile { - char *url; - char *data; - int mode; - long base_addr; - long cont_len; - long pos; - long err; - int fd; -}; - -struct WFDB_FILE { - FILE *fp; - struct netfile *netfp; - int type; -}; - -/* Values for WFDB_FILE 'type' field */ -#define WFDB_LOCAL 0 /* a local file, read via C standard I/O */ -#define WFDB_NET 1 /* a remote file, read via libwww */ - -/* Composite data types */ -typedef struct netfile netfile; -typedef struct WFDB_FILE WFDB_FILE; - -/* To enable http and ftp access as well as standard (local file) I/O via the - WFDB library, define WFDB_NETFILES=1 and link with libwww (see 'Makefile'). - Otherwise, the WFDB library uses only the ANSI/ISO standard I/O library. */ -#if WFDB_NETFILES -#include -#include -#include - -#ifndef EROFS /* errno value: attempt to write to a read-only file system */ -#ifdef EINVAL -#define EROFS EINVAL -#else -#define EROFS 1 -#endif -#endif - -/* Constants */ -/* #define USEHTCACHE */ /* uncomment to enable caching by libwww */ - -/* http cache parameters (effective only if USEHTCACHE is defined) */ -#define CACHEDIR "/tmp" /* should be world-writable */ -#define CACHESIZE 100 /* max size of the entire http cache in MB */ -#define ENTRYSIZE 20 /* max size of a single cache entry in MB */ - -#define NF_PAGE_SIZE 32768 /* default bytes per http range request */ - -/* values for netfile 'err' field */ -#define NF_NO_ERR 0 /* no errors */ -#define NF_EOF_ERR 1 /* file pointer at EOF */ -#define NF_REAL_ERR 2 /* read request failed */ - -/* values for netfile 'mode' field */ -#define NF_CHUNK_MODE 0 /* http range requests supported */ -#define NF_FULL_MODE 1 /* http range requests not supported */ - -#else /* WFDB_NETFILES = 0 -- use standard I/O functions only */ - -#define wfdb_feof(wp) feof(wp->fp) -#define wfdb_ferror(wp) ferror(wp->fp) -#define wfdb_fflush(wp) ((wp == NULL) ? fflush(NULL) : fflush(wp->fp)) -#define wfdb_fgets(s, n, wp) fgets(s, n, wp->fp) -#define wfdb_fread(p, s, n, wp) fread(p, s, n, wp->fp) -#define wfdb_fseek(wp, o, w) fseek(wp->fp, o, w) -#define wfdb_ftell(wp) ftell(wp->fp) -#define wfdb_fwrite(p, s, n, wp) fwrite(p, s, n, wp->fp) -#define wfdb_getc(wp) getc(wp->fp) -#define wfdb_putc(c, wp) putc(c, wp->fp) - -#endif - -#ifdef _WINDOWS -#include /* needed for mkdir() declaration */ -#ifndef _WIN32 /* these definitions are needed for 16-bit MS Windows only */ -#define strcat _fstrcat -#define strchr _fstrchr -#define strcmp _fstrcmp -#define strcpy _fstrcpy -#define strlen _fstrlen -#define strncmp _fstrncmp -#define strtok _fstrtok -#endif -#endif - -/* Define function prototypes for ANSI C, MS Windows C, and C++ compilers */ -#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || defined(_WINDOWS) -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -/* These functions are defined in wfdbio.c */ -extern int wfdb_fclose(WFDB_FILE *fp); -extern WFDB_FILE *wfdb_open(char *file_type, char *record, int mode); -extern int wfdb_checkname(char *name, char *description); -extern int wfdb_g16(WFDB_FILE *fp); -extern long wfdb_g32(WFDB_FILE *fp); -extern void wfdb_p16(unsigned int x, WFDB_FILE *fp); -extern void wfdb_p32(long x, WFDB_FILE *fp); -extern int wfdb_parse_path(char *wfdb_path); -extern void wfdb_addtopath(char *pathname); -extern void wfdb_error(char *format_string, ...); -extern WFDB_FILE *wfdb_fopen(char *fname, const char *mode); -extern int wfdb_fprintf(WFDB_FILE *fp, const char *format, ...); -extern void wfdb_setirec(char *record_name); - -#if WFDB_NETFILES -extern void wfdb_clearerr(WFDB_FILE *fp); -extern int wfdb_feof(WFDB_FILE *fp); -extern int wfdb_ferror(WFDB_FILE *fp); -extern int wfdb_fflush(WFDB_FILE *fp); -extern char *wfdb_fgets(char *s, int size, WFDB_FILE *fp); -extern size_t wfdb_fread(void *ptr, size_t size, size_t nmemb, WFDB_FILE *fp); -extern int wfdb_fseek(WFDB_FILE *fp, long offset, int whence); -extern long wfdb_ftell(WFDB_FILE *fp); -extern size_t wfdb_fwrite(void *ptr, size_t size, size_t nmemb, WFDB_FILE *fp); -extern int wfdb_getc(WFDB_FILE *fp); -extern int wfdb_putc(int c, WFDB_FILE *fp); -extern void wfdb_wwwquit(void); -#endif - -/* These functions are defined in signal.c */ -extern void wfdb_sigclose(void); -extern void wfdb_osflush(void); - -/* These functions are defined in annot.c */ -extern void wfdb_anclose(void); -extern void wfdb_oaflush(void); - -#if defined(__cplusplus) || defined(c_plusplus) -} -#endif - -#else /* declare only function return types for non-ANSI C compilers */ - -extern WFDB_FILE *wfdb_open(), *wfdb_fopen(); -extern int wfdb_checkname(), wfdb_g16(), wfdb_parse_path(); -extern long wfdb_g32(); -extern void wfdb_p16(), wfdb_p32(), wfdb_addtopath(), wfdb_error(), - wfdb_setirec(), wfdb_sigclose(), wfdb_anclose(), wfdb_osflush(), - wfdb_oaflush(); - -# if WFDB_NETFILES -extern char *wfdb_fgets(); -extern int wfdb_feof(), wfdb_ferror(), wfdb_fflush(), wfdb_fseek(), - wfdb_getc(), wfdb_putc(); -extern long wfdb_ftell(); -extern size_t wfdb_fread(), wfdb_fwrite(); -extern void wfdb_clearerr(), wfdb_wwwquit(); -# endif - -/* Some non-ANSI C libraries (e.g., version 7, BSD 4.2) lack an implementation - of strtok(); define NOSTRTOK to compile the portable version in wfdbio.c. */ -# ifdef NOSTRTOK -extern char *strtok(); -# endif - -#endif diff -Naur wfdb-10.3.1/psd/Makefile wfdb-10.3.2/psd/Makefile --- wfdb-10.3.1/psd/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/psd/Makefile Mon Feb 24 00:53:28 2003 @@ -32,12 +32,12 @@ # directory). # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -49,18 +49,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -107,7 +107,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -215,7 +215,7 @@ echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 13 December 2001 +# Last revised: 19 February 2003 # This section of the Makefile should not need to be changed. # Programs to be compiled. @@ -234,15 +234,18 @@ ../install.sh $(BINDIR) $(XFILES) $(MAKE) clean -# `make scripts': customize and install scripts +# `make scripts': install scripts scripts: - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrfft - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrlomb - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrmem - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrplot + cp $(SCRIPTS) $(BINDIR) + cd $(BINDIR); $(SETXPERMISSIONS) $(SCRIPTS) + +# `make custom-scripts': customize and install scripts + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrfft + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrlomb + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrmem + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrplot cp plot2d plot3d $(BINDIR) - $(SETXPERMISSIONS) $(BINDIR)/hrfft $(BINDIR)/hrlomb $(BINDIR)/hrmem \ - $(BINDIR)/hrplot $(BINDIR)/plot2d $(BINDIR)/plot3d + cd $(BINDIR); $(SETXPERMISSIONS) $(SCRIPTS) uninstall: ../uninstall.sh $(BINDIR) $(XFILES) $(SCRIPTS) diff -Naur wfdb-10.3.1/psd/Makefile.tpl wfdb-10.3.2/psd/Makefile.tpl --- wfdb-10.3.1/psd/Makefile.tpl Fri Dec 14 15:03:03 2001 +++ wfdb-10.3.2/psd/Makefile.tpl Wed Feb 19 22:15:06 2003 @@ -1,5 +1,5 @@ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 13 December 2001 +# Last revised: 19 February 2003 # This section of the Makefile should not need to be changed. # Programs to be compiled. @@ -18,15 +18,18 @@ ../install.sh $(BINDIR) $(XFILES) $(MAKE) clean -# `make scripts': customize and install scripts +# `make scripts': install scripts scripts: - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrfft - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrlomb - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrmem - sed s+/usr/local/bin+$(BINDIR)+g $(BINDIR)/hrplot + cp $(SCRIPTS) $(BINDIR) + cd $(BINDIR); $(SETXPERMISSIONS) $(SCRIPTS) + +# `make custom-scripts': customize and install scripts + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrfft + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrlomb + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrmem + sed s+BINDIR+$(BINDIR)+g $(BINDIR)/hrplot cp plot2d plot3d $(BINDIR) - $(SETXPERMISSIONS) $(BINDIR)/hrfft $(BINDIR)/hrlomb $(BINDIR)/hrmem \ - $(BINDIR)/hrplot $(BINDIR)/plot2d $(BINDIR)/plot3d + cd $(BINDIR); $(SETXPERMISSIONS) $(SCRIPTS) uninstall: ../uninstall.sh $(BINDIR) $(XFILES) $(SCRIPTS) diff -Naur wfdb-10.3.1/psd/hrfft wfdb-10.3.2/psd/hrfft --- wfdb-10.3.1/psd/hrfft Mon Dec 10 16:55:16 2001 +++ wfdb-10.3.2/psd/hrfft Wed Feb 19 22:20:04 2003 @@ -1,10 +1,10 @@ #! /bin/sh # file: hrfft G. Moody 14 June 1995 -# Last revised: 10 December 2001 +# Last revised: 19 February 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate power spectrum (using tach and fft) and plot it -# Copyright (C) 1999 George B. Moody +# Copyright (C) 2003 George B. Moody # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -40,10 +40,14 @@ done if [ x$PLOT = x ]; then - if [ -x /usr/local/bin/plt ]; then + if [ -x BINDIR/plt ]; then + PLOT=BINDIR/plt + elif [ -x /usr/local/bin/plt ]; then PLOT=/usr/local/bin/plt elif [ -x /usr/bin/plt ]; then PLOT=/usr/bin/plt + elif [ -x BINDIR/plot2d ]; then + PLOT=BINDIR/plot2d elif [ -x /usr/local/bin/plot2d ]; then PLOT=/usr/local/bin/plot2d elif [ -x /usr/bin/plot2d ]; then diff -Naur wfdb-10.3.1/psd/hrlomb wfdb-10.3.2/psd/hrlomb --- wfdb-10.3.1/psd/hrlomb Mon Dec 10 16:55:01 2001 +++ wfdb-10.3.2/psd/hrlomb Wed Feb 19 22:19:56 2003 @@ -1,10 +1,10 @@ #! /bin/sh # file: hrlomb G. Moody 14 June 1995 -# Last revised: 10 December 2001 +# Last revised: 19 February 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate power spectrum (using ihr and lomb) and plot it -# Copyright (C) 1999 George B. Moody +# Copyright (C) 2003 George B. Moody # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -41,10 +41,14 @@ if [ x$PLOT = x ]; then - if [ -x /usr/local/bin/plt ]; then + if [ -x BINDIR/plt ]; then + PLOT=BINDIR/plt + elif [ -x /usr/local/bin/plt ]; then PLOT=/usr/local/bin/plt elif [ -x /usr/bin/plt ]; then PLOT=/usr/bin/plt + elif [ -x BINDIR/plot2d ]; then + PLOT=BINDIR/plot2d elif [ -x /usr/local/bin/plot2d ]; then PLOT=/usr/local/bin/plot2d elif [ -x /usr/bin/plot2d ]; then diff -Naur wfdb-10.3.1/psd/hrmem wfdb-10.3.2/psd/hrmem --- wfdb-10.3.1/psd/hrmem Mon Dec 10 16:58:11 2001 +++ wfdb-10.3.2/psd/hrmem Wed Feb 19 22:19:47 2003 @@ -1,10 +1,10 @@ #! /bin/sh # file: hrmem G. Moody 14 June 1995 -# Last revised: 10 December 2001 +# Last revised: 18 February 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate power spectrum (using tach and memse) and plot it -# Copyright (C) 1999 George B. Moody +# Copyright (C) 2003 George B. Moody # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -40,10 +40,14 @@ done if [ x$PLOT = x ]; then - if [ -x /usr/local/bin/plt ]; then + if [ -x BINDIR/plt ]; then + PLOT=BINDIR/plt + elif [ -x /usr/local/bin/plt ]; then PLOT=/usr/local/bin/plt elif [ -x /usr/bin/plt ]; then PLOT=/usr/bin/plt + elif [ -x BINDIR/plot2d ]; then + PLOT=BINDIR/plot2d elif [ -x /usr/local/bin/plot2d ]; then PLOT=/usr/local/bin/plot2d elif [ -x /usr/bin/plot2d ]; then diff -Naur wfdb-10.3.1/psd/hrplot wfdb-10.3.2/psd/hrplot --- wfdb-10.3.1/psd/hrplot Mon Dec 10 16:58:05 2001 +++ wfdb-10.3.2/psd/hrplot Wed Feb 19 22:19:39 2003 @@ -1,10 +1,10 @@ #! /bin/sh # file: hrplot G. Moody 14 June 1995 -# Last revised: 10 December 2001 +# Last revised: 19 February 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate time series (using ihr) and plot it -# Copyright (C) 1999 George B. Moody +# Copyright (C) 2003 George B. Moody # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -40,10 +40,14 @@ done if [ x$PLOT = x ]; then - if [ -x /usr/local/bin/plt ]; then + if [ -x BINDIR/plt ]; then + PLOT=BINDIR/plt + elif [ -x /usr/local/bin/plt ]; then PLOT=/usr/local/bin/plt elif [ -x /usr/bin/plt ]; then PLOT=/usr/bin/plt + elif [ -x BINDIR/plot2d ]; then + PLOT=BINDIR/plot2d elif [ -x /usr/local/bin/plot2d ]; then PLOT=/usr/local/bin/plot2d elif [ -x /usr/bin/plot2d ]; then diff -Naur wfdb-10.3.1/wave/Makefile wfdb-10.3.2/wave/Makefile --- wfdb-10.3.1/wave/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/wave/Makefile Mon Feb 24 00:53:28 2003 @@ -45,12 +45,12 @@ # just type `make' (from within this directory). # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -62,18 +62,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -120,7 +120,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. @@ -228,7 +228,7 @@ echo "Nothing to be done for lib-post-uninstall" # _____________________________________________________________________________ # file: Makefile.tpl G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # Change the settings below as appropriate for your setup. # Choose directories in which to install WAVE and its ancillary files by @@ -266,30 +266,25 @@ grid.c sig.c annot.c analyze.c scope.c search.c xvwave.c help.c OFILES = wave.o init.o mainpan.o modepan.o helppan.o logpan.o annpan.o edit.o \ grid.o sig.o annot.o analyze.o scope.o search.o xvwave.o $(HELPOBJ) -HELPFILES = analysis.hlp buttons.hlp editing.hlp intro.hlp log.hlp \ +HELPFILES = analysis.hlp buttons.hlp editing.hlp intro.hlp log.hlp news.hlp \ printing.hlp resource.hlp -OTHERFILES = wave.hl0 wave.info wave.pro demo.txt Wave.res wavemenu.def \ - Makefile +OTHERFILES = wave.hl0 wave.info demo.txt Wave.res wavemenu.def Makefile all: wave # `make install': compile and install WAVE and its help files -install: $(BINDIR) $(HELPDIR)/wave $(MENUDIR) $(RESDIR) wave wave.hlp - sed s/WAVEVERSION/$(WAVEVERSION)/ wave.pro +install: $(BINDIR) $(HELPDIR)/wave $(MENUDIR) $(RESDIR) wave wave.hlp news.hlp $(STRIP) wave; $(SETXPERMISSIONS) wave; ../install.sh $(BINDIR) wave - cp $(HELPFILES) wave.hlp wave.info wave.pro demo.txt $(HELPDIR)/wave - -ln -sf $(HELPDIR)/wave/wave.pro $(HELPDIR)/wave/news.hlp - cd $(HELPDIR)/wave; $(SETPERMISSIONS) $(HELPFILES) news.hlp wave.info \ - wave.pro demo.txt + cp $(HELPFILES) wave.hlp wave.info demo.txt $(HELPDIR)/wave + cd $(HELPDIR)/wave; $(SETPERMISSIONS) $(HELPFILES) wave.info demo.txt -cp wavemenu.def $(MENUDIR) && \ $(SETPERMISSIONS) $(MENUDIR)/wavemenu.def -cp Wave.res $(RESDIR)/Wave && $(SETPERMISSIONS) $(RESDIR)/Wave uninstall: ../uninstall.sh $(BINDIR) wave - ../uninstall.sh $(HELPDIR)/wave $(HELPFILES) wave.hlp wave.info wave.pro \ - demo.txt news.hlp + ../uninstall.sh $(HELPDIR)/wave $(HELPFILES) wave.hlp wave.info \ + demo.txt rmdir $(HELPDIR) || echo "(Ignored)" ../uninstall.sh $(MENUDIR) wavemenu.def ../uninstall.sh $(RESDIR) Wave @@ -327,9 +322,9 @@ wave.hlp: soelim wave.hl0 $(HELPFILES) ./soelim wave.hl0 >wave.hlp -wave.pro: +news.hlp: sed s/WAVEVERSION/$(WAVEVERSION)/ wave.pro + sed "s%HELPDIR%$(HELPDIR)%" >news.hlp # `make manual': print the on-line manual manual: @@ -345,10 +340,10 @@ # `make clean': remove intermediate and backup files clean: - rm -f soelim wave wave-static *.o *~ wave.hlp wave.pro + rm -f soelim wave wave-static *.o *~ wave.hlp news.hlp # `make listing': print a listing of WAVE sources -listing: wave.hlp wave.pro +listing: wave.hlp news.hlp $(PRINT) README REGCARD $(HFILES) $(CFILES) $(HELPFILES) $(OTHERFILES) # Dependencies and special rules for compilation of the modules of `wave' diff -Naur wfdb-10.3.1/wave/Makefile.tpl wfdb-10.3.2/wave/Makefile.tpl --- wfdb-10.3.1/wave/Makefile.tpl Thu Nov 21 20:21:51 2002 +++ wfdb-10.3.2/wave/Makefile.tpl Sun Feb 23 22:58:25 2003 @@ -1,5 +1,5 @@ # file: Makefile.tpl G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # Change the settings below as appropriate for your setup. # Choose directories in which to install WAVE and its ancillary files by @@ -37,30 +37,25 @@ grid.c sig.c annot.c analyze.c scope.c search.c xvwave.c help.c OFILES = wave.o init.o mainpan.o modepan.o helppan.o logpan.o annpan.o edit.o \ grid.o sig.o annot.o analyze.o scope.o search.o xvwave.o $(HELPOBJ) -HELPFILES = analysis.hlp buttons.hlp editing.hlp intro.hlp log.hlp \ +HELPFILES = analysis.hlp buttons.hlp editing.hlp intro.hlp log.hlp news.hlp \ printing.hlp resource.hlp -OTHERFILES = wave.hl0 wave.info wave.pro demo.txt Wave.res wavemenu.def \ - Makefile +OTHERFILES = wave.hl0 wave.info demo.txt Wave.res wavemenu.def Makefile all: wave # `make install': compile and install WAVE and its help files -install: $(BINDIR) $(HELPDIR)/wave $(MENUDIR) $(RESDIR) wave wave.hlp - sed s/WAVEVERSION/$(WAVEVERSION)/ wave.pro +install: $(BINDIR) $(HELPDIR)/wave $(MENUDIR) $(RESDIR) wave wave.hlp news.hlp $(STRIP) wave; $(SETXPERMISSIONS) wave; ../install.sh $(BINDIR) wave - cp $(HELPFILES) wave.hlp wave.info wave.pro demo.txt $(HELPDIR)/wave - -ln -sf $(HELPDIR)/wave/wave.pro $(HELPDIR)/wave/news.hlp - cd $(HELPDIR)/wave; $(SETPERMISSIONS) $(HELPFILES) news.hlp wave.info \ - wave.pro demo.txt + cp $(HELPFILES) wave.hlp wave.info demo.txt $(HELPDIR)/wave + cd $(HELPDIR)/wave; $(SETPERMISSIONS) $(HELPFILES) wave.info demo.txt -cp wavemenu.def $(MENUDIR) && \ $(SETPERMISSIONS) $(MENUDIR)/wavemenu.def -cp Wave.res $(RESDIR)/Wave && $(SETPERMISSIONS) $(RESDIR)/Wave uninstall: ../uninstall.sh $(BINDIR) wave - ../uninstall.sh $(HELPDIR)/wave $(HELPFILES) wave.hlp wave.info wave.pro \ - demo.txt news.hlp + ../uninstall.sh $(HELPDIR)/wave $(HELPFILES) wave.hlp wave.info \ + demo.txt rmdir $(HELPDIR) || echo "(Ignored)" ../uninstall.sh $(MENUDIR) wavemenu.def ../uninstall.sh $(RESDIR) Wave @@ -98,9 +93,9 @@ wave.hlp: soelim wave.hl0 $(HELPFILES) ./soelim wave.hl0 >wave.hlp -wave.pro: +news.hlp: sed s/WAVEVERSION/$(WAVEVERSION)/ wave.pro + sed "s%HELPDIR%$(HELPDIR)%" >news.hlp # `make manual': print the on-line manual manual: @@ -116,10 +111,10 @@ # `make clean': remove intermediate and backup files clean: - rm -f soelim wave wave-static *.o *~ wave.hlp wave.pro + rm -f soelim wave wave-static *.o *~ wave.hlp news.hlp # `make listing': print a listing of WAVE sources -listing: wave.hlp wave.pro +listing: wave.hlp news.hlp $(PRINT) README REGCARD $(HFILES) $(CFILES) $(HELPFILES) $(OTHERFILES) # Dependencies and special rules for compilation of the modules of `wave' diff -Naur wfdb-10.3.1/wave/edit.c wfdb-10.3.2/wave/edit.c --- wfdb-10.3.1/wave/edit.c Sun Oct 14 14:04:06 2001 +++ wfdb-10.3.2/wave/edit.c Wed Feb 12 10:49:57 2003 @@ -1,10 +1,10 @@ /* file: edit.c G. Moody 1 May 1990 - Last revised: 14 October 2001 + Last revised: 12 February 2003 Annotation-editing functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2001 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1013,13 +1013,23 @@ /* The middle button was pressed: 1. If the left or right button is down, ignore this event. 2. Draw marker bars above and below the pointer. - 3. If there is an attached annotation, and the pointer is + 3. If the key is depressed and this instance of + WAVE has a sync button, signal other WAVE processes to + recenter their signal windows at the time indicated by + the mouse, and return. + 4. If there is an attached annotation, and the pointer is outside the box, detach the annotation (erase the box). */ if (left_down || right_down || ann_template.anntyp < 0) break; middle_down = 1; bar(x, y /* ? */, 1); - if (attached && !in_box(x, y)) + if (event_ctrl_is_down(event) && wave_ppid) { + char buf[80]; + sprintf(buf, "wave-remote -pid %d -f '%s'\n", wave_ppid, + mstimstr(-t)); + system(buf); + } + else if (attached && !in_box(x, y)) detach_ann(); break; } diff -Naur wfdb-10.3.1/wave/intro.hlp wfdb-10.3.2/wave/intro.hlp --- wfdb-10.3.1/wave/intro.hlp Fri Nov 16 16:05:43 2001 +++ wfdb-10.3.2/wave/intro.hlp Sun Dec 8 03:42:00 2002 @@ -1,15 +1,15 @@ WAVE: Waveform Analyzer, Viewer, and Editor -Copyright (C) 1990-2001 George B. Moody +Copyright (C) 1990-2002 George B. Moody WAVE is an extensible interactive graphical environment for manipulating sets of digitized signals with optional annotations. WAVE is built using the WFDB library developed for physiologic signal processing, so it can be applied to any of a wide variety of data formats supported by the WFDB library. WAVE can run on Linux PCs, Sun workstations, and other systems that support the X -Window System and the public-domain XView toolkit; in addition, it can be -accessed remotely using networked PCs, Macintoshes, or other systems for which -X11 servers are available. +Window System and the free XView toolkit; in addition, it can be accessed +remotely using networked PCs, Macintoshes, or other systems for which X11 +servers are available. Among WAVE's capabilities are: - fast display of waveforms and annotations at various calibrated scales @@ -29,6 +29,11 @@ is no HELP key) for information about that control. (If your window manager does not cooperate, this may not work; in that case, select `Buttons' from the `Help Topics' panel for information about controls.) + +The answers to many frequently asked questions about WAVE can be found in +the WAVE FAQ (http://www.physionet.org/physiotools/wug/wave-faq.htm), which +is part of the WAVE User's Guide (http://www.physionet.org/physiotools/wug/), +a book-length tutorial and reference manual for WAVE. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff -Naur wfdb-10.3.1/wave/mainpan.c wfdb-10.3.2/wave/mainpan.c --- wfdb-10.3.1/wave/mainpan.c Sun Mar 10 09:38:58 2002 +++ wfdb-10.3.2/wave/mainpan.c Wed Dec 18 14:21:37 2002 @@ -1,5 +1,5 @@ /* file: mainpan.c G. Moody 30 April 1990 - Last revised: 10 March 2002 + Last revised: 18 December 2002 Functions for the main control panel of WAVE ------------------------------------------------------------------------------- @@ -440,7 +440,7 @@ static void prop_wave() { - sprintf(filename, "%s/wave/wave.pro", helpdir); + sprintf(filename, "%s/wave/news.hlp", helpdir); title = "About WAVE"; show_file(); } diff -Naur wfdb-10.3.1/wave/nomake wfdb-10.3.2/wave/nomake --- wfdb-10.3.1/wave/nomake Mon Jun 5 23:31:48 2000 +++ wfdb-10.3.2/wave/nomake Wed Dec 18 14:22:34 2002 @@ -1,5 +1,5 @@ # file: nomake G. Moody 30 January 2000 -# Last revised: 5 June 2000 +# Last revised: 18 December 2002 # If renamed as 'Makefile', this file prevents WAVE from being compiled # on systems that don't have XView installed. @@ -16,4 +16,4 @@ @echo "Nothing to uninstall from wave" clean: - rm -f soelim wave wave-static *.o *~ wave.hlp wave.pro + rm -f soelim wave wave-static *.o *~ wave.hlp news.hlp diff -Naur wfdb-10.3.1/wave/sig.c wfdb-10.3.2/wave/sig.c --- wfdb-10.3.1/wave/sig.c Sat Oct 13 15:54:49 2001 +++ wfdb-10.3.2/wave/sig.c Thu Feb 13 10:47:54 2003 @@ -1,10 +1,10 @@ /* file: sig.c G. Moody 27 April 1990 - Last revised: 13 October 2001 + Last revised: 13 February 2003 Signal display functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2001 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -64,7 +64,7 @@ } else for (i = 0; i < siglistlen; i++) { - if (lp->vlist[siglist[i]]) { + if (0 <= siglist[i] && siglist[i] < nsig && lp->vlist[siglist[i]]){ lp->vlist[siglist[i]][0].y += base[i]; XDrawLines(display, xid, draw_sig, lp->vlist[siglist[i]], lp->ndpts, CoordModePrevious); @@ -445,8 +445,9 @@ signame[i], strlen(signame[i])); else for (i = 0; i < siglistlen; i++) - XDrawString(display, xid, draw_sig, xoff, base[i] - yoff, - signame[siglist[i]], strlen(signame[siglist[i]])); + if (0 <= siglist[i] && siglist[i] < nsig) + XDrawString(display, xid, draw_sig, xoff, base[i] - yoff, + signame[siglist[i]], strlen(signame[siglist[i]])); } static void show_signal_baselines(lp) diff -Naur wfdb-10.3.1/wave/wave.hl0 wfdb-10.3.2/wave/wave.hl0 --- wfdb-10.3.1/wave/wave.hl0 Mon Dec 17 22:08:50 2001 +++ wfdb-10.3.2/wave/wave.hl0 Sun Dec 8 03:38:41 2002 @@ -13,7 +13,6 @@ . WAVE Logs . Printing . Setting WAVE Resources - . Frequently Asked Questions Before You Begin ================ @@ -35,19 +34,23 @@ keyboard in front of you do not belong to the system on which WAVE runs, but instead belong to another system on the same network), you may need to perform a few preparatory steps. See `How can I use WAVE from an X -terminal/PC/Mac/etc?' (below) for details. +terminal/PC/Mac/etc?' in the WAVE FAQ for details. Before running WAVE for the first time with a given X server, you may wish to calibrate your display so that WAVE can draw signals at the proper scales. -See `How can I get correct display scales?' (below) for details. +See `How can I get correct display scales?' in the WAVE FAQ for details. In common with other WFDB applications, WAVE locates signal, annotation, and header files by searching for them in a user-definable sequence of locations -(the WFDB path). Be sure to set the WFDB path appropriately for your system -(C-shell users can usually do so by typing `source /usr/local/bin/cshsetwfdb'; -Bourne shell, Korn shell, and `bash' users should type `. setwfdb' instead.) -See the WFDB Programmer's Guide or the WFDB Applications Guide, or type -`man setwfdb' for details. +(the WFDB path). By default, the WFDB path includes the current directory, +/usr/database, and http://www.physionet.org/physiobank/database (PhysioBank). +If you keep data files that you wish to read using WAVE in other locations, +be sure to set the WFDB path appropriately. Bourne shell, Korn shell, and +`bash' users can often do so by typing `. setwfdb'; C-shell users should type +`source /PATH/TO/cshsetwfdb' (where /PATH/TO is usually one of the directories +in the shell's own PATH, often /usr/bin or /usr/local/bin). See the WFDB +Programmer's Guide or the WFDB Applications Guide, or type `man setwfdb' for +details. Starting WAVE ============= @@ -100,8 +103,7 @@ You can return to `demo' mode by pressing the `Review log' button. (See `WAVE Logs', below, for information on creating a LOGFILE.) -See `Frequently asked questions', below, if you have difficulty getting -started. +See the WAVE FAQ if you have difficulty getting started. Using WAVE ========== @@ -166,8 +168,3 @@ ====================== .so resource.hlp - -Frequently Asked Questions -========================== - -.so faq.hlp diff -Naur wfdb-10.3.1/wave/wave.prf wfdb-10.3.2/wave/wave.prf --- wfdb-10.3.1/wave/wave.prf Sun Mar 10 09:40:07 2002 +++ wfdb-10.3.2/wave/wave.prf Wed Feb 12 16:30:20 2003 @@ -32,7 +32,7 @@ _______________________________________________________________________________ -For a copy of this document, print `HELPDIR/wave/wave.pro' (or click +For a copy of this document, print `HELPDIR/wave/news.hlp' (or click `Print' at the top of the window if you are viewing this from within WAVE). For a copy of the on-line help for WAVE, print `HELPDIR/wave/wave.hlp'. @@ -87,9 +87,11 @@ of the others. The `master WAVE process', corresponding to the last named record, has an extra button (labelled `Sync') in the control panel; clicking on this button causes all of the other windows in the process group to become - synchronized with the master WAVE process. It is also possible to open the - same record in two or more windows, and to select different displays for each - one, by a command such as + synchronized with the master WAVE process. (This can also be done by + clicking on any point in the signal window of the master WAVE process, + using the middle mouse button while also pressing .) It is also + possible to open the same record in two or more windows, and to select + different displays for each one, by a command such as wave -r 100+100 +0/-display +0/some.other.cpu:0 (which opens record 100 in a window on `some.other.cpu', and also in a master WAVE window on the local display; for this to be done successfully, diff -Naur wfdb-10.3.1/waverc/Makefile wfdb-10.3.2/waverc/Makefile --- wfdb-10.3.1/waverc/Makefile Thu Dec 5 02:57:46 2002 +++ wfdb-10.3.2/waverc/Makefile Mon Feb 24 00:53:28 2003 @@ -25,12 +25,12 @@ # please visit PhysioNet (http://www.physionet.org/). # _____________________________________________________________________________ # file: version.def G. Moody 24 May 2000 -# Last revised: 30 November 2002 +# Last revised: 23 February 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 1 +RELEASE = 2 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -42,18 +42,18 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.5 +WAVEVERSION = 6.6 # _____________________________________________________________________________ # Definitions generated by 'configure' -PACKAGE = wfdb-10.3.1 -LONGDATE = 5 December 2002 -SHORTDATE = DECEMBER 2002 +PACKAGE = wfdb-10.3.2 +LONGDATE = 24 February 2003 +SHORTDATE = FEBRUARY 2003 # _____________________________________________________________________________ # file: linux.def G. Moody 31 May 2000 -# Last revised: 21 November 2002 +# Last revised: 23 February 2003 # 'make' definitions for compiling the WFDB Software Package under Linux # Choose a value for WFDBROOT to determine where the WFDB Software Package will @@ -100,7 +100,7 @@ INCDIR = $(WFDBROOT)/include # INFODIR is the GNU info directory (optional, needed to `make info'). -INFODIR = /usr/share/info +INFODIR = $(WFDBROOT)/share/info # LIBDIR specifies the name of a directory in which to install the WFDB # library. diff -Naur wfdb-10.3.1/wfdb.spec wfdb-10.3.2/wfdb.spec --- wfdb-10.3.1/wfdb.spec Tue Nov 26 03:08:12 2002 +++ wfdb-10.3.2/wfdb.spec Mon Feb 24 01:08:42 2003 @@ -1,191 +1,235 @@ -Summary: Waveform Database library and applications +# Note that this is NOT a relocatable package + +Summary: Waveform Database library Name: wfdb Version: VERSION Release: RPMRELEASE -Copyright: GPL -Group: Applications/Engineering +License: GPL +Group: Libraries Source: http://www.physionet.org/physiotools/archives/wfdb-VERSION.tar.gz URL: http://www.physionet.org/physiotools/wfdb.shtml Packager: George Moody Requires: w3c-libwww >= 5.2 Requires: w3c-libwww-devel >= 5.2 -Requires: xview >= 3.2 -Requires: xview-devel >= 3.2 +BuildRoot: /var/tmp/%{name}-root -%description -Applications for creating, reading, analyzing, and viewing digitized signals in -a wide variety of formats, with optional annotations. The WFDB library, -included here, works together with the W3C's libwww to provide HTTP and FTP -client support to applications that use it, such as those in this package. -Although created for use with physiologic signals such as those available from -PhysioBank (http://www.physionet.org/physiobank/), many of the programs in this -package are general-purpose signal processing applications. +%changelog +* Wed Dec 18 2002 George B Moody +- split into wfdb, wfdb-devel, wfdb-app, wfdb-wave, wfdb-doc subpackages + +* Sun Dec 8 2002 George B Moody +- paths now use rpm's variables where possible + +# ---- common prep/build/install/clean/post/postun ---------------------------- %prep %setup -PATH=$PATH:/usr/openwin/bin ./configure --prefix=/usr %build +PATH=$PATH:/usr/openwin/bin ./configure --prefix=/usr make +# The 'make' command above actually *installs* the WFDB library and its *.h +# files in /usr/lib and /usr/include/wfdb/, because it is not possible +# otherwise to compile the apps and link them to the shared WFDB library. As +# far as I can tell, there is no way to avoid this given the way RPM works. + +# The 'make' commands below create HTML, PDF, and PostScript versions of the +# WFDB Programmer's Guide, WFDB Applications Guide, and WAVE User's Guide. +cd doc/wpg-src; make +cd ../wag-src; make +cd ../wug-src; make + %install -make install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/usr/lib $RPM_BUILD_ROOT/usr/include/wfdb +cd lib; cp -p libwfdb.so* $RPM_BUILD_ROOT/usr/lib + cp -p wfdb.h ecgcodes.h ecgmap.h wfdblib.h $RPM_BUILD_ROOT/usr/include/wfdb +cd ../wave; make WFDBROOT=$RPM_BUILD_ROOT/usr install +cd ../waverc; make WFDBROOT=$RPM_BUILD_ROOT/usr install +cd ../app; make WFDBROOT=$RPM_BUILD_ROOT/usr install +cd ../psd; make WFDBROOT=$RPM_BUILD_ROOT/usr install +cd ../convert; make WFDBROOT=$RPM_BUILD_ROOT/usr install +cd ../data; make WFDBROOT=$RPM_BUILD_ROOT/usr install +cd ../doc; make WFDBROOT=$RPM_BUILD_ROOT/usr install %clean +rm -rf $RPM_BUILD_ROOT make clean -%post -/sbin/ldconfig +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig -%postun -/sbin/ldconfig +# ---- wfdb [shared library] package ------------------------------------------ + +%description +The WFDB (Waveform Database) library supports creating, reading, and annotating +digitized signals in a wide variety of formats. Input can be from local files +or directly from web or FTP servers (via the W3C's libwww). WFDB applications +need not be aware of the source or format of their input, since input files are +located by searching a path that may include local and remote components, and +all data are transparently converted on-the-fly into a common format. Although +created for use with physiologic signals such as those in PhysioBank +(http://www.physionet.org/physiobank/), the WFDB library supports a broad +range of general-purpose signal processing applications. %files %defattr(-,root,root) -%doc checkpkg doc examples fortran lib/COPYING.LIB wave/anntab wave/wavemenu.def COPYING INSTALL MANIFEST NEWS README README.NETFILES +%{_libdir}/libwfdb.so* + +# ---- wfdb-devel package ----------------------------------------------------- + +%package devel +Summary: WFDB developer's toolkit +Group: Development/Libraries +Requires: wfdb = VERSION + +%description devel +This package includes files needed to develop new WFDB applications in C, C++, +and Fortran, examples in C and in Fortran, and miscellaneous documentation. + +%files devel +%defattr(-,root,root) +%{_bindir}/wfdb-config +%{_prefix}/database +%{_prefix}/include/wfdb +%doc checkpkg examples fortran lib/COPYING.LIB COPYING INSTALL MANIFEST NEWS README README.NETFILES + +# ---- wfdb-app package ------------------------------------------------------- + +%package app +Summary: WFDB applications +Group: Applications/Scientific +URL: http://www.physionet.org/physiotools/wag/ +Requires: wfdb >= VERSION + +%description app +About 60 applications for creating, reading, transforming, analyzing, +annotating, and viewing digitized signals, especially physiologic signals. +Applications include digital filtering, event detection, signal averaging, +power spectrum estimation, and many others. + +%files app +%defattr(-,root,root) +%{_bindir}/a2m +%{_bindir}/ad2m +%{_bindir}/ahaconvert +%{_bindir}/ann2rr +%{_bindir}/bxb +%{_bindir}/calsig +%{_bindir}/coherence +%{_bindir}/cshsetwfdb +%{_bindir}/ecgeval +%{_bindir}/edf2mit +%{_bindir}/epicmp +%{_bindir}/fft +%{_bindir}/fir +%{_bindir}/hrfft +%{_bindir}/hrlomb +%{_bindir}/hrmem +%{_bindir}/hrplot +%{_bindir}/ihr +%{_bindir}/log10 +%{_bindir}/lomb +%{_bindir}/m2a +%{_bindir}/makeid +%{_bindir}/md2a +%{_bindir}/memse +%{_bindir}/mfilt +%{_bindir}/mit2edf +%{_bindir}/mit2wav +%{_bindir}/mrgann +%{_bindir}/mxm +%{_bindir}/nguess +%{_bindir}/nst +%{_bindir}/plot2d +%{_bindir}/plot3d +%{_bindir}/plotstm +%{_bindir}/pscgen +%{_bindir}/pschart +%{_bindir}/psfd +%{_bindir}/rdann +%{_bindir}/rdsamp +%{_bindir}/readid +%{_bindir}/revise +%{_bindir}/rr2ann +%{_bindir}/rxr +%{_bindir}/sampfreq +%{_bindir}/setwfdb +%{_bindir}/sigamp +%{_bindir}/sigavg +%{_bindir}/skewedit +%{_bindir}/snip +%{_bindir}/sortann +%{_bindir}/sqrs +%{_bindir}/sqrs125 +%{_bindir}/sumann +%{_bindir}/sumstats +%{_bindir}/tach +%{_bindir}/url_view +%{_bindir}/wabp +%{_bindir}/wav2mit +%{_bindir}/wfdbcat +%{_bindir}/wfdbcollate +%{_bindir}/wfdbdesc +%{_bindir}/wfdbwhich +%{_bindir}/wqrs +%{_bindir}/wrann +%{_bindir}/wrsamp +%{_bindir}/xform +%{_libdir}/ps +%{_mandir} + +# ---- wfdb-wave package ------------------------------------------------------ + +%package wave +Summary: Waveform Analyzer, Viewer, and Editor. +Group: X11/Applications/Science +URL: http://www.physionet.org/physiotools/wug/ +Requires: wfdb >= VERSION +Requires: wfdb-app +Requires: xview >= 3.2 +Requires: xview-devel >= 3.2 + +%description wave +WAVE provides an environment for exploring digitized signals and time series. +It provides fast, high-quality views of data stored locally or on remote +web or FTP servers, flexible control of standard and user-provided analysis +modules, efficient interactive annotation editing, and support for multiple +views on the same or different displays to support collaborative analysis and +annotation projects. WAVE has been used to develop annotations for most of +the PhysioBank databases (http://www.physionet.org/physiobank/). + +WAVE uses the XView graphical user interface. A (beta) version of WAVE that +uses GTK+ is available at http://www.physionet.org/physiotools/beta/gtkwave/. + +%files wave +%defattr(-,root,root) +%{_bindir}/wave +%{_bindir}/wave-remote +%{_bindir}/wavescript +%{_prefix}/help/ +%config %{_prefix}/lib/wavemenu.def +%config %{_prefix}/lib/X11/app-defaults/Wave +%doc wave/anntab + +# ---- wfdb-doc package ------------------------------------------------------- + +%package doc +Summary: WFDB documentation. +Group: Documentation +URL: http://www.physionet.org/physiotools/manuals.shtml + +%description doc +This package includes HTML, PostScript, and PDF versions of the WFDB +Programmer's Guide, the WFDB Applications Guide, and the WAVE User's Guide. + +%files doc +%defattr(-,root,root) +%doc doc/wag doc/wpg doc/wug + + + + -/usr/bin/a2m -/usr/bin/ad2m -/usr/bin/ahaconvert -/usr/bin/ann2rr -/usr/bin/bxb -/usr/bin/calsig -/usr/bin/coherence -/usr/bin/cshsetwfdb -/usr/bin/ecgeval -/usr/bin/edf2mit -/usr/bin/epicmp -/usr/bin/fft -/usr/bin/fir -/usr/bin/hrfft -/usr/bin/hrlomb -/usr/bin/hrmem -/usr/bin/hrplot -/usr/bin/ihr -/usr/bin/log10 -/usr/bin/lomb -/usr/bin/m2a -/usr/bin/makeid -/usr/bin/md2a -/usr/bin/memse -/usr/bin/mfilt -/usr/bin/mit2edf -/usr/bin/mrgann -/usr/bin/mxm -/usr/bin/nst -/usr/bin/plot2d -/usr/bin/plot3d -/usr/bin/plotstm -/usr/bin/pscgen -/usr/bin/pschart -/usr/bin/psfd -/usr/bin/rdann -/usr/bin/rdsamp -/usr/bin/readid -/usr/bin/revise -/usr/bin/rr2ann -/usr/bin/rxr -/usr/bin/sampfreq -/usr/bin/setwfdb -/usr/bin/sigamp -/usr/bin/sigavg -/usr/bin/skewedit -/usr/bin/snip -/usr/bin/sortann -/usr/bin/sqrs -/usr/bin/sqrs125 -/usr/bin/sumann -/usr/bin/sumstats -/usr/bin/tach -/usr/bin/url_view -/usr/bin/wave -/usr/bin/wave-remote -/usr/bin/wavescript -/usr/bin/wfdbcat -/usr/bin/wfdbcollate -/usr/bin/wfdb-config -/usr/bin/wfdbdesc -/usr/bin/wfdbwhich -/usr/bin/wqrs -/usr/bin/wrann -/usr/bin/wrsamp -/usr/bin/xform -/usr/database/100s.atr -/usr/database/100s.dat -/usr/database/100s.hea -/usr/database/16.hea -/usr/database/16l.hea -/usr/database/8.hea -/usr/database/8l.hea -/usr/database/ahalist -/usr/database/ahaxlist -/usr/database/culist -/usr/database/dbcal -/usr/database/dblist -/usr/database/esclist -/usr/database/mitlist -/usr/database/mitxlist -/usr/database/multi.hea -/usr/database/nstlist -/usr/database/null.hea -/usr/database/pipe/16x10.hea -/usr/database/pipe/16x11.hea -/usr/database/pipe/16x12.hea -/usr/database/pipe/16x13.hea -/usr/database/pipe/16x14.hea -/usr/database/pipe/16x15.hea -/usr/database/pipe/16x16.hea -/usr/database/pipe/16x1.hea -/usr/database/pipe/16x2.hea -/usr/database/pipe/16x3.hea -/usr/database/pipe/16x4.hea -/usr/database/pipe/16x5.hea -/usr/database/pipe/16x6.hea -/usr/database/pipe/16x7.hea -/usr/database/pipe/16x8.hea -/usr/database/pipe/16x9.hea -/usr/database/pipe/8x10.hea -/usr/database/pipe/8x11.hea -/usr/database/pipe/8x12.hea -/usr/database/pipe/8x13.hea -/usr/database/pipe/8x14.hea -/usr/database/pipe/8x15.hea -/usr/database/pipe/8x16.hea -/usr/database/pipe/8x1.hea -/usr/database/pipe/8x2.hea -/usr/database/pipe/8x3.hea -/usr/database/pipe/8x4.hea -/usr/database/pipe/8x5.hea -/usr/database/pipe/8x6.hea -/usr/database/pipe/8x7.hea -/usr/database/pipe/8x8.hea -/usr/database/pipe/8x9.hea -/usr/database/tape/10240.hea -/usr/database/tape/1024.hea -/usr/database/tape/4096.hea -/usr/database/tape/512.hea -/usr/database/tape/6144d.hea -/usr/database/tape/ahatape.hea -/usr/database/tape/mittape.hea -/usr/database/wfdbcal -/usr/help/wave/analysis.hlp -/usr/help/wave/buttons.hlp -/usr/help/wave/demo.txt -/usr/help/wave/editing.hlp -/usr/help/wave/intro.hlp -/usr/help/wave/log.hlp -/usr/help/wave/news.hlp -/usr/help/wave/printing.hlp -/usr/help/wave/resource.hlp -/usr/help/wave/wave.hlp -/usr/help/wave/wave.info -/usr/help/wave/wave.pro -/usr/include/wfdb/ecgcodes.h -/usr/include/wfdb/ecgmap.h -/usr/include/wfdb/wfdb.h -/usr/lib/libwfdb.so.10.2 -/usr/lib/ps/12lead.pro -/usr/lib/ps/pschart.pro -/usr/lib/ps/psfd.pro -/usr/lib/wavemenu.def -/usr/lib/X11/app-defaults/Wave