Editing    Analysis    Display    Archive Scripts    Useful Script Functions

Control    On-Line    Experiments    Examples of Method    Spectrum

Analysis
Automate Cursor Regions Measurements
Fit a Gabor FunctionNew
Record and analyse respiratory dataNew
On/Offline Measurement from a Blood Pressure Trace
Amplitude histogram
Detect event bursts using Poisson surprise
Improved burst analysis
PSTH logging and integration
Peak/trough level detection
Respiratory waveform integration
Remove sinusoid from waveform
Level Indicator
Automatic sleep staging for rats
Sleepscore
Mean and mean deviation

Automate Cursor Regions Measurements
PC: WMeasure.ZIP 6,855

This script automates the process of taking multiple Cursor Regions type measurements. You simply specify the source channel, the type of measurement to take and the time range over which to make it. For example one could specify the mean of a waveform to be measured in 30 s bins. The results can be plotted as a RealMark or tabulated in the log. As a further refinement you can specify a State channel and marker codes to gate the analysis to time ranges of interest.

This script requires Spike2 v6.06 or higher.


Fit a Gabor Function
PC: GaborFitDemo.zip 8,610

The Gabor function is a sine wave damped by a Gaussian function.

This script allows you to fit a Gabor function to physiological data. An example application might be to detect oscillatory neural activity in auto-correlograms, e.g., Young et al (1992). The script also generates test data that you can use to familiarise yourself with the curve-fitting procedure.

You could also use this script as a template for fitting other functions by non-linear regression using the FitNLUser() script function.

This script requires Spike2 v6.06 or higher.

REFERENCE
Young MP, Tanaka K, Yamane S (1992) On Oscillating Neuronal Responses in the Visual Cortex of the Monkey J NeuroPhysiol 67:1464 - 1474


Record and analyse respiratory data
PC: RespRelease.zip 1,995,985

This archive contains scripts that enable you to:

The respiration analysis script enables you to: The archive also includes user guides, example data files and sampling configurations that should help you to get started. These scripts require Spike2 version 6.05 or higher.

They are beta versions. Send your bug reports and ideas for further development to geoff@ced.co.uk


On/Offline Measurement from a Blood Pressure Trace
PC: hrbp.ZIP 16,392

This script allows you to create additional channels in your data file derived from a blood pressure trace. These extra channels include: Heart rate, diastolic bp, systolic bp, pulse bp, true mean blood pressure and “conventional” mean bp, that is, diastolic+x% pulse (where x is a value that you choose -typically between 30% and 40%). The relevant features of the raw blood pressure trace are detected using the Spike2 Active Cursor system.

You can use the script online or offline. You can also simulate online recording by replaying a previous recording via the Output Waveform command on the Spike2 Sample menu. Full user instructions are in the comments at the top of the script file itself.

This script requires Spike2 v6.06 or higher.


Amplitude histogram
PC: amphist.ZIP 13,089

This script generates an amplitude distribution histogram from a Waveform, RealWave or WaveMark channel. You can select the required channel, time range, amplitude range and bin size using a combination of cursor dragging and dialog entries. The results can be displayed in various forms including number of points, Time and percent time in each amplitude bin. A user guide is included in the comments at the head of the script.

This script requires Spike2 version 6,04 or higher. It also makes use of functions in the script file GHutils.s2s (included in the download). This file must be located in a folder called include located inside the directory holding your copy of Spike2


Detecting event bursts using Poisson Surprise
PC : surprise.zip 225,575 Mac : surprise.sit 8,235

This script detects bursts of events against a background of more random events. These are copies of the script referred to on page 6 of the CED June 98 Newsletter.


Improved burst analysis
PC: bursts.zip 214,655

Create level channels in a data file that mark groups of Events, Markers or Wavemarks. Plot burst duration, inter-burst interval, burst period or events /burst vs time.

Create additional channels showing burst rate, burst onset times, and events within bursts and events not in bursts.

Generate a table of burst statistics that can be easily copied to a spreadsheet for further analysis.

This script is intended to supersede the w_bursts.s2s located in the spike2 scripts folder. See the accompanying datasheet Bursts.pdf for a detailed user guide.


PSTH logging and integration
PC: qpsth.zip 2,243 Mac: qpsth.sit 9,370

This script records trigger and response signals. It creates a PSTH result view and integrates it to produce a cumulative display. This is done on-line as the data is sampled. Two channels are defined: a trigger channel and a response event channel.


Peak / trough level detection
PC: ptlev.zip 8,059 Mac: ptlev.sit 11,542

This is a script for locating peaks and troughs of a waveform which lie between two user-defined levels. It will ask you to open a data file and then place two horizontal cursors on the screen. The script will then create a new event channel containing events at peak/trough times of the waveform which lie between the two horizontal cursors.


Respiratory Waveform Integration System
PC: rwi.zip 14,253 Mac: rwi.sit 17,705

This is an on-line script (i.e. it runs whilst sampling is in progress).

The user is allowed to have one sampled 'raw data' waveform channel. The script then creates another waveform channel with the integral of the raw data waveform. There is a choice of 4 possible modes of integration.

1. Free run mode The integrated channel is just the integral of the raw data.
2. Inspiration only The integrated channel is held at zero whilst the raw data is negative.
3. Expiration only The integrated channel is held at zero whilst the raw data is positive.
4. Zero reset Every time the raw data crosses zero, the integrated channel is reset to zero.

When data capture is complete, the user gets the opportunity to dump measurements of flow and volume to a text file.


Remove sinusoid from waveform
PC: remsin.zip 2,987

This script removes a sinusoid of known frequency from a waveform channel. This can occur where a sinusoidal stimulus is presented and the resulting biological signal contains the original sinusoid (with unknown and varying phase and amplitude) plus the desired response. The task is to remove (as far as is possible) the stimulating sinusoid while preserving the response.

The sinusoid phase and amplitude are detected by multiplying the source channel by a sine wave and a cosine wave of the desired frequency. The script works through the data in steps of one sinusoid cycle time. The user sets the number of sinusoid cycles to average before and after each target cycle to improve the result.


Display a state channel marking low, intermediate and high levels of a waveform
PC: levelind.ZIP 177,101

For many applications it is important to know the timing and duration of periods when the level of a waveform channel exceeded a user-defined upper threshold, fell below a lower threshold or was between these levels. This script provides a convenient method of displaying and analyzing the number and duration of high, intermediate and low states.

The script allow you to do the following:

Software requirements

This script requires Spike2 version 5.09 or higher.


Automatic sleep staging for rats
PC: RatSleepAuto.ZIP 26,136

This script assigns sleep scores (Wake, NREM, REM and Doubt) based on recordings of hippocampal EEG and nuchal EMG. It implements the method of Costa-Miserachs et al (2003). The script includes a brief user guide that should be read in conjunction with the original article:

Costa-Miserachs D, Portel-Cortez I, Torras-Garcia M, Morgado-Bernal I (2003) Automated sleep staging in rat with a standard spreadsheet. J.Neurosci Methods 130:93-101

Software requirements

This script requires Spike2 version 5.20 or higher.


Manual sleep staging and event marking
PC: sleepscr.zip 127,091

This script allows you to perform the following tasks:

Software requirements

This script requires Spike2 version 5.09 or higher.


Mean and mean deviation
PC: mean_angle.zip 4,851

The purpose of the script is to calculate the mean and the mean deviation of a set of angles (or other variables) given by a textfile. In addition, it performs the Rayleigh test of uniformity, which tests whether the distribution of angles differs significantly from uniformity. The down-load contains the script and two test files.

Keram Pfeiffer
Dept of Physiology & Biophysics
Dalhousie University
Sir Charles Tupper Medical Building
5850 College Street
Halifax
Canada

email Keram.pfeiffer @ dal.ca


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 line, below. Then you can down-load them by clicking on the filename; please check the size received.

There is a useful external site devoted to Spike2 scripts, run by Jean-Francois Gariépy.
CED home page