Batch import "foreign" file formats
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.
- DSI importer now works
- ADI LabChart
- Lab streaming layer (*.xdf)
- The TDT importer has been updated.
- Ponemah and Xltek -Neuroworks importers have been added. (users of Spike2 8.08 and higher).
Hum Remove Express
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.
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
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)
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
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
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
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
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.
Re-run a Spike2 data file and video, marking behavioural events and states
Ethogram.s2s (11/23) New!
This script allows you to annotate physiological data that was recorded together with a video (usually of animal behaviour) created using s2video. You can replay the video and Spike2 data at the desired speed and mark significant behaviours in the data file via the keyboard. The script creates two channels for recording different categories of behaviour, "States" and "Events".
States are marked with colour-coded horizontal bars that start when you hit the relevant key and continue until you press space bar or start another state.
The Event channel simply records the occurrence of brief behaviours with colour-coded TextMarks. Both States and Events are also marked in 'skyline' plots,where each behaviour type is represented by a different level (analogous to the hypnograms often used in sleep studies). The 'level' channel for events has brief deflections of a standard duration (0.2s).
You can specify up to 26 behaviours (one per letter of the alphabet) along with a label for each one (up to 80 chars.). The labels display in State markers or when you point at an Event mark with the mouse.
The script has editing tools so that you can correct mistakes in the ethogram channels. and generates a table summarising the results.
You can view and print out a user guide by clicking a button on the script toolbar.
Requirements: Spike2 v 8.25 or higher, and the library ug.s2s.
Edit channel titles quickly and reversibly
ChanReName.s2s (08/23) Improved!
Some Spike2 scripts, usually those which process multiple data sets stored in a single file, require that channel titles match a specific
naming scheme in order for the script to recognise which channels to process. For example, scripts processing systolic blood pressure traces from multiple animals may require blood pressure channel titles SBP: 1 through to SBP: n.
This script provides a quick way to rename multiple channels to match the requirements of an analysis script and, to restore the original channel
titles afterwards. Up to 20 channels can be re-titled in a single pass. You must run the script again to restore the original titles.
The script adds a hotkey labelled "ChRename" to the script bar for quick access.
This script requires Spike2 version 7.20 or higher.
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
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.