• UK
  • US
  • Français
  • Deutsch
  • Español (precios €)
  • Portugal
  • Polski
  • 日本人
  • 中國傳統
  • 简化中国

Spike2 Scripts


Editing

Batch import "foreign" file formats
uBatchImport.s2s (08/18)

uBatchImport.zip

You can import many foreign data formats into Spike2. Individual files can be imported interactively via Import on the Spike2 File menu. However, this becomes tedious if you have many files of the same type to import. This script allows you to import all files of a user-defined type in a specified folder. Certain restrictions apply. For example, some formats can only be imported using the 32-bit version of Spike2. See the on-line help under "import foreign data file" for further information.

The script requires Spike2 v8.04 or later.

Improvement:

  • DSI importer now works
  • Ponemah and Xltek -Neuroworks importers have been added. (users of Spike2 8.08 and higher).

Hum Remove Express
HumRemoveExpress.s2s (01/18)

HumRemExpress.zip

This script is a streamlined hum removal script for use when you have recorded a reliable hum marker event channel using the CED Mains pulser or similar device. See a video demonstration.

If you need to derive a hum marker from a waveform channel that contains hum then you should use the original HumRemove script

The script requires Spike2 v7.20 or later.

Hum Remove
HumRemove.s2s (02/18)

HumRemove.zip

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.

This upgraded version of the script requires Spike2 v7.20 or later.

Waveforms should be recorded with a sampling rate of at least 500Hz and preferably 5kHz or higher. The best results will be obtained if you record a dedicated waveform channel that clearly shows the ongoing mains frequency oscillation in addition to your data channels. This could be simply the mains pick-up from an unshielded cable. The script can use this signal to generate an event channel of timing marks at the onset of each mains cycle. These time marks are then used to calculate the mains interference signal to subtract from each waveform to clean it up.

See the data sheet Hum Remove.pdf, included in the HumRemove.zip file, for full details.

Convert .smr files to 400 channel big file format
Batch400.s2s (08/18)

batch400.zip

Normal Spike2 time views can have up to 400 channels and a size up to 2 GB. However, the default number of channels created by a sampling configuration is 32. This may not be enough if your data analysis involves creating many additional channels.

This script allows you to batch convert all the .smr files in a selected folder to 400 channel big file format so that you do not run out of free channels during analysis and can grow your file beyond the 2GB size limit. This script has been carefully tested. However, there are no guarantees. Back up your data before running it!

Annotate a data file
Add Tmk.s2s (01/17)

AddTmk.zip

This script allows you to add TextMarks to a time view, off-line. You can use it to add or delete TextMarks in an existing disk-based channel or create a new TextMark channel. The script creates a hotkey labelled Add Tmk on the Script Bar. Click on this button or its keyboard shortcut Alt+T to run the script. The main script dialog has a Help button. Click on it to display the script’s user guide.

The script requires Spike2 v6.18 or later.

Mark significant data with coloured bars
MarkStates.s2s (09/16)

MarkState.zip

This script allows you to create a ‘state’ channel in a time view and use it to mark significant time ranges in your data with coloured, labelled bars. These bars can be added automatically to mark episodes when a waveform channel exceeds (or falls below) a user-define threshold. Alternatively, you can mark time ranges manually by clicking and dragging with the mouse.

Up to 6 different colours and labels can be used per State channel to mark different types of event. The script can generate a simple report of the onset times and durations of states and the order in which they occurred.

Tested with Spike2 v 7.18 and 8.10

Time shifting event data
TimeshiftEvents.s2s (04/10)

TimeShiftEvents.zip

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.

The script requires Spike2 v5.21 or later.

Insert event trains off-line
AddEvents.s2s (04/10)

AddEvents.zip

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.

The script requires Spike2 v5.21 or later.

Number events from 1 to n
StimNumber.s2s (04/10)

StimNumber.zip

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.

The script requires Spike2 v5.21 or later.

Align comments in a script
Align Comments.s2s (08/15)

AlignComments.zip

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.

Tidy up the layout of a script
Script_Tidy.s2s (04/08)

ScriptTidy.zip

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
MergeFiles5.s2s (01/17)

MergeFiles5.zip

This utility script allows you to:

  • Merge all the time views in a selected folder into a single data file
  • Copy and paste data between open time views
  • Delete data from selected time ranges in a time view

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 included in the standard Spike2 scripts folder for Spike2 v6 and later.

Concatenate Files
Concatenate01.s2s (06/18)

ConcatFiles.zip

This script is intended for merging batches of data files that were recorded in a time sequence with the same sampling configuration. Files are joined end-to-end and gaps are inserted when there is a delay between the end of one recording and the start of the next. This means that a time axis accurate to the nearest second is maintained. This is especially important when concatenating long-term recordings where time of day and duration of gaps is important.

The script applies the resource file of the first source file in a batch in order to retain Virtual channels, channel processes, channel display order etc. in the destination file.

Further information is contained in the comments at the start of the script itself.

Tested with Spike2 v8.05. Compatible with Spik2 v7.07 or higher.

Delete Ranges
DeleteRanges04.s2s (11/17)

DeleteRanges.zip

This script requires Spike2 v7.07 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.

Remove artifacts that extend above or below the level of physiological data
UnClip.s2s (02/20)

unclip.zip

Many types of analysis involve detecting events that cross a threshold level. This threshold is usually based on the mean level+ some multiple of the standard deviation.

Measuring the mean and stdev is tricky in cases where the data is affected by artifacts that cause the waveform repeatedly to hit the limits of the recording range, ie, 'clipping'. This is a problem that is often encountered when using telemetry systems to record EEG or ECG.

This "no frills" script provides a method to alleviate this problem by identifying artifacts that exceed or fall below a user-defined threshold and making a RealWave copy of the affected channel with the artifacts replaced by a user-defined baseline level. It should reduce the distortion of mean and sd measurements and make the data easier on the eye by removing glitches.

This script requires Spike2 v7.19 or higher.

Remove artefacts from an event channel
debounce.s2s (07/09)

debounce.zip

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 02.s2s & ECGdelete v5.s2s (04/20)

ECGdelete.zip

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, ECGdelete 02.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.s2s & artrem6.s2s 03/16

artrem.zip

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
FeatureDetect.s2s (10/11)

FixGlitch.zip

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.

Convert a result file to a data file
RES2SMR.S2S (06/02)

res2smr.zip

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

Process event channels in a time view
ProcEvts.s2s (01/17)

ProcEvts.zip

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:

  • Create a new marker channel holding the times of peaks, troughs and level crossings in a waveform or RealWave channel
  • Set up a virtual window discriminator to detect peaks or troughs in a waveform channel that lie within a user-defined amplitude range
  • 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
  • Create a new channel by combining groups of items copied from several other channels
  • 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
  • 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 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.

  • ADInstruments Labchart
  • Alpha MED Sciences
  • Alpha Omega Engineering
  • Axon Instruments
  • Axona
  • Binary data
  • Bionic/Cyberkinetics
  • Biopac
  • CED CFS
  • CED SON (Macintosh)
  • COLD_Datein
  • CONSAM (D. Colquhuon)
  • DATAQ Instruments (Codas)
  • DataWave
  • DATAPAC
  • Data Sciences International
  • Delsys Files
  • elmiko medical
  • European Data Format(+)
  • Grass-Telefactor (PolyView)
  • HLR Data Format
  • Heka Data Format
  • INTAN
  • LabRecorder
  • LabStreamingLayer - LSL
  • Multi Channel System (Mc_Rack)
  • MindSet (16/24) data Files
  • MindWare data files
  • Motion Labs Systems Files .c3d
  • NeuroScan
  • Neuralynx
  • NewBehavior
  • Plexon
  • Ponemah 6
  • RC Electronics
  • Ripple Neuro
  • Text files
  • TMS International
  • Tucker-Davis Technologies
  • WAV (Microsoft)
  • WaveMetrics Igor Pro (PC/Mac)
  • Xltek Neuroworks
×
Cambridge Electronic Design Limited

Registered in England: 00972132

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

×