Spike2 Scripts


Examples of Method

Copy data to and extract data from a grid view
New! (10/17)

Copy data to and extract data from a grid view

GridDemo.zip

This script demonstrates the use of script functions to create a grid view and add data to it or extract data from it.

Grid views store data as strings rather than numbers. This script uses a library of script functions (ghgridutils.s2s) to convert 1- and 2- dimensional arrays of numbers to columns and rows of strings and vice versa.

This script requires Spike2 v8.06 or higher. From versions 8.14 and 9.02 onwards, this script will be included in the scripts folder of the Spike2 application.

Draw your own arbitrary waveforms (01/10)

Draw your own arbitrary waveforms

DrawPlayWave.zip

This is an example script that allows the drawing of an arbitrary waveform for output from the 1401 DAC's using the mouse pointer. The user specifies the output rate, waveform duration and associated key for the waveform before drawing the shape required in a result view window by holding down the Shift key together with the left mouse button and dragging the mouse. The waveform can then be added to the play wave area of the sampling configuration by clicking the 'Add' button in the script toolbar.

This script requires Spike2 v7.01 or higher.

Interactive control of pulse output amplitude
Improved! (01/17)

Interactive control of pulse output amplitude

CursorPulseAmp.zip

This script and associated sequence file is an example of updating a running sequence file during sampling with an interactive script.

The included sampling configuration can be used to visualize the pulse outputs by connecting DAC 0 to ADC 0 on the 1401. Load the CursorPulseAmp.pls sequence file from the sequencer tab of the sampling configuration and click OK before running the script. The script opens a new data file ready to sample and creates a tollbar to start and stop sampling. During sampling the horizontal cursor can be dragged up and down to control the amplitude of the pulse train output.

This script requires Spike2 v6.14 or higher.

Test on-line scripts on existing data files
Improved! (01/17)

Test on-line scripts on existing data files

SimOnSkel.zip

This script uses the PlayOffLine() script command to replay an existing data file and give the script access to the current replay position to simulate sampling.

To use this for testing purposes, simply add the function code that you plan to use on-line at the position indicated in the Idle%() function.

This script requires Spike2 v5.21 or higher.

Alarm clock (05/10)

Alarm clock

Alarm.zip

This script is a simple example allowing the user to set an alarm time based on the system clock of the PC. This example emits a tone and displays a message box once the alarm time is reached, but could easily be modified to perform other functions in response to the alarm setting, such as starting a file sampling early in the morning before you arrive at work!

This script requires Spike2 v5.21 or higher.

Save and load variables with text files (07/98)

Save and load variables with text files

restvar.zip

This script illustrates the use of external text files in Spike2 to save and restore the values of script variables. When the script is terminated, a text file is created holding the value of the script variables. When you run the script again (possibly switching off your machine in-between), the variable values are loaded back into the script so it is as if you had not left.

Nested toolbars Improved! (01/17)

Nested toolbars

nesttool.zip

This is an example of a script using nested toolbars. It is designed for people who are already writing scripts and wish to be able to call one toolbar from another. It is a skeletal script with very little functionality, but serves as a good demonstration of the techniques involved.

This script has a main toolbar which can call another toolbar which, in turn, can call another one. Then, as you leave each toolbar, the script returns to the one which called it.

Sequencer control example (04/99)

Sequencer control example

autodac.zip

An example of running a sequenceer from a Spike2 script, including the use of sequencer variables. It requires that the sequencer file autopump.pls is placed in the Spike2\sequence directory. To see the effect, you should set up a sampling configuration with two waveform channels and connect DAC outputs 0 and 1 to ADC inputs 0 and 1.

On-line sampling and analysis skeleton
Improved! (01/17)

On-line sampling and analysis skeleton

onskel.zip

This is an empty script that doesn't do anything much, but is a framework upon which you can build your own script for online analysis. It provides controls for the sampling via a toolbar plus a customisable idle function to carry out analysis.

Simple analysis of single files Improved! (01/17)

Simple analysis of single files

skel2.zip

This is an empty script that doesn't do anything much, but is a framework upon which you can build your own script. It provides a loop that repeatedly opens a single data file for analysis until the user stops.

Manage a list of files for analysis (05/99)

Manage a list of files for analysis

skeleton.zip

This is an empty script that doesn't do anything much, but is a framework upon which you can build your own script. It provides handling of a list of open data files including opening more files, plus selection of a file for analysis.

Process a batch of files similarly (11/09)

Process a batch of files similarly

BatchProcess.zip

This is a skeleton script that can be easily modified to do the same thing to all smr files (or a subset of smr files) in a selected directory - for example setting up active cursors.

Some of these scripts have come from users rather than the CED team. If you have a script that you would like to offer to fellow users via this page, please tell Simon Gray. We provide some scripts for Signal too.

These scripts are stored as WinZip files, myscript.zip, except where they are shown as spike\scripts\myscript.s2s. Those latter files were installed with Spike2 and spike stands for the directory in which you installed Spike2. See the summaries by clicking on the description in the side menu. Then you can down-load them by clicking on the filename.

×

Mains ‘hum’ is often complex and composed of odd harmonics of the mains frequency, making it very difficult to remove or suppress using simple high pass or notch filters. HumRemoveExpress.s2s is a Spike2 version 7 script that you can use offline to strip out much of this residual mains interference, making your data much more presentable and easier to analyse. This video tutorial shows how to use the script to remove mains hum.

  • Alpha MED Sciences
  • Alpha Omega Engineering
  • Axon Instruments
  • Binary data
  • Bionic/Cyberkinetics
  • Biopac
  • CED CFS
  • CED SON (Macintosh)
  • CONSAM (D. Colquhuon)
  • DATAQ Instruments (Codas)
  • DataWave
  • DATAPAC
  • Data Sciences International
  • Delsys Files
  • European Data Format(+)
  • Grass-Telefactor (PolyView)
  • HLR Data Format
  • Heka Data Format
  • Multi Channel System (Mc_Rack)
  • MindSet (16/24) data Files
  • MindWare data files
  • Motion Labs Systems Files .c3d
  • NeuroScan
  • Neuralynx
  • Plexon
  • RC Electronics
  • Text files
  • TMS International
  • Tucker-Davis Technologies
  • WAV (Microsoft)
  • WaveMetrics Igor Pro (PC/Mac)
  • Xltek Neuroworks
×

Cambridge Electronic Design Limited

Registered in England: 972132

Registered office:

  • Cambridge Electronic Design Limited,
  • Technical Centre,
  • 139 Cambridge Road,
  • Milton,
  • Cambridge CB24 6AZ
  • ENGLAND.

VAT: GB 214 2617 96

Producer Registration number: WEE/BD0050TZ

Terms and Conditions of Sale

For our US customers, we can provide tax form W-8BEN, that identifies us as a UK company.

DUNS: 219151016
CAGE/NCAGE: KB797
NAICS: 423490
Commodity codes
Hardware: 84716070
Software: 85234945
×

By email:

info@ced.co.uk

By post:
  • Cambridge Electronic Design Limited,
  • Technical Centre,
  • 139 Cambridge Road,
  • Milton,
  • Cambridge CB24 6AZ
  • ENGLAND.
By telephone:

(Int.+44) (0)1223 420186

From North America (Toll Free):

1 800 345 7794

×

Privacy policy

CED, through this site, does two things that relate to privacy. We would like to explain them.

Emails from down-loads

We offer free down-loads of many files on our site, from test programs to complete install files for updated versions of major packages like Spike2 and Signal.

When customers wish to take a down-load of a major package, we ask a few questions, including their name, email address, the serial number of the software for which they seek an upgrade and whether they would like an automatic email whenever we update the product. This information is emailed back to CED when they access the final down-load screen. Within this email, your browser transmits the type and version of browser you are using, and the screen resolution you are running.

The reasons why we take and keep this information are that it is useful for our software development team to know who has taken the latest versions, and it is useful for our web site development team to know which browsers people are using to view our site, and what resolution they have their screens set to.

Cookies

When people down-load a major package, we try to write a cookie, a small file in your computer, that records your name, serial number of the software package, and the version you are down-loading. These files have a lifetime of one year.

The reasons for storing this information are firstly that if you ask for another down-load some other time, your details are read from the cookie and are pre-written into the form, to save you looking them up again. The other reason is that next time you access our site, your browser looks through your CED cookies and compares the versions down-loaded with the latest version numbers read from our site. If there is a later version of a product you have already down-loaded, we tell you on the home page screen, so you know that it is worth going to the down-load page again.

None of this information is ever given to anyone outside CED. ×