Skip to content
master
Switch branches/tags
Code

Latest commit

* ErrorReader: new class.

This is a slightly modified version of OutputReader, meant for
handling standard error output.  In contrast to OutputReader,
ErrorReader simply takes each line of text received from the input
stream, and sends it to a Logger.

* Wfdbexec: handle standard error output.

If we launch a child process using ProcessBuilder with
redirectErrorStream set to false, the process's standard output and
standard error will be connected to two separate pipes.

This is generally a good thing, as it allows us to parse the program's
output without trying to parse error messages.  However, it also means
that we must actually read from both pipes (since pipe buffers are
finite, if the child process writes enough text to a pipe without
anyone reading from the other end, the process will block.)  We cannot
predict in what order the child process will write output and error
messages, or how large those messages will be, so we need to be able
to read from the two pipes in any order.  Possibly the simplest way to
do so is to launch a separate thread to read from one of the pipes
(standard error), while continuing to read from the other pipe
(standard output) in the main thread.

Moreover, in many cases the error messages printed by WFDB
applications are actually meaningful and should not simply be ignored.

With this change, error messages from the child process will be read
as they are written, and sent to the logger at level WARNING.
(Currently, this means that the messages will be hidden unless
wfdbloadlib is invoked with debug level 2 or higher.)

The following functions will now send standard error messages to the
logger:

   execToStringList()
   execToStringList(String[])
   execToDoubleArray(String[])
   execToDoubleList(String[])
   execToFloatArray(String[])
   execToLongArray(String[])
   execToShortArray(String[])

The following functions set redirectErrorStream to true, and thus
standard error and standard output are combined into the single list
returned to the caller:

   execWithStandardInput(String[])
   execWithStandardInput(byte[])

Co-authored-by: Benjamin Moody <benjaminmoody@gmail.com>
7037087

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

wfdbRecordViewer

Introduction

The WFDB Toolbox for MATLAB and Octave is a set of Java, GUI, and m-code wrapper functions, which make system calls to WFDB Software Package and other PhysioToolkit applications. The website for the toolbox (which includes the installation instructions) can be found at:

http://physionet.org/physiotools/matlab/wfdb-app-matlab/

Using the WFDB Toolbox, MATLAB and Octave users have access to over 50 PhysioNet databases (over 4 TB of physiologic signals including ECG, EEG, EMG, fetal ECG, PLETH, PPG, ABP, respiration, and more). Additionally, most of these databases are also accompanied by metadata such as expert annotations of physiologically relevant events in WFDB annotation files. These can include, for example, cardiologists' beat and rhythm annotations of ECGs, or sleep experts' hypnograms (sleep stage annotations) of polysomnograms. All of these physiologic signals and annotations can be read on demand from the PhysioNet web server and its mirrors using the toolbox functions, or from local copies if you choose to download them. This feature allows your code to analyze the wide range of physiologic signals available from PhysioBank without the need to download entire records and to store them locally. The Toolbox is open-source (distributed under the GPL). The toolbox includes a GUI (WFDBRECORDVIEWER) for facilitating the browsing, exploration, and analysis of WFBD records stored locally on the users machine, or remotely in PhysioNet's databases.

Forum

A community discussion group is available at: http://groups.google.com/forum/#!forum/wfdb-app-toolbox

Available Databases

For a list of available databases accessible through the WFDB Toolbox, see:

http://physionet.org/physiobank/database/DBS

Installing from PhysioNet

To check out and install from PhysioNet using MATLAB, run the following commands:

[old_path]=which('rdsamp');if(~isempty(old_path)) rmpath(old_path(1:end-8)); end
wfdb_url='https://physionet.org/physiotools/matlab/wfdb-app-matlab/wfdb-app-toolbox-0-10-0.zip';
[filestr,status] = urlwrite(wfdb_url,'wfdb-app-toolbox-0-10-0.zip');
unzip('wfdb-app-toolbox-0-10-0.zip');
cd mcode
addpath(pwd);savepath

Checking out and installing from the trunk

Building the toolbox requires:

  • The GNU C compiler (GCC)
  • The GNU Fortran compiler (gfortran)
  • GNU Make
  • GNU Autoconf
  • GNU Libtool
  • Java Development Kit
  • Ant

To build the toolbox, simply run 'make' in the top-level directory. This will automatically download various dependencies from PhysioNet and elsewhere (see 'mcode/nativelibs/Makefile' for details.)

Reference & Toolbox Technical Overview

An Open-source Toolbox for Analysing and Processing PhysioNet Databases in MATLAB and Octave. I Silva, GB Moody, Journal of Open Research Software 2 (1), e27

WFDB Software Package

About

The WFDB Toolbox for MATLAB/Octave is a collection of functions for reading, writing, and processing physiologic signals in the formats used by PhysioNet (see README for details).

Resources

License

Packages

No packages published