README 7.62 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
This file contains the original README file as distributed with "BioSig for C/C++". The contents of the original file starts at "Introduction". The license for the code in this directory can be found in the file LICENSE. The source code and documentation in this directory are adapted from "BioSig for C/C++" (http://biosig.sf.net/). See the file VERSION for more information. The changes were made by Alexander Wiebel. Parts of the text of the old README file do not apply to the changed code anymore.

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) "libbiosig.a" provides a library for accessing different dataformats. 
Recommended: zlib (http://zlib.net/) and GNU Scientific Library (GSL)
The supported data formats are listed here: 
http://hci.tugraz.at/schloegl/biosig/TESTED
(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. 
(3) "mexSLOAD" is a MEX-interface for Octave and Matlab
Requirement: Matlab OR Octave (v2.9 or higher) with octave-headers
For Matlab, precompiled binaries are available in matlab/mexSLOAD.mex*    
(4) "_biosig.so" is an interface to python. 
Requirement: python, python-dev, python-scipy, swig (http://www.swig.org/)
(5) SigViewer 
Requirement: qmake, Qt4
(6) Precompiled binaries for Win32
   win32/save2gdf.exe  binary converter
   win32/libbiosig.a   library for MinGW 4.x (might work with other compilers too) 


The internal data structure resemble the header structure similar to
  http://biosig.cvs.sourceforge.net/biosig/biosig/doc/header.txt
and is defined in
  http://biosig.cvs.sourceforge.net/biosig/biosig4c++/biosig.h
(see HDRTYPE and CHANNEL_TYPE)

Encoding of Event/Markers/Annotations is available here: 
  http://hci.tugraz.at/schloegl/matlab/eeg/EventCodes.html

The latest list of supported data formats is available here: 
  http://hci.tugraz.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 
    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
    win32/*	executables for Windows

Compilation: 
-------------
# Linux 
You need g++(>4.0), make and zlib. (If you do not have zlib, do not define WITH_ZLIB).
Running make compiles the converter.
  make 		 	# makes the file format converter
  make save2gdf 	# makes the file format converter
  make win32		# makes the file format converter for Win32
  make physicalunits 	# makes the en/decoder for physical units
  make libbiosig.a  	# makes a static library 
  make mex4o 		# makes mexSLOAD for Octave (requires Octave-headers2.9 or higher)
  make mex4m 		# makes mexSLOAD for Matlab (path_to_mex need to be defined in Makefile)
  make sigviewer 	# recompiles SigViewer	(requires qmake and Qt, and the sources of sigviewer must be in ../sigviewer)
  make biosig4python 	# compiles the BioSig interface for Python (requires SWIG and Python)
  make all  		# all of the above
  make testscp 
  make testhl7	
  make test		# tests HL7<->SCP, SCP<->GDF, GDF<->HL7 converters
  make test6		# tests bidirectional conversion between 6 differerent data formats	

# MinGW Crosscompiler on Linux for Windows  
Currently, only the file converter save2gdf is supported.
- install mingw32 mingw32-binutils mingw32-runtime
- run the command  
   make win32

# Windows + MinGW
Currently, only the file converter save2gdf is supported.
- You need MinGW with g++ and make.
- run the make command 
   make -f Makefile.win32

# Windows + MinGW + Matlab
do the steps in "Windows+MinGW"
install and configure gnumex (from http://gnumex.sf.net)  
  make libbiosig.a
  start matlab
  >> gnumex 	% configure mingw for mex
  >> mex mexSLOAD.cpp libbiosig \mingw\lib\libws2_32.a

	
# Windows + Cygwin
Currently, only the file converter save2gdf is supported.
- install Cygwin
- within Cygwin install g++, zlib, and make 
- run the make command 
   make save2gdf 

# MSVC - Microsoft Visual C++
  MSVC is currently not supported. The main incompatibility is 
  the use of the typeof() operator. Since typeof() is very convinient, 
  I'm not planning to change this. However, you can easy replace 
  any typeof()-operator by the appropriate type, and the code 
  should compile on MSVC as well. 

# Other platforms (Windows+MSVC, MacOSX, Solaris, etc. )
Not tested (yet). Let me know about successful compilations, 
or tell me what changes are needed.   

	
Installation: 
-------------
run as root 
  make 
  make install 		# installs save2gdf, save2scp, save2aecg, 
  make install_octave	# installs mexSLOAD.mex in /usr/local/share/octave/site-m/
  make install_sigviewer	# installs sigviewer
 


Execution:
----------
# if test.gdf exists, some header information is displayed
save2gdf test.gdf     		

# help and usage information 
save2gdf -h

# converts a data file into a GDF format (destination
save2gdf PFE103.scp t5.gdf     		

# converts a data file into a SCP format (destination
save2scp t5.gdf t5.scp      		
save2gdf -f=SCP t5.gdf t5.scp      		

# converts a data file into a HL7aECG format (destination
save2aecg t5.gdf t5.hl7      		
save2gdf -f=HL7aECG t5.gdf t5.hl7

# load matlab into octave or matlab
start octave or matlab
addpath path_to_mexSLOAD.mex
[data,HDR] = mexSLOAD(filename); % loads data and header information 


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. 


Development & Testing:
----------------------
There are several testing functions included. 
The following commands test the converter and should finish without errors.  
	make test 
	make testhl7
	make testscp
	make test6

The Octave/Matlab script 
	test0/test01.m 
tests whether the various data formats give the same results 
or whether some conversion error has been included.  



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: README,v 1.26 2009/02/27 09:18:33 schloegl Exp $
    Copyright (C) 2005,2006,2007,2008,2009 Alois Schloegl <a.schloegl@ieee.org>
    This function is part of the "BioSig for C/C++" repository 
    (BioSig4C++) at http://biosig.sf.net/