Editing    Analysis    Display    Archive Scripts    Useful Script Functions    Control

On-Line    Experiments    Examples of Method    Spectrum    Export

Analysis
Grand Average
Multiple cross-channel correlations
Interactive feature detection
Automate Cursor Regions Measurements
Fit a Gabor Function
Record and analyse respiratory data
On/Offline Measurement from a Blood Pressure Trace
Amplitude histogram
Apply digital filters to multiple channels
Apply marker filter settings to multiple channels
Separate traces from stereotrode and tetrode channels
Detect event bursts using Poisson surprise
Improved burst analysis
Level Indicator
PSTH logging and integration
Peak/trough level detection
Respiratory waveform integration
Remove sinusoid from waveform
Automatic sleep staging for rats
On/Offline sleepscoringNew
Sleepscore
Mean and mean deviation
Grand Average GrandAverage.zip 1,054

This script can be used to 'build' an average of multiple result views including waveform averages, PSTH's and interval histograms. Select result views to add to the Grand Average by opening a saved result view or creating a new result view and making it the current or 'top' window. Then simply click the ADD button in the script toolbar.

This script requires Spike2 v4.24 or higher.

Keywords: Grand average


Multiple cross-channel correlations CrossChanCorrelation.zip 3,591

This script generates multiple spike correlation histograms for all combinations of templated spikes in a channel. Currently it allows for up to 8 spike templates per channel (including code 0) for correlating between channels in the file.

The script is controlled from a toolbar where the user can open a data file for analysis and control the parameters for the correlation as well as the number of correlation results views to display at any one time. A suitable example data file, Extracellular spikes.smr, is included in the Data folder of your Spike2 directory.

This script requires Spike2 v4.24 or higher.

Keywords: Spike cross correlation


Interactive feature detection FeatureDetect.zip 1,656

This script allows the user to interactively import peaks, troughs or threshold crossings based on an amplitude value defined with a pair of horizontal cursors, or a single horizontal cursor used as a threshold crossing.

The script utilises an idle routine that automatically updates the memory channel holding the event markers if the user adjusts the amplitudes or threshold levels. A suitable example data file, Blood pressure waveform.smr, is included in the Data folder of your Spike2 directory.

This script requires Spike2 v4.24 or higher.

Keywords: peak trough detection, threshold crossing


Automate Cursor Regions Measurements 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 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 RespRelease.zip 2,047,425

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 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 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


Apply digital filters to multiple channels ApplyDfilter.zip 1,721

This script will apply an existing filter from the Digital Filter bank to a number of channels in a data file. You can select the channels to filter by holding down the Ctrl key and clicking on the channel numbers to the left of the Y-axis. Selected channels will have the number highlighted with a grey box. A suitable example data file, Flow and CO2 Waveform.smr, is included in the Data folder of your Spike2 directory

This script requires Spike2 v5.21 or higher.

Keywords: Digital filter


Apply marker filter settings to multiple channels CopyMarkerFilter.zip 371,148

This script copies marker filter settings from a nominated channel to any selected WaveMark or marker channels in a data file. You can select the channels to apply the copied settings to by holding down theCtrl key and clicking on the channel numbers to the left of the Y-axis. Selected channels will have the number highlighted with a grey box. A suitable example data file, Spike channels.smr, is included in the .Zip file.

This script requires Spike2 v5.21 or higher.

Keywords: Marker filter


Separate traces from stereotrode and tetrode channels SeparateTraces.zip 82,560

This script will take a selected channel of multiple trace WaveMark data and create additional memory channels in the data file, each holding a single trace from the source channel. The user selectes the channel and type (stereotrode or tetrode) from a dialog when the script is run. A suitable example data file, Tetrode data.smr, is included in the .Zip file.

This script requires Spike2 v5.21 or higher.

Keywords: Multiple trace, stereotrode, tetrode


Detecting event bursts using Poisson Surprise surprise.zip 225,575 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 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.


Display a state channel marking low, intermediate and high levels of a waveform levelind.ZIP 192,173

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.


PSTH logging and integration qpsth.zip 2,243 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 ptlev.zip 8,059 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 rwi.zip 14,253 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 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.


Automatic sleep staging for rats RatSleepAuto.ZIP 27,877

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.


On/Offline sleepscoring osd.zip 7,030,509

This script is intended for online or offline sleep staging in freely moving rats, mice or chicks based on recordings of one EEG and one EMG channel. The script uses the spectral functions of Virtual channels in Spike2 v7 to plot EEG power in Delta, Theta and two user-defined bands together with Theta/Delta ratio. Sleep stages are then assigned based on a series of user-defined rules such as:

When performing sleep scoring online, you can use the sequencer and sampling configuration supplied to generate an output pulse when a particular sleep stage is detected. This pulse can be used to trigger external equipment, for example, to turn on the lights.


Manual sleep staging and event marking 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 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.