Editing    Analysis    Display    Archive Scripts    Useful Script Functions    Control

On-Line    Experiments    Examples of Method    Spectrum    Export

Editing
Hum Remove
Interactive TextMark addition
Time shifting event data
Insert event trains off-line
Number events from 1 to n
Align Comments in a script
Tidy up the layout of a script
Merge Files
Delete RangesNew
Copy a channel with time offset
Differentiate and integrate waveform data
Remove artefacts from an event channel
Remove ECG artefacts from emg channelsNew
Remove stimulus artefacts
Fix GlitchesNew
Undelete a data channel
Convert a result file to a data file
Import data from a text file
Process event channels in a time view
Hum Remove HumRemove.ZIP 209,008

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, included in the HumRemove.ZIP file, for full details.


Interactive TextMark addition MouseEvent.zip 1,333

This script is an example that allows the addition of TextMark items interactively to a region of data by holding down the Shift key and clicking and dragging the mouse pointer.

This script requires Spike2 v7.01 or higher.


Time shifting event data TimeShiftEvents.zip 2,077

This script can be used to copy event or marker times from a currently selected data file to a new permanent channel in any open data file. The script creates two cursors to select the data range to copy and you can apply an optional time shift by setting the start time for the data in the new channel. A suitable example data file, Demo.smr is included in the Data folder of your Spike2 directory.

This script requires Spike2 v5.21 or higher.

Keywords: Time shift, copy events


Insert event trains off-line AddEvents.zip 1,414

This script allows the user to set a time range and frequency of stimulation for adding events into a new channel in a data file at the specified interval and time range. The script also allows the addition of multiple event trains into the same channel.

This script could also be used to create pulse trains at a set frequency for output. Once the events have been created as an event channel in the data file, you could load them into the output sequencer using the PlaySpikeTimes script.

This script requires Spike2 v5.21 or higher.

Keywords: Pulse trains


Number events from 1 to n StimNumber.zip 1,093

This script can be used to give an identifying number to stimulus events, spike shapes or markers. The script creates a new TextMark memory channel that holds text strings starting at 1 for the time of the first event in range. A suitable example data file, Demo.smr, is included in the Data folder of your Spike2 directory.

This script requires Spike2 v5.21 or higher.


Align Comments in a script 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 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 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 Spike2 scripts folder for users of Spike2 v 6 and higher.
Delete Ranges deleteranges.zip 3,841

This script requires Spike2 v6.16 or higher. It allows you to delete marked time ranges from a Spike2 time view. Mark the time ranges to cut out using the TimeRanges.s2s script in your Spike2 scripts folder. Then run this script to create a new edited data file.
The original data is untouched. You could use this script to generate ‘edited highlights’ of your data or to remove stimulus artefacts.


Copy a channel, with time offset copy_ch1.zip 2,295 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.


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

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


Remove artefacts from an event channel debounce.zip 853 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 ECG artefacts from emg channels ECGdelete.zip 12,862

This script reduces the size of ECG artefacts in emg recordings by reference noise subtraction. You will need to record a dedicated ECG channel alongside your data as a source for Events marking the position of the artefacts unless the artefacts on the emg channels themselves are sufficiently large for reliable triggering.

The zip file includes 2 scripts, ECGdelete01.s2s suitable for use with Spike2 v7.07 or higher and ECGdelete v5.s2s for use with Spike2 v5.21 and v6.


Remove stimulus artefacts artrem.zip 7,004 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.

The download now includes an updated version for users of Spike2 v6 and higher. The basic version is still available for users of earlier versions of Spike2.


Fix Glitches FixGlitch.zip 6,491

This version 7 script replaces glitches or artefacts on a Waveform or RealWave channel using linear prediction. Put simply, the script replaces segments of “bad” data with a wavefom of similar spectral content to the “good” data on either side of the glitch.


Undelete a data channel spike\scripts\undelch.s2s 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 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 imptext.zip 2,413 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.


Process event channels in a time view 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.