| 1 |
Introduction: |
| 2 |
============= |
| 3 |
|
| 4 |
The aim of this repository is providing a C/C++ software library for biomedical signal processing. |
| 5 |
|
| 6 |
BioSig4C++ provides several tools: |
| 7 |
|
| 8 |
(1) = LIBRARIES = |
| 9 |
(1a) "libbiosig" provides a library for accessing different dataformats. |
| 10 |
The supported data formats are listed here: |
| 11 |
http://pub.ist.ac.at/~schloegl/biosig/TESTED |
| 12 |
A disadvantages is the direct access to internal data structure, which makes it |
| 13 |
difficult to maintain ABI combatibility. External applications should use libbiosig2 instead. |
| 14 |
(1b) "libgdf" is a lightweight version of libbiosig, supporting only the GDF format. |
| 15 |
it requires only GCC not G++ for linking, has potentially much less security loopholes (XML) and bugs, |
| 16 |
and a much smaller memory footprint, which might be especially useful for embedded devices. |
| 17 |
It's interface is the same than for libbiosig, namely biosig.h |
| 18 |
(1c) "libbiosig" is a level 2 interface for managing multiple files, |
| 19 |
It's interface is defined in biosig.h. It can be used to link libbiosig compiled with GCC to software compiled with |
| 20 |
MSVisualC++. ABI compatibility is easier to maintain because access to internal data |
| 21 |
structures can be applied only through functions calls and not through pointers. |
| 22 |
(1d) "libphysicalunits" provides conversion tools for physical units from |
| 23 |
ascii text to 16bit integers according to ISO/IEEE 11073-10101:2004 Table A.6.3: Vital signs units of measurements |
| 24 |
text strings are cached for performance reasons, and can be used in a multi-threaded application. |
| 25 |
|
| 26 |
Static and dynamic libraries are build. The Application Programming Interface (API) |
| 27 |
is reasonable stable, changes are managed through marking the modified "deprecated". |
| 28 |
The appliction binary interface (ABI) depends also on external tools and libraries, especially |
| 29 |
access to interal data structures like structs can break ABI compatibility, even when the API is stable. |
| 30 |
Recompiling the application is on solution, but not always feasible. In order to avoid that need, |
| 31 |
it is strongly recommended to use only the level 2 interface, which provides access to the internal |
| 32 |
header data through functions. If only level 2 interface functions are used, it is reasonable |
| 33 |
save to dynamically link libbiosig2. |
| 34 |
|
| 35 |
|
| 36 |
* Installation of official source release (for users): |
| 37 |
download source release and run |
| 38 |
|
| 39 |
VER=1.9.5 |
| 40 |
wget https://sourceforge.net/projects/biosig/files/BioSig\ for\ C_C\+\+/src/biosig4c\+\+-$VER.src.tar.gz |
| 41 |
tar xvf biosig4c++-$VER.src.tar.gz |
| 42 |
cd biosig4c++-$VER |
| 43 |
./configure && make && sudo make install |
| 44 |
|
| 45 |
|
| 46 |
* Installation from git repository (for developers, usually untested): |
| 47 |
** Checkout code for the first time: |
| 48 |
|
| 49 |
git clone https://git.code.sf.net/p/biosig/code biosig-code |
| 50 |
cd biosig-code/biosig4c++ |
| 51 |
autoconf # needed only the first time after checkout |
| 52 |
./configure |
| 53 |
make |
| 54 |
sudo make install |
| 55 |
|
| 56 |
** next time just update latest changes |
| 57 |
|
| 58 |
git pull |
| 59 |
autoreconf -fim # usually this can be omitted |
| 60 |
./configure # usually this can be omitted |
| 61 |
make |
| 62 |
make install |
| 63 |
|
| 64 |
|
| 65 |
For doing some advanced (special) configurations, you can modify these flags in Makefile.in |
| 66 |
|
| 67 |
(2) = converter and tools = |
| 68 |
contains several tools for data conversion, |
| 69 |
save2gdf: is a converter between different file formats, including but not limited to |
| 70 |
SCP-ECG(EN1064), HL7aECG (FDA-XML), GDF, EDF, BDF, CWFB and others |
| 71 |
save2gdf can be also used to upload or retrieve data |
| 72 |
from a bscs server, and to display the header information |
| 73 |
in ascii and in JSON format. |
| 74 |
biosig2fhir: is a tool than converts biosig data into a hl7/fhir binary template, |
| 75 |
the header information is encoded in JSON format, the data is converted |
| 76 |
into a base64-encoded GDF (OeNorm K2202:2015) formatted file. |
| 77 |
physicalunits: is a tool to show the encoding of physical units according to ISO/IEEE 11073 |
| 78 |
|
| 79 |
These can can be build with: |
| 80 |
make tools |
| 81 |
|
| 82 |
|
| 83 |
(3) language bindings and foreign function interfaces: |
| 84 |
(3a) "mexSLOAD" is a MEX-interface for Octave and Matlab |
| 85 |
and is linked statically to libbiosig. It can be build with |
| 86 |
make mex4o # octave |
| 87 |
make mex4m # matlab |
| 88 |
for details see mex/README. |
| 89 |
|
| 90 |
(3b) "python" is an interface to python and dynamically linked to libbiosig. |
| 91 |
Requirement: python, python-dev, python-numpy |
| 92 |
for Debian/Ubuntu: |
| 93 |
sudo apt-get install python python-dev python-numpy python-wheels |
| 94 |
sudo apt-get install python3 python3-dev python3-numpy python3-wheels |
| 95 |
It can be build with any of the following commands: |
| 96 |
make python |
| 97 |
make -C python build |
| 98 |
make -C python release |
| 99 |
For installation, you can than do either |
| 100 |
cd python && python setup.py install |
| 101 |
cd python && python3 setup.py install |
| 102 |
or |
| 103 |
python -m pip install python/dist/Biosig-1.9.2.tar.gz |
| 104 |
python3 -m pip install python/dist/Biosig-1.9.2.tar.gz |
| 105 |
Use of the interface is shown in ./python/demo2.py |
| 106 |
|
| 107 |
|
| 108 |
(3c) mathematica |
| 109 |
is linked dynamically to libbiosig and can be build with: |
| 110 |
make mma |
| 111 |
see also mma/README, and mma/biosig, mma/hdrinfo.nb, mma/mySLOAD.nb for more details. |
| 112 |
|
| 113 |
(3z) other language interfaces |
| 114 |
Interfaces to other languages (including Java, PHP, Perl and TCL) are considered, |
| 115 |
but these still need to be implemented and tested. |
| 116 |
|
| 117 |
|
| 118 |
(5) = SigViewer = |
| 119 |
Requirement: qmake, Qt5 |
| 120 |
an important patch to overcome several limitations (event handling beyond 16.7 Mio samples) |
| 121 |
is applied. |
| 122 |
|
| 123 |
|
| 124 |
(6) Precompiled binaries for Win32 and Win64 |
| 125 |
win##/save2gdf.exe binary converter |
| 126 |
win##/libbiosig.{lib,dll} static and dynamic library (requires zlib and libws2_32) |
| 127 |
mma/sload.exe Mathematica binding through Mathlink interface |
| 128 |
mex/mexSLOAD.mexw32 Mex-file for Win32/Matlab |
| 129 |
|
| 130 |
|
| 131 |
The internal data structure resemble the header structure similar to |
| 132 |
http://biosig.svn.sourceforge.net/viewvc/biosig/trunk/biosig/doc/header.txt |
| 133 |
and is defined in |
| 134 |
http://biosig.svn.sourceforge.net/viewvc/biosig/trunk/biosig4c%2B%2B/biosig.h |
| 135 |
(see HDRTYPE and CHANNEL_TYPE) |
| 136 |
|
| 137 |
Encoding of Event/Markers/Annotations is available here: |
| 138 |
http://pub.ist.ac.at/~schloegl/matlab/eeg/EventCodes.html |
| 139 |
|
| 140 |
The latest list of supported data formats is available here: |
| 141 |
http://pub.ist.ac.at/~schloegl/biosig/TESTED |
| 142 |
|
| 143 |
|
| 144 |
File(s): |
| 145 |
------------- |
| 146 |
README this file |
| 147 |
biosig.h definition of external biosig interface |
| 148 |
biosig-dev.h definition of internal functions |
| 149 |
biosig.c SOPEN, SREAD, SWRITE, SEOF, SCLOSE functions |
| 150 |
save2gdf.c converter between various file formats. |
| 151 |
physicalunit.c en-/decodes physical units according to ISO/DIS 11073-10101:2003 |
| 152 |
mexSLOAD.cpp is a MEX-File for loading data in Octave and Matab. |
| 153 |
t210/* reading SCP, FAMOS file format |
| 154 |
t220/* writing SCP file format |
| 155 |
t230/* support of HL7aECG file format |
| 156 |
t240/* Support for CNSystems' File Exchange Format (CNS-FEF), note this is different to CENTS14271 in t241/ |
| 157 |
t241/*.asn1 ASN.1 specification of ISO11073-xxxxx and CENTS-14271 (FEF), |
| 158 |
test0/* scripts and functions for testing |
| 159 |
Makefile script for compiling and testing under GNU/Linux |
| 160 |
Makefile.win32 script for compiling and testing on win32 using mingw |
| 161 |
mex/* Octave/Matlab binding through MEX-interface |
| 162 |
mma/* MathLink interface to mathematica |
| 163 |
win32/* library and executables for Windows |
| 164 |
python/*.py show example and demo |
| 165 |
src/*.c applications: flowmon reads data from serial port, ttl2trig reads data from audio card |
| 166 |
|
| 167 |
|
| 168 |
More information is available at http://biosig.sf.net/ |
| 169 |
|
| 170 |
If you have any questions you can also contact the mailinglist |
| 171 |
https://lists.sourceforge.net/lists/listinfo/biosig-general |
| 172 |
|
| 173 |
|
| 174 |
Copyright (C) 2005-2020 Alois Schloegl <[email protected]> |
| 175 |
This function is part of the "BioSig for C/C++" repository |
| 176 |
(BioSig4C++) at http://biosig.sf.net/ |
| 177 |
|