![]() | Spike Train Analysis Toolkit |
The Spike Train Analyis Toolkit consists of several components:
The Spike Train Analysis Toolkit is written in a combination of Matlab and C. The computational code is written in C, which was chosen because of its fast execution, the availability of free compilers, and the potential for porting to parallel clusters. The user interface to the toolkit is written in Matlab, which was chosen for the ease with which data can be manipulated and visualized. The interface between the C code and the Matlab code is written in C using Matlab's MEX API.
Members of the community have the option of contributing implementations in Matlab or in C/MEX. For each case, we provide guidelines that contributors should follow.
In general, we recommend that information methods be divided into several modules which correspond to distinct steps and may return useful intermediate results.
The preferred function format is
[out,opts_used]=method(in,opts)
You may want to have the main function call modules that return intermediate results of interest. The modules will also consist of Matlab functions, although intermediate variables will be passed among the module functions. If the underlying computations are implemented in C/MEX, you must add the compilation commands to the file make.m
. Also, we recommend creating a directory in the info
directory and putting the associated files there.
It is not possible to seamlessly integrate entropy methods into the toolkit without writing them in C and the MEX framework. We will be happy to work with you to adapt your method for integration with the toolkit.
For the remainder of this document, quant
will refer to the quantity being estimated (i.e., entropy
or variance
) and method
refers to the method name.
quant_method_c.c
to the entropy/
directory.entropy_c.h
: ENT_EST_METHS
, SPEC_VAR_EST_METHS
, or GEN_VAR_EST_METHS
.struct_type
is estimate
for entropy
methods, and nv_pair
for variance
methods): extern int quant_method(struct hist1d *in,struct options_entropy *opts,struct struct_type *out);
entropy_c.c
: ent_est_meth_list
or var_est_meth_list
.quant_method
to the statements that define the elements of the entropy_fun
, specific_variance_fun
, or general_variance_fun
function pointers.make.m
add entropy/quant_method_c.c
to the string entropy_files
.entropy_mx.c
: ReadOptionsEntropy()
, add read_options_quant_null
to the statements that define the elements of the entropy_fun
or variance_fun
function pointers.WriteOptionsEntropy()
, add write_options_quant_null
to the statements that define the elements of the entropy_fun
or variance_fun
function pointers.quant_method_mx.c
to the entropy/
directory.entropy_c.h
: #define
statementsoptions_entropy
structure.entropy_mx.h
, add the read/write options function declarations: extern void read_options_quant_method(const mxArray *in,struct options_entropy *opts);
extern mxArray *write_options_quant_method(const mxArray *in,struct options_entropy *opts);
entropy_mx.c
: ReadOptionsEntropy()
, add read_options_quant_method
to the statements that define the elements of the entropy_fun
or variance_fun
function pointers.WriteOptionsEntropy()
, add write_options_quant_method
to the statements that define the elements of the entropy_fun
or variance_fun
function pointers.make.m
add entropy/quant_method_mx.c
to the string entropy_files
.