[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Functions in this section are used to determine specifications for calibration pulses and customary scales for plotting signals. All of them make use of the calibration list, which is maintained in memory and which contains entries for various types of signals.
calopen | read a calibration file into list | |
getcal | retrieve calibration data from list | |
putcal | append calibration data to list | |
newcal | write calibration list to a file | |
flushcal | discard contents of calibration list |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int calopen(char *file) |
Return:
Success
Failure: insufficient memory for calibration list
Failure: unable to open calibration file
This function reads the specified calibration file (which must be
located in one of the directories specified by WFDB
,
see section The Database Path and Other Environment Variables) into the calibration list. If file is
NULL
, the file named by WFDBCAL
is read. Normally, the
current contents of the calibration list are discarded before reading
the calibration file; if file begins with ‘+’, however, the
‘+’ is stripped from the file name and the contents of the file are
appended to the current calibration list. If file is ‘-’,
calopen
reads the standard input rather than a calibration file.
(This function was first introduced in WFDB library version 6.0.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int getcal(char *desc, char *units, WFDB_Calinfo *cal) |
Return:
Success; *cal
contains the requested data
Failure: no match found
This function attempts to find calibration data for signals of type
desc, having physical units as given by units. If
successful, it fills in the contents of the WFDB_Calinfo
structure
(see section Calibration Information Structures)
pointed to by cal. The caller must allocate storage for the
WFDB_Calinfo
structure, and must not modify the contents of the
strings addressed by the sigtype
and units
fields of the
WFDB_Calinfo
structure after getcal
returns. getcal
returns data from the first entry in the calibration list that contains
a sigtype
field that is either an exact match or a prefix of
desc, and a units
field that is an exact match of
units; if either desc or units is NULL
,
however, it is ignored for the purpose of finding a match.
getcal
cannot succeed unless the calibration list has been
initialized by a previous invocation of calopen
or putcal
.
(This function was first introduced in WFDB library version 6.0.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int putcal(WFDB_Calinfo *cal) |
Return:
Success
Failure: insufficient memory
This function adds the WFDB_Calinfo
structure pointed to by cal
to the end of the calibration list. (This function was first introduced
in WFDB library version 6.0.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int newcal(char *file) |
Return:
Success
Failure: unable to open file
This function creates a new calibration file (in the current directory) containing the contents of the calibration list (which is not modified). file must satisfy the standard conditions for a WFDB file name, i.e., it may contain letters, digits, or underscores. (This function was first introduced in WFDB library version 6.0.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void flushcal() |
This function discards the current calibration list and returns the
memory that it occupied to the heap. Note that wfdbquit
does
not perform the function of flushcal
. (This function was
first introduced in WFDB library version 6.0.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
PhysioNet (wfdb@physionet.org)