#include "io.h"
#include "linalg.h"
Go to the source code of this file.
Functions |
ChannelInfo * | read_chaninfo_ced (const char *fname, ChannelInfo *chans) |
double * | read_dblp_ascii (const char *fname, int N, double *v) |
double ** | read_dblpp_ascii (const char *fname, int xdim, int ydim, double **d) |
char * | read_line (FILE *f, char *line) |
Array * | read_matrix_from_text (const char *fname) |
| Read a matrix from blank-separated file.
|
void | write_dblp_ascii (FILE *out, const double *v, int n) |
void | write_dblp_ascii_file (const char *fname, const double *v, int n) |
void | write_dblpp_ascii (FILE *out, const double **d, int xdim, int ydim, OptArgList *opts) |
void | write_dblpp_ascii_file (const char *fname, const double **d, int xdim, int ydim, OptArgList *opts) |
void | write_intp_ascii (FILE *out, const int *v, int n) |
void | write_intp_ascii_file (const char *fname, const int *v, int n) |
Function Documentation
reads ChannelInfo struct from .ced file (EEGlab). Format is: One line with labels (tab-sep), followed by lines of values (tab-sep). This function reads:
- labels: "labels" "X", "Y", "Z"
- values: char* double double double
- Parameters:
-
| fname | filename |
| chans | ChannelInfo struct (large enough) or NULL (memory allocated in function) |
- Returns:
- chaninfo read from file or NULL if error occured
Definition at line 122 of file io.c.
double* read_dblp_ascii |
( |
const char * |
fname, |
|
|
int |
N, |
|
|
double * |
v | |
|
) |
| | |
read 1D vector frome file
Definition at line 232 of file io.c.
double** read_dblpp_ascii |
( |
const char * |
fname, |
|
|
int |
xdim, |
|
|
int |
ydim, |
|
|
double ** |
d | |
|
) |
| | |
read xdim x ydim matrix from ascii file with delimiter 'delim'; if NULL is passed as d, the functin allocates memory.
Definition at line 205 of file io.c.
char* read_line |
( |
FILE * |
f, |
|
|
char * |
line | |
|
) |
| | |
reads from FILE* until '
' and puts it into line. '' is added to line.
- Parameters:
-
| f | |
| line | empty string (long enough), or NULL ->own memory |
- Returns:
- NULL if error, else ptr to line
Definition at line 32 of file io.c.
Array* read_matrix_from_text |
( |
const char * |
fname |
) |
|
Read a matrix from blank-separated file.
The format is something like this:
-0.005344 0.696318 0.005792 589.041211
-0.005348 0.691603 0.007035 589.074254
-0.005352 0.686796 0.008324 589.096248
-0.005516 0.680181 0.010164 589.118214
...
- Parameters:
-
| fname | the name of the file |
- Returns:
- the matrix
Definition at line 68 of file io.c.
void write_dblp_ascii |
( |
FILE * |
out, |
|
|
const double * |
v, |
|
|
int |
n | |
|
) |
| | |
Definition at line 298 of file io.c.
void write_dblp_ascii_file |
( |
const char * |
fname, |
|
|
const double * |
v, |
|
|
int |
n | |
|
) |
| | |
Definition at line 308 of file io.c.
void write_dblpp_ascii |
( |
FILE * |
out, |
|
|
const double ** |
d, |
|
|
int |
xdim, |
|
|
int |
ydim, |
|
|
OptArgList * |
opts | |
|
) |
| | |
write double matrix to file in ASCII format.
- Parameters:
-
| opts | may contain
- "precision=int" number of significant digits (after comma); default=6;
|
Definition at line 274 of file io.c.
void write_dblpp_ascii_file |
( |
const char * |
fname, |
|
|
const double ** |
d, |
|
|
int |
xdim, |
|
|
int |
ydim, |
|
|
OptArgList * |
opts | |
|
) |
| | |
write double matrix to file in ASCII format.
- Parameters:
-
| opts | may contain
- "precision=int" number of significant digits (after comma); default=6;
|
Definition at line 258 of file io.c.
void write_intp_ascii |
( |
FILE * |
out, |
|
|
const int * |
v, |
|
|
int |
n | |
|
) |
| | |
Definition at line 320 of file io.c.
void write_intp_ascii_file |
( |
const char * |
fname, |
|
|
const int * |
v, |
|
|
int |
n | |
|
) |
| | |
Definition at line 330 of file io.c.