Introduction:
---------------

The aim of this repository is providing a C/C++ software library for biomedical signal processing. 
This library is called "BioSig for C/C++" and is complementary to "BioSig for Octave and Matlab". 

BioSig4C++ provides several tools:  

(1) = LIBRARIES = 
(1a) "libbiosig" provides a library for accessing different dataformats. 
The supported data formats are listed here: 
http://pub.ist.ac.at/~schloegl/biosig/TESTED
(1b) "libgdf" is a lightweight version of libbiosig, supporting only the GDF format. 
it requires only GCC not G++ for linking, has potentially much less security loopholes (XML) and bugs, 
and a much smaller memory footprint, which might be especially useful for embedded devices. 
It's interface is the same than for libbiosig, namely biosig.h
(1c) "libbiosig2" is a level two interface for managing multiple files, 
it resembles the interface of edflib. It's interface is defined in biosig2.h.
It ca be used to link libbiosig2 compiled with GCC to software compiled with
MSVisualC++.
(1d) "libphysicalunits" provides conversion tools for physical units from 
ascii text to 16bit integers according to ISO/IEEE 11073-10101:2004 Table A.6.3: Vital signs units of measurements 
text strings are cached for performance reasons, and can be used in a multi-threaded application. 

The following DEFINES are recommended and require:
 -D=WITH_CHOLMOD        used for re-referencing of data, REQUIREMENT: cholmod from libsuitesparse
 -D=WITH_ZLIB	        used to handle gzip-ped files,  REQUIREMENT: zlib (http://zlib.net/)
There are some more defines to tweak your version.
 -D=NDEBUG		removes and debugging information 
 -D=WITH_PTHREAD 	recommended for multi-threaded appliations
 -D=WITH_GSL	        provides interface to GSL, REQUIREMENT: GNU Scientific Library (GSL), 
 -D=WITH_FEF	        includes support for FEF-format from CNSystems
 -D=WITH_FAMOS	        includes (partial) support for FAMOS format 
 -D=__4HAERTEL__	support for special flavor of FAMOS format (experimental) 
 Other flags are used for experimental development 
 -D=WITH_DICOM, -D=WITH_GDCM 	experimental DICOM support 
 -D=WITH_LIBXML2	experimental: tinyxml is replaced by libxml2
 -D=WITH_TIMESTAMPCHANNEL add an extra channel in HEKA format containing TIMESTAMPS
 -D=WITH_TIMESTAMPEVENT timestamps of sweep onset in HEKA format stored in EVENT.DUR with EVENT.TYP==0x7ffe 
 
If some libraries are not available on your system, remove the corresponding DEFINES in Makefile. 

(2) = save2gdf = is a converter between different file formats, 
including but not limited to SCP-ECG(EN1064), HL7aECG (FDA-XML), GDF, EDF, BDF, CWFB.
    save2gdf can be also used to upload or retrieve data from a bscs server, and to display 
    the header information, in ascii and in JSON format. 

(3) "mexSLOAD" is a MEX-interface for Octave and Matlab
for details see mex/README

(4a) "biosig4python" is an interface to python. 
Requirement: python, python-dev, python-numpy, swig (http://www.swig.org/)
for Debian/Ubuntu: 
 	sudo apt-get install python python-dev python-numpy swig
see ./python/example.py and ./python/demo.py for more information 

(4b) "biosig4ruby" is an interface to ruby. 
Requirement: ruby, ruby-dev, swig (http://www.swig.org/)
for Debian/Ubuntu: 
 	sudo apt-get install ruby ruby-dev swig
see ./ruby/test.rb for more information 

Interfaces to other languages (including Java, PHP, Perl and TCL) are also provided through 
SWIG. However, these are very experimental

(5) = SigViewer =
Requirement: qmake, Qt4
   an important patch to overcome several limitations (event handling beyond 16.7 Mio samples)
   is applied. 

(6) Precompiled binaries for Win32
   win32/save2gdf.exe  binary converter
   win32/libbiosig.{lib,dll}  static and dynamic library (requires zlib and libws2_32)
   mma/sload.exe     Mathematica binding through Mathlink interface
   mex/mexSLOAD.mexw32   Mex-file for Win32/Matlab

(7) = MathLink interface to Mathematica =
   see mma/sload, mma/hdrinfo.nb, mma/mySLOAD.nb for more details. 


The internal data structure resemble the header structure similar to
  http://biosig.svn.sourceforge.net/viewvc/biosig/trunk/biosig/doc/header.txt
and is defined in
  http://biosig.svn.sourceforge.net/viewvc/biosig/trunk/biosig4c%2B%2B/biosig.h
(see HDRTYPE and CHANNEL_TYPE)

Encoding of Event/Markers/Annotations is available here: 
  http://pub.ist.ac.at/~schloegl/matlab/eeg/EventCodes.html

The latest list of supported data formats is available here: 
  http://pub.ist.ac.at/~schloegl/biosig/TESTED


File(s): 
-------------
    README 	this file
    biosig.h	definition of external biosig interface	
    biosig-dev.h definition of internal functions	
    biosig.c	SOPEN, SREAD, SWRITE, SEOF, SCLOSE functions 
    save2gdf.c	converter between various file formats.
    physicalunit.c         en-/decodes physical units according to ISO/DIS 11073-10101:2003
    mexSLOAD.cpp is a MEX-File for loading data in Octave and Matab. 
    t210/*	reading SCP,FAMOS file format 
    t220/*      writing SCP file format 
    t230/*      support of HL7aECG file format 
    t240/*	Support for CNSystems' File Exchange Format (CNS-FEF), note this is different to CENTS14271 in t241/ 
    t241/*.asn1	ASN.1 specification of ISO11073-xxxxx and CENTS-14271 (FEF), 
    test0/*	scripts and functions for testing
    Makefile	script for compiling and testing under GNU/Linux
    Makefile.win32	script for compiling and testing on win32 using mingw
    mex/*       Octave/Matlab binding through MEX-interface
    mma/*	MathLink interface to mathematica
    win32/*	library and executables for Windows
    python/*.py show example and demo
    src/*.c	applications: flowmon reads data from serial port, ttl2trig reads data from audio card	


Open Issue(s) of the SCP-ECG <-> HL7aECG converter:
---------------------------------------------------
The following fields of SCP-ECG are not converted to HL7. 
= Mandatory fields (prEN1064:2007 p.18, chp 5.4.3.1) not propagated to HL7:  
- time zone information, (tag34, section 1)
- "ID of acquiring device" (tag14, section 1)
= "Highly recommended" fields (prEN1064:2007 p.18, chp 5.4.3.1) not propagated to HL7:  
- "ID of analysing device", Patient first name, 
= Other fields of the SCP-ECG standard, 
- section 1: blood pressure, medication, etc
- section 4 (QRS location), 7 (global measurements), 8-11 (interpretative statements)
The following fields of HL7aECG are not converted to SCP-ECG.
- study, treatment group, clinical trial, clinical trial protocol, trial sponsor, investigator etc. 


More information is available at http://biosig.sf.net/

If you have any questions you can also contact the mailinglist  
https://lists.sourceforge.net/lists/listinfo/biosig-general


    $Id$
    Copyright (C) 2005,2006,2007,2008,2009,2010,2012 Alois Schloegl <a.schloegl@ieee.org>
    This function is part of the "BioSig for C/C++" repository 
    (BioSig4C++) at http://biosig.sf.net/ 

