Sie sind auf Seite 1von 9

Journal of Neuroscience Methods 178 (2009) 188–196

Journal of Neuroscience Methods 178 (2009) 188–196 Contents lists available at ScienceDirect Journal of Neuroscience

Contents lists available at ScienceDirect

Journal of Neuroscience Methods

journal homepage: www.elsevier.com/locate/jneumeth

journal homepage: www.elsevier.com/locate/jneumeth sigTOOL: A MATLAB-based environment for sharing

sigTOOL: A MATLAB-based environment for sharing laboratory-developed software to analyze biological signals

Malcolm Lidierth

King’s College London, Wolfson Centre for Age-Related Diseases, Hodgkin Building, Guy’s Hospital Campus, London SE1 1UL, United Kingdom

article

info

Article history:

Received 3 October 2008 Received in revised form 3 November 2008 Accepted 5 November 2008

Keywords:

Software

Action potential

Spike-train analysis

Correlation

Averaging

Waveform

Spectral analysis

abstract

This paper describes a software package, named sigTOOL, for processing biological signals. The pack- age runs in the MATLAB programming environment and has been designed to promote the sharing of laboratory-developed software across the worldwide web. As proof-of-concept of the design of the sys- tem, sigTOOL has been used to build an analysis application for dealing with neuroscience data complete with a user-friendly graphical user interface which implements a range of waveform and spike-train analysis functions. The interface allows many commonly used neuroscience data file formats to be loaded (including those of Alpha Omega, Cambridge Electronic Design, Cyberkinetics Inc., Molecular Devices, Nex Technologies and Plexon Instruments). Waveform analysis functions selectable from the interface support waveform averaging (mean and median), auto- and cross-correlation, power spectral analysis, coherence estimation, digital filtering (feedback and feedforward) and resampling. Spike-train analyses include interspike interval distributions, Poincaré plots, event auto- and cross-correlations, spike-triggered averaging, stimulus driven and phase-related peri-event time histograms and rasters as well as frequencygrams. User-developed additions to sigTOOL that are archived and distributed elec- tronically will be added to the sigTOOL interface on-the-fly, without the need to modify the core sigTOOL code. Full sigTOOL functionality will be provided to support the user-developed code, including the abil- ity to record a user action history for batch processing of files and support for exporting the results of analyses to external graphics editing software and spreadsheet-based data processing packages. © 2008 Elsevier B.V. All rights reserved.

1. Introduction

The sharing of experimental data across the web is common in many fields of biology. There would be benefits also in hav-

ing a mechanism to share laboratory-developed code for analyzing data. This was recognized in the Report of the Working Group on Biomedical Computing (1999) of the United States National Insti-

software is cobbled

together by graduate students with little programming knowl- edge, for use by those whose expectations are bound by the immediate problem. The application may be used once, then abandoned when the problem is solved, the graduate student moves on, or the technology changes. The publication goes out, but the tools remain in the laboratory”. This paper describes a software package for processing biological signals that has been designed to overcome this by assisting and promoting the shar- ing of laboratory-developed software. The package, called sigTOOL, has two components: [1] a software development environment designed to facilitate further programming by the end-user and [2]

tutes of Health which states that: often “

Tel.: +44 20 7848 6175; fax: +44 20 7848 6569. E-mail address: malcolm.lidierth@kcl.ac.uk.

0165-0270/$ – see front matter © 2008 Elsevier B.V. All rights reserved.

doi:10.1016/j.jneumeth.2008.11.004

an application implemented through that environment to make the software available through a user-friendly graphical user interface (GUI). This interface is self-modifying so that end-user developed code will be made available automatically through it. The software has been developed to run in MATLAB, a general-purpose devel- opment environment that is already widely used in physiological research (for a list of neuroscience tools for MATLAB, for example, see http://www.neuromax.org/NeuroMap/MatlabTools.htm). At the outset, a number of key objectives were identified. First, it should be possible to share code through the existing web infras- tructure: there should be no need for specialized hardware or to set up and maintain dedicated sites for sharing code. The core sigTOOL code has been made available through the SourceForge software repository (Lidierth, 2008) and end-user developed addi- tions can be archived and posted to this site. The SourceForge site also provides facilities for end-users to provide criticism, to make suggestions and to subscribe to a package thereby automatically receiving an email each time the package is updated. Second, as noted above, end-user developed code should be incorporated into sigTOOL dynamically without the need to edit the sigTOOL core code. Third, sigTOOL should providemechanisms for importing data and for exporting the results of analyses. It should also provide mechanisms for recording user actions and batch-processing files.

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

189

All of these mechanisms should automatically support end-user developed code. This has been achieved by using object-oriented programming methods as described below. Fourth, data should be organized within sigTOOL to provide efficient use of memory but also to take full advantage of the highly speed-optimized matrix algebra functions built into MATLAB. Fifth, the analysis functions, including those written by end-users, should be made available through an intuitively simple GUI and this should provide online help facilities to the end-user.

2. The sigTOOL development environment

The sigTOOL development environment provides tools for importing neuroscience data from many commonly used file types (including those of Alpha Omega, Cambridge Electronic Design, Cyberkinetics Inc., Molecular Devices, Nex Technologies and Plexon Instruments as listed in Supplementary Table 1). Data are initially imported to the standard MATLAB data file format and these files are subsequently memory-mapped into the MATLAB data space through the host operating system’s virtual memory management. This allows very large data sets to be represented in sigTOOL: up to 2 Gb total on 32 bit systems, 2 Gb per channel on 64-bit systems. Routines are included to release virtual memory that is no longer required (and from the sigTOOL GUI this is done automatically).

2.1. File import functions

The file import functions provided in sigTOOL are easy to use and require no knowledge of the underlying file format on the part of the end-user. Import functions take the form:

outputname = ImportXXX(inputname);

where XXX identifies the file format, inputname is the name of the file to import and outputname is the fully qualified name of the

generated sigTOOL data file (Supplementary Table 1). This will be

a standard MATLAB MAT-file but will be given the file extension

“kcl” to distinguish it from other MAT-files. Internally it is a version 6 MATLAB file which may be modified or loaded using the built- in MATLAB save and load commands. A full specification of the file format is available (Mathworks, 2008). The batch import ofmultiple files is also supported. Users should note that custom data can readily be added to the data files. Each channel has a header and custom fields can be added to these without affecting the operation of sigTOOL. In addition custom variables, perhaps containing metadata for use in search engines, can be appended to the data files using the standard MATLAB save function.

2.2. Organization of data channels

sigTOOL supports the import of a wide range of different formats and data types but a common data structure for repre- senting these formats within sigTOOL has been developed. Data has been organized on disc, and in PC memory, to maximize speed and to take full advantage of MATLAB’s fast matrix manipula- tion routines. The organization also increases the likelihood that computations will be performed in CPU cache memory, offer- ing a further speed improvement of up to ten-fold (McGarrity,

2007).

The simplest data type is an event channel where the times-

tamps of discrete events are stored. These might be stimulus markers for example. The channel type can be ‘Rising Edge’, ‘Falling Edge’ or just ‘Edge’ (Fig. 1A). Each event may also be associated with some data. If the events are synch pulses from a CCD cam- era, the RGB data for each video frame can be associated with the events. A marker value can also be associated with each event. In the case of video data, the markers might be the video frame num- bers (as in Fig. 1B). In other circumstances the markers might be

a code representing, for example, test and control stimuli where

representing, for example, test and control stimuli where Fig. 1. Summary of the main channel types

Fig. 1. Summary of the main channel types available in sigTOOL. (A) The simplest data type is an event channel where the timestamps of discrete events are stored. (B) Each event may also be associated with some data. If the events are synch pulses from a CCD camera, for example, the RGB data for each video frame can be associated with the events. A marker value can also be associated with each event; in this case they are the video frame numbers. (C) The system can be extended by allowing more than one timestamp to be associated with each event. This allows periods of time to be represented rather than discrete moments. In the simplest case both the rising and the falling edges of the event are recorded but there is no additional data. (D) Data can be associated with the period that the timestamps define, e.g. waveform data from a single oscilloscope sweep. (E) As before, markers can be associated with each epoch, for example to classify the spikes of single neurones in multi-unit recordings. (F) Data that are sampled continuously throughout the period of recording are treated in the same way but as a single epoch with one timestamp at the start of sampling and another at its end. Note that sigTOOL also provides support for multiplexed waveform channels and for storing a trigger time as well as the start and stop times for data sampling.

190

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

these were alternated during an experiment. Markers may also be more complex structures containing metadata. The description above has identified the three components of a sigTOOL data channel: [1] timestamps associated with events [2] data associated with those events and [3] marker data used to clas- sify the events. This system can be extended by allowing more than one timestamp to be associated with each event which allows peri- ods of time to be represented rather than discrete moments. In the simplest case both the rising and the falling edges of the event are recorded but there is no additional data: this channel type is labelled as ‘Pulse’ in sigTOOL (Fig. 1C). However, data can be asso- ciated with the period that the pulse defines, e.g. waveform data from a single oscilloscope sweep (Fig. 1D). If the waveform data are multiplexed, the subchannels will simply be interlaced within the data array. In sigTOOL, channels of this type are labelled ‘Episodic’ waveforms. As before, markers can be associated with each episode, for example to classify the spikes of single neurones in multi-unit recordings (Fig. 1E). Data that are sampled continuously throughout the period of recording are treated in the same way but as a single epoch with one timestamp at the start of sampling and another at its end (Fig. 1F). Finally a specific trigger time can be associated with each event. In this case, three timestamps will be recorded: the first marks the start of sampling for each epoch, the second marks the trigger and last marks the end of sampling. These channels are of two types. For the first type, there is no fixed temporal relationship between the three timestamps in different epochs: the epochs may vary in length and the length of sample before and after the trigger can also vary. These are labelled ‘Episodic’ waveforms as before. For the second type the temporal relationship is constant: all epochs are of the same length and there is a constant pre- and post-stimulus sample length. In this case, the channel is labelled as a ‘Framed’ waveform. The very simple channel organization described above has proved versatile enough for all file formats that are presently supported. To customize the treatment of non-waveform data, including, e.g. the video data of Fig. 1, the ‘Custom’ keyword is included in the channel type description and the ImportXXX func- tion associates aMATLABm-file function with the channel to handle the data. For a video channel, this function displays the video image when the markers are clicked upon in the sigTOOL data view. Other functions could be defined to process any other type of data. For example, to embed electronic notes in a file, they could be associ- ated with a timestamp placed at some appropriate point in the file. Text associated with the note could be placed in the data field and a custom function would then be defined to display the text in an editor when the marker is clicked. If the text was in a markup lan- guage, it could be opened in the system web browser and include graphics or hyperlinks to web sites or other documents, e.g. PDF files.

2.3. Object-oriented design

MATLAB is an object-oriented programming environment and allows the definition of user-specified custom classes together with their associated methods. sigTOOL makes extensive use of custom classes to represent both imported channel data and the results of analysis functions. Methods associated with the classes provide easy access to the underlying data for program development and insulate the developer from the need to know full details of the organization of those data within the objects. In sigTOOL, the meth- ods have been profiled to identify bottle-necks in the code and to optimize them for memory and speed efficiency.

2.3.1. The scchannel class

sigTOOL data files created through a call to an ImportXXX func- tion are loaded into sigTOOL by calling the scOpen function. This

returns a cell array in which each element contains a data chan- nel represented as a custom-defined class: the scchannel class. The methods of the scchannel class include a plot function which gen- erates a sigTOOL data view together with its associated GUI. To load an imported data file into sigTOOL and display it then requires just two lines of code:

channels = scOpen(filename); plot(channels{:});

Other methods for the scchannel class provide access to the data contained in the channel. For example, to extract waveform data in relation to a trigger simply call:

[data, tb]

= extractPhysicalFrames(channel, trig, duration, pretime);

Here the first input, channel, is the scchannel object containing waveform data. It might be a continuous waveform, episodic or frame-based. The second input, trig, is a vector of trigger times while the 3rd and 4th inputs specify the duration and pre-trigger time for the returned frames. The output is a matrix of waveform values in data and the time-base relative to the triggers as a vector in tb. To average the frames and plot them in a standard MATLAB figure would require simply:

plot(tb, mean(data));

In practice, sigTOOL analysis function place results in another sigTOOL-defined class: the sigTOOLResultData class. The methods

for this class include an overloaded plot method that will generate

a standard sigTOOL result view with its associated GUI rather than

a standard MATLAB figure. Further details are given below.

2.4. Event filtering and subchannel selection

As outlined above, sigTOOL allows the representation of dis-

crete events as timestamps and associates waveform data with

a set of timestamps that define the beginning and end of each

data epoch together with an optional trigger time. A property associated with the scchannel class allows specific events or data epochs to be labelled as valid or invalid. This allows these events or epochs to be selected for analysis. sigTOOL distinguishes between the events/epochs that are physically present on a channel and those that are flagged as valid through the scchannel methods. For the example given above, extractPhysicalFrames was called which returned data from all epochs in the target channel. If data were

required only from valid data epochs a similar call would have been made to extractValidFrames. In general in two-channel analyses, selection of data epochs would be done on a single channel and in the case of data averaging this would normally be the trigger chan- nel. In the example above, the call to extractPhysicalFrames would have been preceded by a call to the getValidTriggers method which would have returned only those trigger times that were marked as valid on the trigger channel, e.g.

trig = getValidTriggers(channel, 0, Inf);

Here again, channel is a scchannel object and the subsequent argu- ments define the period over which to return triggers: in this case time zero to infinity (in effect, the end-of-sampling). The returned trigger times would then be used as input to a subsequent call to extractPhysicalFrames. Every event or data epoch in a scchannel object has an associated logical flag which determines whether it is valid. Entirely arbitrary sets of valid events may therefore be defined. However, the flags will often be set according to the value of the marker data associated with them or to select, for example, only odd- or even-numbered events. The sigTOOL GUI includes menus for doing this interactively.

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

191

The scchannel objects also contain a current subchannel prop- erty that directs some sigTOOL functions to the appropriate subchannel on multiplexed channels. For simplicity, relatively few functions honour this setting: these are those for copying channels, digital filtering and downsampling. These functions can be used to extract the relevant subchannel to a new channel where all remain- ing sigTOOL functions can then be applied to the extracted data in isolation.

2.5. sigTOOL result objects

As noted above, analysis functions in sigTOOL also return a custom-defined object class: the sigTOOLResultData object. Typi- cally this will be constructed by first building a standard MATLAB structure (this is computationally faster than assigning data to an object when large data sets are involved). As before, the plot method has been overloaded for sigTOOLResultData objects so that, when plotted, a standard sigTOOL result view is displayed together with its GUI. A further custom object, a sigTOOLResultView object, will be placed in the application data area of the associated MATLAB figure (the application data area is a standard property of all MATLAB fig- ure objects which allows user-specified data to be associated with the figure, see Hanselman and Littlefield, 2001). The methods of the sigTOOLResultView class provide access to the export functions that can be used to send data to external graphical packages (e.g. Adobe Illustrator) or, in numerical format, to spreadsheet-based packages (such as Microsoft Excel) as described below.

3.

The sigTOOL GUI

3.1.

Adding functions to the GUI

The sigTOOL GUI is dynamic. New functions are made available on-the-fly, without the need for the end-user to modify any of the sigTOOL core code. sigTOOL selectively replicates its own folder structure to create the GUI menus of a data view. This process is recursive and allows nesting of folders, and therefore of generated menus, to any level. To add a new suite of functions, the end-user would typically create a new subfolder in the sigTOOL\program folder. The name of this folder should have the prefix “menu ”.

Any subfolders within this folder that are similarly prefixed will be added as submenus of the parent menu. In addition the “group ”

prefix can be used to add multiple files without creating a new level in the menu hierarchy. Each branch of the folder, and there- fore menu tree, needs to terminate with one or more executable files (typically a MATLAB m-file) whose name is also prefixed with “menu ”. These files will be executed as standard MATLAB callback

routines (see Hanselman and Littlefield, 2001) when the menu item is selected by the user. While the menu is being generated on- the-fly, each function will be called by sigTOOL with a single input argument of zero. The functions should respond by passing back the text to display in the menu and a logical flag that indicates whether to activate the menu item or not, thus allowing the menu to be dis- abled if it cannot be used on the current computer (e.g. if an absent MATLAB toolbox is needed). Using the facilities described above, end-users can add functions to the sigTOOL GUI and distribute them across the web as archives, e.g. in zip compressed format. When extracted from the archive to a sigTOOL subfolder, the appropriate menus will automatically be generated the next time sigTOOL is run. Further details are supplied in the Programming Guide.

3.2. Designing GUIs

Typically, a user-written menu function will display a GUI prompting the user to select data and analysis options. MATLAB

includes a set of user interface tools and a GUI development envi- ronment that can be used to create these GUIs. However, sigTOOL contains a number of custom-developed tools that make the design of sigTOOL-based GUIs simple. At the lowest level, these include

a custom-written jcontrol class that allows a wide range of Java

Swing components to be incorporated directly into sigTOOL graph- ical windows. Medium- and high-level routines are also provided; these require less knowledge of both Java and MATLAB on the part of the end-user and will generally be used in preference to the low-level routines. Fig. 2A illustrates a typical sigTOOL GUI. In this case the main panel allows the selection of trigger and source channels and allows selection of the time range for the data to be analyzed. This panel also allows the user to elect to analyze all open data files and to view the online help as described further below. The right-side panel provides specific options for the chosen analysis. In the case of waveform averaging, this allows the dura- tion and pre-stimulus period to be set, the number of sweeps per average and whether to analyze data in overlapping blocks. Fur- ther options allow retriggering of the averaging process during a sweep, removal of any DC component from the result and a choice of mean or median averaging. When the OK button is selected, a structure containing the user selections will be placed in the source figure application data area and can be retrieved by the calling code. The medium and higher level sigTOOL GUI functions include automatic support for providing online help. The programmer needs to supply help as a hypertext markup language (HTML) file. The name of this file is made available from the user’s GUI. Typi- cally, the file should be placed in a \private\help folder contained in the parent folder of the calling function. This will ensure that the file will be found regardless of the absolute location across dif- ferent computers/operating systems. Fig. 2B shows the help file for waveform averaging GUI displayed in the MATLAB web browser.

3.3. Accreditation

A key goal of sigTOOL is to encourage its use by other laborato- ries in developing specialized shared code libraries. This requires

that the efforts of those laboratories be clearly acknowledged par- ticularly within the sigTOOL GUI. The GUI tools provided in the development environment allow acknowledgement text to be dis- played in the user interfaces (as in Fig. 2A) and to be added to sigTOOLResultData objects. This text will be included in print-outs

of the results. In addition, the sigTOOL progress bar allows users to

display their own graphical logo instead of the standard sigTOOL logo during calculations.

3.4. Generating a history log

The standard sigTOOL menus allow users to elect to apply an

analysis to all open sigTOOL data files in any instance of MATLAB. The data view file menu also allows a history log to be recorded for use in subsequent batch processing of multiple files. Both of these functions are coordinated by the scExecute function. This serves as a gateway between the sigTOOL GUI and the analysis rou- tines. Importantly, end-users who use this gateway from their own menu functions will find that the ability to process all open files

is automatically available and, within certain constraints, that the

history m-file will automatically call the end-user’s functions when batch-processing multiple files. The history log is an m-file which can be saved, edited and run

like any other MATLAB m-file. The text of this m-file is initially built

in the MATLAB figure application data area of the sigTOOL data view

(see above) by the scExecute function.When the history log is saved, the text saved in this area is simply written to an m-file.

192

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

/ Journal of Neuroscience Methods 178 (2009) 188–196 Fig. 2. (A) shows a typical sigTOOL analysis

Fig. 2. (A) shows a typical sigTOOL analysis GUI. The example shown is for waveform averaging and the associated help file is shown in (B) displayed in the MATLAB web browser.

4. Features of the sigTOOL data and result views

There are two standard views in sigTOOL: the data view which displays the file channel data and the result view that displays the results of analyses. The data view provides a channel manager that can be used to select the channels to display as well as those to use for analy- sis. Channel selections can be drag-and-dropped from the channel manager into analysis GUIs. As noted above, the data view also pro- vides menus for selecting analysis functions and these will include any user-supplied menu functions that have been added on-the-fly. The recording of a history log is also implemented through the data view. The result view similarly includes a result manager that allows the type of graphical display to be selected and for selection of fea- tures such as line colour and thickness and to allow rotation, zoom, etc. for three-dimensional graphics. The result view also provides automatic access to the data export functions allowing results to

be exported to external graphical or numerical analysis packages. If user-written functions return a sigTOOLResultData object, all of these features will automatically be available without further pro- gramming simply by calling

plot(object);

The versatility of the system is best illustrated with an example. In Fig. 3, a series of waveforms averages are shown superimposed. Two channels of data were recorded, one showing the potential recorded at depth in the superficial dorsal horn of the spinal cord and another of the dorsal root potential (see Lidierth, 2006). These were averaged over 320 presentations of a stimulus to a neighbour- ing dorsal root with each average being calculated over twenty sweeps. The 16 resulting averages are shown superimposed for each channel in Fig. 3A. By selecting ‘Single Frames’ from the Result Manager, the individual averages together with their standard devi- ations will be displayed (Fig. 3B). Choosing ‘Waterfall’ displays all

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

193

/ Journal of Neuroscience Methods 178 (2009) 188–196 193 Fig. 3. (A–C) show a set of

Fig. 3. (A–C) show a set of waveform averages collected over time in a single experiment. The waveforms may be shown superimposed as in (A), as single sweeps complete with standard deviations as in (B), or in a waterfall display as in (C). (D–F) also show waveform averages but for a different data set. In (D), a surface has been fitted to the data while (E) and (F) show the data as an isopotential contour map and bitmapped image respectively. The display types are interchangeable and selected from the Result Manager panel shown to the left in each figure.

of the averages in a three-dimensional plot (Fig. 3C) and a surface can be fitted if chosen from the channel manager. Such a surface plot is shown in Fig. 3D for a different data set. Here the antidromic compound action potential has been recorded from the L4 spinal

root in response to a stimulus delivered at different depths in the spinal cord with depth being represented on the y-axis. The same data are represented as an isopotential contour map in Fig. 3E and as a bitmapped image in Fig. 3F. The ability to swap between these

194

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

/ Journal of Neuroscience Methods 178 (2009) 188–196 Fig. 4. Result data displayed in sigTOOL is

Fig. 4. Result data displayed in sigTOOL is readily ported to other applications. (A) shows a Poincaré plot formed from a neural spike-train while (B) shows a waveform cross-correlation based on two, simultaneously recorded dorsal root potentials. In each plot, a section of data has been selected using the mouse and these data are displayed numerically in a table from where they may be copied and pasted to other applications. Automatic export is also supported. In (C), the Poincaré plot has been saved and opened in Adobe Illustrator format. The plot was also converted to a surface in sigTOOL illustrating the density of points and this was exported in PDF format and imported to the Illustrator software. (D) shows the data of B exported to Systat SigmaPlot and redrawn in that package. (E) illustrates distribution fitting in sigTOOL: a normal distribution based on maximum-likelihood parameter estimates is shown fitted to a selected range of bins in an interspike interval distribution. In (F), the declining phase of the 2nd peak in the interval distribution has been selected and an exponential curve has been fitted to the selected data using the EzyFit package (Moisy, 2006) as illustrated in the inset.

M. Lidierth / Journal of Neuroscience Methods 178 (2009) 188–196

195

display types, and others, is made available automatically from the sigTOOL result view as long as data for all three axes has been defined when constructing the result object. Typically this simply means supplying a vector of values for the third dimension, with one entry for each sweep in the result. Graphical results from sigTOOL can easily be exported to other formats as summarized in Fig. 4. The “File-Save As” menu can be used to export graphics as BMP and TIF formats for bitmapped images and PDF, EPS and Adobe Illustrator formats for vector images. The exported data will be displayed automatically in the appropriate editing software (e.g. Adobe Illustrator in Fig. 4C). On Windows platforms, numerical data from the result view can also be exported directly to spreadsheet-based packages using ActiveX. Support is included for Microsoft Excel, Systat SigmaPlot and OriginLabs Origin software (SigmaPlot shown in Fig. 4D). When multiple graphs are shown in a sigTOOL result view, the user can elect to export one or all of them. With multiple plots, a separate worksheet will be opened for each graph. In addition, and on all operating systems, users can select data in a result view and open

a MATLAB-based spreadsheet to display it numerically (Fig. 4A and

B). These data can then be cut-and-pasted into external packages manually. sigTOOL result views also provide a context-sensitive menu that can be used to modify the figure or to add new components. The standard context-menu can be supplemented with menu items that are specific to a particular analysis. This is achieved simply by adding a uicontextmenu object (which is a standard object in MATLAB) to the sigTOOLResultData object when it is constructed. Fig. 4E and F illustrate distribution and curve fitting implemented through these context-menus.

5. Proof-of-concept

The development environment described above has been used to implement a set of analytical tools for processing waveform data and neural spike trains. These tools have been added using the on- the-fly mechanisms described above in “Adding functions to the GUI” and thus provide a proof-of-concept for the underlying design of the system. Waveform processing functions include those for averag- ing (mean and median), auto- and cross-correlation (Fig. 4B), power spectral analysis, coherence estimation, digital filtering (feedback and feedforward) and resampling. Spike-train analyses include interspike interval distributions (Fig. 4E and F), Poincaré plots (Fig. 4A), event auto- and cross-correlations, spike-triggered averaging, stimulus driven and phase-related peri-event time his- tograms and rasters as well as frequencygrams (Türker and Powers, 2005). Automatic spike recognition is supported through an inter- face to the Wave clus spike sorting package (Quiroga et al., 2004).

In addition, spike trains can be transformed to rate histograms allowing any of the waveform analysis routines above to be applied to them. Further analysis functions will be added in the future.

6. Discussion

The MATLAB environment provides a number of advantages for code development in the laboratory. The high-level functions it supplies for analyzing data and for visualizing results allow rapid program development. They are also usually highly optimized for execution speed on the target platform and will, therefore, gen- erally out-perform code written by the end-user using languages such as C++ and FORTRAN. Recent versions of MATLAB also include just-in-time compilation which further enhances execution speed.

It was found necessary to write code in the C++ language to improve

performance for only two analysis functions in sigTOOL: those for event correlation and rasters. Some manufacturers have recognized the benefits of MATLAB and provide facilities to export data to MATLAB from their appli- cations. With sigTOOL, a further step has been taken: sigTOOL effectively provides a fully featured neurophysiological analysis application running entirely within the MATLAB environment. A similar innovation features in the FIND software package (Meier et al., 2008) and in the NeuroMAX project of RC Electronics Inc. (see http://www.neuromax.org). Both of these build on the Neuroshare data representation for single and multiple unit activity. FIND also includes data import from some network simulation environments. NeuroMAX is a commercial project and, unlike FIND and sigTOOL, its code will not be entirely open-source. A further advantage of MATLAB lies in its widespread use across many different disciplines. A large volume of end-user writtenMAT- LAB code is freely available on the worldwide web and may be adapted to the needs of the neuroscientist. Use of such code has already been made in sigTOOL: thus support for importing multi- media files has been implemented using code written by Richert (2005) and curve fitting has been implemented using the EzyFit package of Moisy (2006). In addition, an interface has been included to the Wave clus spike recognition package described by Quiroga

et al. (2004). The current implementation of sigTOOL provides a highly ver- satile environment for analyzing neuroscientific data. Features available through the GUI provide an application that compares favourably in functionality with many commercial spike-train analysis packages and in some respects provides enhancements; notably, for example, in the ease with which data can be exported to external spreadsheet-based analysis software and to graph- ics editing packages. Further development of sigTOOL is planned and this will, in part, be user-led: users are encouraged to post comments and suggestions on the sigTOOL download site or to email sigtool@users.sourceforge.net. However, the primary objec- tive in developing sigTOOL was to assist code development by other laboratories and to promote the sharing of that code between lab- oratories. To make full use of the facilities of sigTOOL requires the programmer to use the custom-defined classes that have been created as part of the sigTOOL environment. It is hoped that the programming effort required in constructing these objects will be more than compensated for by the accessibility and usability that the class methods provide to the end-user/programmer. Nonethe- less, every effort has been made to keep the construction of these objects as simple as possible. Full User and Programming Guides are included in the sigTOOL download (Lidierth, 2008).

Appendix A. Supplementary data

Supplementary data associated with this article can be found, in the online version, at doi:10.1016/j.jneumeth.2008.11.004.

References

Hanselman DC, Littlefield B. Mastering MATLAB 6. New Jersey: Prentice-Hall; 2001. p. 486. Lidierth M. Local and diffuse mechanisms of primary afferent depolarization and presynaptic inhibition in the rat spinal cord. J Physiol 2006;576:309–27. Lidierth, M. sigTOOL, http://sigtool.sourceforge.net; 2008. Mathworks. MATLAB 7 MAT-file format, http://www.mathworks.com/access/ helpdesk/help/pdf doc/matlab/matfile format.pdf; 2008.

McGarrity, S. Programming patterns: maximizing code performance by opti- mizing memory access, http://www.mathworks.com/company/newsletters/ news notes/june07/patterns.html; 2007.

Meier R, Egert U, Aertsen A, Nawrot MP. FIND—a unified framework for neural data analysis. Neural Network 2008;21:1085–93. Moisy, F., EzyFit 2.20, http://www.mathworks.com/matlabcentral/fileexchange/ loadFile.do?objectId=10176&objectType=file; 2006.

196

Quiroga R, Nadasdy Z, Ben-Shaul Y. Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering. Neural Comput 2004;16:

1661–87.

Richert, M. Mmread, http://www.mathworks.com/matlabcentral/fileexchange/ loadFile.do?objectId=8028&objectType=file; 2005.

Türker KS, Powers RK. Black box revisited: a technique for estimating postsynaptic potentials in neurons. Trends Neurosci 2005;28:379–86. Working Group on Biomedical Computing. Biomedical Information Science and Technology Initiative (BISTI), http://www.nih.gov/about/director/060399.htm;

1999.