[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you prefer to write your applications in C++, you may do so, but note that the WFDB library is written in C. (Most C++ compilers can be run in ANSI/ISO C compatibility mode in order to compile the WFDB library itself.) Each C++ source file that uses WFDB library functions must include `<wfdb/wfdb.h>', in order to instruct your compiler to use C conventions for argument passing and to use unmangled names for the WFDB library functions. In order for this to work, your C++ compiler should predefine `__cplusplus' or `c_plusplus'; if it predefines neither of these symbols, modify `<wfdb/wfdb.h>' so that the symbols `wfdb_CPP' and `wfdb_PROTO' are defined at the top of the file, or define `__cplusplus' in each of your source files before including `<wfdb/wfdb.h>'. Compile and link your program using whatever standard methods are supported by your compiler for linking C++ programs with C libraries. See your compiler manual for further information.
A set of wrapper functions is also available for those who wish to use the WFDB library together with applications written in Fortran. These functions, defined in `wfdbf.c', provide a thin `wrapper' around the WFDB library functions, by accepting Fortran-compatible arguments (there are no structures, and all arguments are passed by reference rather than by value). For example, here is the Fortran equivalent of the example program in the previous section:
integer i, v(2), g i = isigopen("100s", 2) do i = 1, 10 g = getvec(v) write (6,3) v(1), v(2) 3 format("v(1) = ", i4, " v(2) = ", i4) end do end |
(See http://www.physionet.org/physiotools/wfdb/fortran/fsamples.f for a copy of this program; an extensively commented version of this program is also available, at http://www.physionet.org/physiotools/wfdb/fortran/example.f.)
To compile this program using g77
(the GNU Fortran compiler), save it as
`fsamples.f' in the current directory, copy
`wfdbf.c'
to the current directory, then type:
g77 -o fsamples -fwritable-strings fsamples.f wfdbf.c -lwfdb |
The Fortran wrapper functions are not discussed in this guide; for further information, refer to fortran/README in the WFDB Software Package.
A set of wrappers for Matlab has been written and contributed by Jonas Carlson.
These wrappers (wfdb_tools
) provide access to almost all of the
functionality of the WFDB library, including HTTP access to remote data files,
to users of Matlab R13 (but not earlier versions) under GNU/Linux or
MS-Windows; other platforms remain to be tested. The wrappers, together with
examples and a tutorial/reference guide, are available from
http://www.physionet.org/physiotools/matlab/wfdb_tools/.
It should be possible to write a set of wrapper functions similar to
wfdb_tools
for use with Octave (a freely available open-source
language that is compatible with Matlab, available from
http://www.che.wisc.edu/octave/) or Scilab (an open-source
scientific software package for numerical computations, with a language
similar to that of Matlab, available from
http://www-rocq.inria.fr/scilab/).
Jesus Olivan Palacios has written a tutorial (available at
http://www.neurotraces.com/scilab/sciteam/) on using the WFDB
Software Package with Scilab.
Also available is a reimplementation of a useful subset of the WFDB library in native m-code (contributed by Jose Garcia Moros and Salvador Olmos) at http://www.physionet.org/physiotools/matlab/.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |