Editing    Analysis    Display    Archive Scripts    Useful Script Functions    Control

On-Line    Experiments    Examples of Method    Spectrum    User RequestedNew

Editing
Hum Remove
Align Comments in a script
Tidy up the layout of a script
Merge Filesnew
Add two waveforms
Copy a channel with time offset
Copy and paste waveforms and events
Differentiate and integrate waveform data
Extract a waveform section
Remove artefacts from an event channel
Remove stimulus artefactsnew
Undelete a data channel
Convert a result file to a data file
Import data from a text file
Write event intervals to a text file
Process event channels to a text file
Process event channels in a time view

 

Hum Remove
PC: HumRemove.ZIP 208,772

This script is designed to improve the signal-to-noise ratio of physiological recordings by removing mains-related interference. This is done, not by filtering, but by subtracting an estimate of the mains interference from the raw data and storing the results in a new channel. The script has been modified to work on waveforms with gaps.

The script requires Spike2 v 6.02 or later.

Waveforms should be recorded with a sampling rate of at least 5kHz. Better results will be obtained if you record an event channel that marks the onset of each cycle of the mains or alternatively, a waveform channel that accurately reflects the mains frequency.

See the data sheet Hum Remove.pdf for full details.


Align Comments in a script
PC: AlignComments.ZIP 9,042

This script is a utility for script writers. It improves the layout of a script by aligning the comments on lines containing code to a common, user-defined offset.

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.


Tidy up the layout of a script
PC: ScriptTidy.ZIP 17,099

This script is a utility for script writers. It can improve the readability of scripts especially longer ones with many functions and procedures.

Available options include: removing constants and variables that were declared but not used and sorting functions and procedures into an alphabetical list after the main program. The most convenient way to run this script is via a button on the Script Bar.

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.


Merge Files
PC: MergFiles5.ZIP 25,496

This utility script allows you to:

Full user instructions are included in the comments at the start of the script. This script works with the latest Spike2 version 5. A “de luxe” version is available in the scripts folder for users of Spike2 v 6 and higher.


Add two waveforms
PC: add_wave.zip 2,214 Mac: add_wave.sit 2,877

Adds two waveform channels together between stated times. The script is a little complicated for what it does; it has a lot of error checking.


Copy a channel, with time offset
PC: copy_ch1.zip 2,295 Mac: copy_ch1.sit 3,021

This script replaces the old Copy_Chn script. It allows you to copy channels into new channels using a time-axis offset. Several channels can be copied at a time and the offset may be input either as a number of seconds or as the position of a cursor. It works on all types of channels.


Copy and paste waveforms and events
PC: lotsx.zip 6,305 Mac: lotsx.sit 8,972

This script enables the user to copy sections of waveform, and corresponding event data from several different files and to paste them into a newly created data file. Each section copied will be appended to previously copied data, and optional gaps can be left. This file can then be saved as a normal Spike2 data file.


Differentiate and integrate waveform data
PC: diff.zip 927 Mac: diff.sit 1,174
PC: intgl.zip 979 Mac: intgl.sit 1,240

These scripts differentiate and integrate a selected section of waveform data respectively. The result is placed in a memory channel.


Extract a waveform section
PC: chunkrem.zip 910 Mac: chunkrem.sit 1,161

Chops off sections of data before and after a chunk that you want to isolate. It works only on waveform channels. Beware! This script makes large, irreversible changes to your data-file.


Remove artefacts from an event channel
PC: debounce.zip 853 Mac: debounce.sit 1,106

This simple script cleans-up an event channel by copying to another event channel, leaving out all events occurring too soon after the last event.


Remove stimulus artefacts
PC: artrem.zip 1,774 Mac: artrem.sit 1,296

Removes stimulus artefacts from data channels, replacing the artefact with a straight line to preserve continuity. Artefacts can be identified by timing from a trigger channel, or by cursor positions.


Undelete a data channel
PC: spike\scripts\undelch.s2s Mac: undelch.sit 6,053

Undelete a channel you have accidentally deleted from a data-file. Back up your data before using this script!


Convert a result file to a data file
PC: res2smr.zip 1,445

Converts result file data back into a data file to allow data file specific use. This requires Spike2 version 4 or later.


Import data from a text file
PC: imptext.zip 2,413 Mac: imptext.sit 3,360

This script reads data from a text file, creates a new Spike2 data file and writes the imported data into waveform channels. The number of channels to be imported can be set by the user.


Write event intervals to a text file
PC: spike\scripts\dumpeve.s2s Mac: spike2:scripts:dumpeve.scr

Creates a text file holding intervals between successive events, a facility not available from the built-in analysis mechanisms, it also acts as a simple demonstration of text output.


Process event channels to a text file
PC: dumpspk.zip 3,494 Mac: dumpspk.sit 4,261

This script dumps event channels as text from a Spike2 data file. The script will dump the data as mean frequency, instantaneous frequency, rate, event intervals, or as event times.


Process event channels in a time view
PC: ProcEvts.zip 105,285

This is a general purpose script that is useful for creating and editing Event, Level, Marker, TextMark, RealMark and WaveMark channels in a time view.

Using this script you can:

  1. Create a new marker channel holding the times of peaks, troughs and level crossings in a waveform or RealWave channel.
  2. Set up a virtual window discriminator to detect peaks or troughs in a waveform channel that lie within a user-defined amplitude range.
  3. Create a new marker channel and add markers manually, using a cursor to set the time and dialogs to enter additional information, e.g. Marker codes, Text- or Real-Mark values.
  4. Create a new channel by combining groups of items copied from several other channels
  5. Edit pre-existing marker channels, either by adding new markers, deleting them or by changing the Marker codes, Text- or Real-Mark values associated with existing markers.
  6. Easily eliminate spurious markers caused by switch bounce.
This script requires Spike 2 version 5 or higher.


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.
CED home page