Debian Codegraph @

biosig4c++/test0/test_scp_decode.c

raw symbols SCIP
1 /*
2
3 $Id: test_scp_decode.c,v 1.2 2007-08-31 13:18:15 schloegl Exp $
4 Copyright (C) 2007 Eugenio Cervesato
5 Modified by Alois Schloegl
6
7 This function is part of the "BioSig for C/C++" repository
8 (biosig4c++) at http://biosig.sf.net/
9
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
25 */
26 #if defined(_MSC_VER) && (_MSC_VER < 1600)
27 #define __LITTLE_ENDIAN=1
28 #define __BIG_ENDIAN=0
29 USEUNIT("t210/scp-decode.cpp");
30 #include "patient.h"
31 #include <alloc.h>
32 #endif
33
34 #include "../biosig.h"
35 #include "../t210/structures.h"
36 #include <stdio.h>
37 #include <string.h>
38 #include <stdlib.h>
39
40 int scp_decode(HDRTYPE* hdr, pointer_section *info_sections, DATA_DECODE &info_decoding, DATA_RECORD &info_recording, DATA_INFO &info_textual, bool &add_filter);
41
42 //#include "patient.h"
43 int main(int argc, char* argv[])
44 {
45 HDRTYPE *hdr ;
46 pointer_section *section;
47 DATA_DECODE decode;
48 DATA_RECORD record;
49 DATA_INFO textual;
50 bool add_filter=true;
51 FILE *in;
52
53 hdr = (HDRTYPE *)malloc(sizeof(HDRTYPE));
54 if( (section = (pointer_section *)malloc(sizeof(pointer_section)*12)) ==NULL)
55 {
56 return 2;
57 }
58 hdr->FileName=argv[1];
59 hdr->FILE.OPEN=0;
60 hdr->FILE.COMPRESSION=0;
61 scp_decode(hdr, section, decode, record, textual, add_filter);
62
63 for (int i=0;i<decode.flag_Res.number_samples;i+=2500)
64 for (int k=0;k<8;k+=3)
65 {
66 int x=decode.Reconstructed[i+k*5000]; // data returned is in microVolt -> DATA CONSINSTENT
67 fprintf(stdout,"%i %i %i\n",i,k,x);
68 }
69 return(0);
70 }
71