Spike Toolbox

Managing spike toolbox options


This topic explains how options for the Spike Toolbox are stored, how to retrieve and modify them and how to make them persistent.

Accessing the toolbox options
Setting persistant toolbox options

Accessing the toolbox options
The toolbox options are manipulated through the
STOptions function. This function retrieves and sets the toolbox options structure.

[stOptions]    = STOptions
                 STOptions(stOptions)
[stOptionsOld] = STOptions(stOptionsNew)

Toolbox options are always stored and manipulated as a MATLAB structure. You should always use STOptions to obtain a valid options structure, rather than creating one from scratch. This way is faster, anyway.

stO = STOptions
stO =
                           Signature: [1x11 char]
                      ToolboxVersion: [1x1 double]
                    bDisplayProgress: [1x1 logical]
          InstanceTemporalResolution: [1x1 double]
           MappingTemporalResolution: [1x1 double]
                     RandomGenerator: [1x1 function_handle]
                    SpikeChunkLength: [1x1 double]
              DefaultSynchWindowSize: [1x1 double]
                   DefaultCorrWindow: [1x1 double]
          DefaultCorrSmoothingKernel: [1x8 char]
    DefaultCorrSmoothingWindowFactor: [1x1 double]
      stasDefaultOutputSpecification: [1x2 struct]
           MonitorChannelsAddressing: {[1x2 struct]  [1x1 struct]  []  []}
                stasMonitorChannelID: [1x2 struct]

The options structure field names are relatively self-descriptive, but...

STOptionsDescribe gives a nicer display of the current toolbox options, or of a toolbox options structure.

STOptionsDescribe(stOptions)
STOptionsDescribe

STOptionsDescribe;
--- Spike toolbox options:
   Toolbox version [0.03]
   Operation progress display is [on]
   Default temporal resolution for spike trains:
      Instances [0.99] usec
      Mappings [1.00] usec
   Toolbox random number generator [rand]
   Maximum spike chunk length [2097152] spikes
   Default spike synchrony matching window [1.00] msec
   Default window size for cross-correlation analysis [1.00] msec
   Default smoothing kernel for cross-correlation analysis [gaussian]
   Default factor for determining smoothing window for cross-correlation [10]
   Default output addressing specification
      |(12) Synapse address (8)|(7) Neuron address (0)|
   Monitor channel ID addressing specification
      |(15) Channel ID (14)|(13) (Ignored) (0)|
   Monitor channel address mappings:
      [0]: |(12) Synapse address (8)|(7) Neuron address (0)|
      [1]: |(7) Neuron address (0)|

After modifying some aspect of the toolbox options (by obtaining a structure then assigning a new value to a field), use STOptions again to set the new options.

stO.RandomGenerator = @twister;
STOptions(stO);

STOptions will tell you if you've broken the options structure with your meddling.


Setting persistant toolbox options
Although you could re-set your favourite options every time you start MATLAB, it's much less frustrating to save a set of options.
STOptionsSave and STOptionsLoad are used to manipulate persistant toolbox options.

STOptionsSave
STOptionsSave(stOptions)
STOptionsSave(stOptions, filename)

              STOptionsLoad
[stOptions] = STOptionsLoad
              STOptionsLoad(filename)

The basic calling syntaxes store and retrieve the current toolbox options from a file stored on a per-user basis, in your .matlab directory (or its equivalent on Windows).

If your options become hopelessly messed up, use STToolboxDefaults to retrieve the factory defaults in handy-dandy options structure format. Then use STOptionsSave to write them to the persistant database.

[stOptions] = STToolboxDefaults


$Id: spike_tb_options.html 1783 2005-08-31 21:05:51Z dylan $