A software-based platform for multichannel ... - IEEE Xplore

3 downloads 9166 Views 1006KB Size Report
software was designed to exploit modern MultiCore CPUs for large scale data ..... A custom made amplifier provided further 10X amplification along with 4 pole ...
This full text paper was peer-reviewed at the direction of IEEE Instrumentation and Measurement Society prior to the acceptance and publication.

A software-based platform for multichannel electrophysiological data acquisition G. Frigo1, M. Rubega1, G. Lezziero1, R. Fontana2, C. Cecchetto1,2, S. Vassanelli2, G. Sparacino1 and M. Bertocco1 1Department 2NeuroChip

of Information Engineering, University of Padova, Padova, Italy Laboratory, Department of Biomedical Sciences, University of Padova, Padova, Italy

Abstract— Recent improvements in microelectrodes technology have enabled neuroscientists to record electrophysiological signals from hundreds of neurons and simultaneously from a large number of channels. However, several environmental factors may introduce noise and artefacts and affect proper interpretation of recordings. Thus, the development of appropriate signal acquisition and processing platforms dealing with large data sets and in realtime represents a current fundamental challenge. In the present work, we present an easily-expandable Lab VIEW based software for handling data in real-time during a multichannel neurophysiological signal acquisition. The software was designed to exploit modern MultiCore CPUs for large scale data processing and, by freely setting key acquisition parameters, to work with virtually any kind of biological signal. The software allows for data storage in MATLAB format to facilitate off-line signal processing. Examples of local field potential signal acquisitions from the mouse hippocampus are reported to illustrate software features. Keywords—multichannel acquisition, real-time, LabVIEW, electrophisiological data, local field potential.

I. INTRODUCTION ISTORICALLY, extracellular activity in brain has been measured in vivo by means of various electrophysiological techniques, ranging from electroencephalography [1] to recording of field potentials by electrodes implanted in the neural tissue for detection of extracellular spikes, multiunits and population local field potentials (LFPs) [2]. The recent improvements in multielectrode array technology have now enabled neuroscientists to record LFPs from hundreds of sites simultaneously, offering the possibility to investigate large neuronal populations [3]. However, while experimental techniques are becoming increasingly sophisticated [4] [5] and the understanding of the networks behavior deepens, the overall amount of data is posing a serious challenge both at the recording and at the analysis level. Commercially available solutions, e.g., the PowerLab® board (ADInstruments, Dunedin, NZ) or the In vivo MESystem® (MCS Gmbh, Reutlingen, DE), offer remarkable performances in terms of acquisition data reliability and real-time signal monitoring [6] [7]. Such systems provide a multichannel architecture for the simultaneous acquisition of multiple electrophysiological signals. In these hardware solutions, however, the experimental setup is typically predefined and can not be easily tuned according to specific case requirements. In the presence of unconventional test conditions, neuroscientists are thus forced to develop inhouse software solutions, strongly dependent on the

H

978-1-4799-6477-2/15/$31.00 ©2015 IEEE

instrumentation and equipment in use. Unfortunately, this approach leads to the proliferation of many similar acquisition approaches that differ only by minor implementation details and, more important, usually lack of expandability and portability features. Conversely, a unified and flexible software platform would be preferable. In this regard, for instance, the Biosignal Igniter Toolkit (BIT) combines a hardware board for electrophysiological data acquisition with a webbased graphic user interface (GUI) that provides specific software tools for data visualization and recording [8]. The literature offers also several software packages that allow preliminary data processing and signal features extraction. In the MatLAB programming environment, gBSanalyze® (Gruger Technologies, Graz, AT) provides a wide range of modular toolboxes for sophisticated data analysis. Similar results can be obtained by PhysioScripts® suite [9] in the R programming environment. This open source platform has been explicitly designed to be portable and can be easily extended through the addition of new ad hoc subroutines. In the present article, we illustrate the design and use of a new software platform for multichannel acquisition of electrophysiological data. The active channels number can be freely customized till the depletion of available computational resources. The project has been entirely developed in LabVIEW 2014 programming environment. Thanks to the extensive driver libraries, LabVIEW programs are very portable and can be easily adapted to cope with different instrumentations. The software presents a modular architecture and can be easily expanded, including or modifying its functionalities. Throughout an intuitive GUI, the user can set the active input channels and real-time monitor acquired data both in the time and the frequency domain. Some basic filtering functionalities are also provided and allow to single out the contribution of specific bands of interest.The acquired data can be stored also in MatLAB .mat format, easing subsequent analysis and feature extraction. In fact, the proposed software is not intended for extensive data processing, which is computationally demanding and can be more accurately carried out off-line. The in vivo use of the platform has been assessed within real experimental sessions, where two electrophysiological datastreams are simultaneously monitored, i.e. the electrocardiogram (ECG) and the LFP acquired from one electrode implanted in the hippocampus of a mouse. In this context, the real-time visualization function allows a constant monitoring of the experimental conditions, but

also a more suitable electrode positioning. Preliminary experimental results confirm that the proposed software copes with simultaneous recording of long-lasting traces and can be easily adapted to different sources and setups. A thorough comparison between the performances of existing software platforms is beyond the scope of this paper. Nevertheless, some quality metrics of the proposed software are briefly discussed, particularly in terms of computational requirements. II. SOFTWARE REQUIREMENTS The aim is to design a novel LabVIEW software platform for multichannel acquisition and real-time visualization of electrophysiological signals. Based on practical experience, we will deal with the following specific experimental requirements: • Long-lasting recording: the proposed software requires a reduced computational effort and is thus able to carry out recordings of over two hours, without data loss or necessity of lossy data compression. • Efficient storage strategy: an electrophysiological acquisition often results in a large amount of data to be stored or transmitted to processing units; our platform lets the data to be saved also in .mat format, which is cheaper in terms of memory occupation and can be directly imported and processed in MatLAB environment. • Modular hierarchical architecture: this novel platform is hierarchically designed, more precisely, a generic acquisition protocol is supplied with specific function modules, which can be separately modified, replaced or updated. • Interface with instrumentation level: LabVIEW driver libraries allow to communicate with many different instrumentations throughout an intuitive GUI. • Real-time monitoring: even before extensive processing, the acquired data can be truly informative; on-line monitoring of signal temporal and spectral trend may reveal instrumentation malfunctions, interferences, or unexpected physiological conditions; moreover, realtime knowledge of acquired signal may be helpful for a suitable electrodes calibration and positioning. III. SOFTWARE DESIGN AND DEVELOPMENT A. The graphical user interface (GUI) The software GUI has been developed to be easily used by non-programming users. Indeed, the software platform provides a versatile front panel to help the user set correctly the most suitable test conditions. Mainly, two different kinds of acquisition have been taken into account and, so, implemented. In particular, the signal of interest can be continuously acquired or can be acquired in differently spaced frames, whose starting-time and duration over the time-domain axis are entirely userdefined, without any prior constraint. As shown in Fig. 1, the front panel consists in two different modules: the first one (Fig. 1, left panel) consists of three main blocks related to devices configuration, signal acquisition and real-time visualization, acquired data storage and report compilation; the second one (Fig.1, right panel) is related

to the data chart. B. Devices configuration section In the module of the GUI called devices configuration (Fig.2), the user has to define the proper device and to choose the correct input and output channel. Thus, the module is organized in three different submodules (Fig. 2). The former (Fig. 2, right panel) allows to select the device and the input channels (the available input is automatically limited to the selected device); the second submodule (Fig. 2, central panel) lets the user introduce a stimulation during the experiment, thus, the output channel has to be selected, and via the stimulation-button it is possible to test the right configuration; the latter (Fig. 2, left panel) allows to define the input limits accordingly to the expected acquired signals range. C. Signal acquisition and real-time visualization section In the signal acquisition and real-time visualization module (Fig. 3), the user has to define the acquisition parameters, the filter features, the power spectrum scales and the type of DFT window function. This module is organized in three submodules, as the devices configuration one. The first one (Fig. 3, right panel) allows to set the following acquisition parameters: the acquisition type (continuous or divided in frames), the sampling frequency and the stimulation delay. After that the software automatically sets the right input control. If the user decides to acquire the signal divided in different frames, he has to set these other fields: the number of frames, the frame duration, the intra-frame delay and the stimulation delay. On the other hand, if the user decides to continuously acquire the signal, he also has to set the visible frame that indicates the last data frame to display. The second module (Fig. 3, central panel) lets the user define the filter parameters, such as the filter type, its order and its low and high cut-off frequencies. It is possible to initiate two different filters to help neuroscientists that often need to observe two separate frequency bands simultaneously, e.g., in testing for nested oscillations [10], neuroscientists need to see theta and gamma bands components of the acquired signal at the same time. Both filters are implemented as Infinite Impulse Response (IIR) filters, whose coefficients are set before the acquisition starts. Although IIR filters are more susceptible to noise injections, they outperform other competing filters in terms of required number of calculations or occupied memory. In the last module (Fig. 3, left panel) the user can choose the scale of the axis of the power spectrum chart, in order to satisfy all possible representations. Moreover, it is also possible to define the window function exploited to compute DFT. D. Acquired data storage and report compilation In the acquired data storage and report compilation module, the user is expected to define a configuration file, a storage file and a log file. Therefore, this module is organized in three submodules. The first one (Fig. 4, right panel) allows to save all the parameters set in the signal acquisition and real-time visualization module in order to quickly load an experiment template. The second one (Fig.

4, central panel) lets the user choose the .tdms file where all the acquired data will be saved. The last module (Fig.4, left panel) allows to specify a log file. This file stores the parameter inserted in section B, moreover the user can leave a comment using the “add comment” button. Typically, acquisition data storage requires a significant memory allocation. Hence, the proposed software platform is compliant with cloud storage services, which ensure reduced backup costs, data accessibility from any device connected to internet, automated synchronization and the capability of sharing data and results with just few clicks. On the other hand, a similar storage strategy depends on internet connection performances. In the presence of large amount of data, a scarce bitrate may result in long upload and download time. Moreover, cloud storage solutions are susceptible to security breach events, which may expose reserved access information to unauthorized subjects. E. Data chart The data chart module allows the user to see real-time acquired data. It is also possible to see the filtered signal and its power spectrum. If in the section B the user has decided to acquire the signal divided in different frames, it is also possible to display the average of the acquired frames over time and its power spectrum. There are only a few parameters to be set in this module. As you can see in Fig. 5, the frame that has been acquiring is indicated in the “acquired frame” (left panel), there are a start button to start the acquisition (central panel) and a module (left panel) that allows to specify the gain factor for each input channel. At the end of the acquisition, it is possible to check all the frames and show them together pressing the “show all frame” button (Fig. 5, left panel). IV. IMPLEMENTATION AND TEST A. Experimental set-up Experiments were performed on C57BL/6 female mice in compliance with the Italian Animal Welfare law. Mice were anesthetized by intraperitoneal injection of urethane (1.5-1.7 mg/g U2500 - Sigma-Aldrich). Absence of reaction to noxious stimuli was checked in order to ensure a surgical depth of anesthesia. Body temperature was kept at 37.0 ± 0.5 °C. The head was restrained in a stereotaxic frame and the skull was exposed and drilled for inserting the recording glass electrode in the dentate gyrus region of the hippocampus (DG) as described [11]. LFP signals were 10X amplified using an Axoclamp-2B amplifier with an HS-2Ax1LU headstage (Axon Instruments Inc.) in bridged mode. A custom made amplifier provided further 10X amplification along with 4 pole Butterworth low-pass filtering at 1 kHz. Signals were digitalized at 10 kHz by means of a PCI-6071E I/O card (-0.5 ÷ 0.5 V input range) combined with a BNC-2090 terminal block (National Instruments) and recorded through the software platform described in this work. B. Stimulation and acquisition synchronization Stimulation and acquisition synchronization have been implemented taking into account the trigger functionality of the acquisition hardware (Fig. 6). This approach lets the

user synchronize the input and output channel through a precise control of the delay between the two that will be not over few nanoseconds. This short delay is possible thanks to the exploiting of the DAQ board hardware instead of a software synchronization, thus the performances only depend on the device used. C. Multi-core architecture Modern multi-core CPUs let the user execute multiple code at the same time. To take advantage of this characteristic the program (software) has been organized in multiple parallel loops. The first loop is made exclusively for data acquisition and storage. Each signal sample is scaled by the previously defined gain factor and is inserted into a FIFO queue stored in the Random Access Memory (RAM). The second loop pulls the samples out of the queue and processes them according to the adopted acquisition protocol. In the continuous acquisition, the samples are written into a circular buffer. When the buffer is full, the samples are stored in the .tdms file. At this point, new samples written into the buffer overwrite the older data. On the other hand, if the signal is acquired divided in different frames, the samples are written into fixed length buffer, and then saved in the .tdms file when the buffer is full. At this point, new samples written into the buffer are neglected. The exceeding data are kept in memory for the next frame. In this way it is possible to keep in memory only the buffered data. This allows the acquiring of data for arbitrary time, from few minutes to several hours. Eventually, the third loop manages the stimulation channel. To conclude, these three separate loops allow to isolate the process of acquisition from the elaboration one ensuring that the first loop is executed fast enough to prevent data loss. In fact, in the first loop, acquired data is continuously stored into a memory buffer whose size is almost twice the selected observation interval. The second loop, instead, extracts from this buffer only a frame, whose size represents a limited portion of the entire buffer. The separated loops organization and their corresponding timings ensure that the software can handle with continuous mode acquisition, without compromising data integrity or real-time visualization. D. Plotting data The software displays several information about the acquired data. It displays the raw signal, the filtered signal and the power spectrum. In the case of the acquisition in differently spaced frames, the mean of the frames along time and average power spectrum are also available. In order to keep computational complexity acceptable, an under-sampling data algorithm has been introduced, though only for display purposes. For example, Fig. 7 shows two acquired channels. The red one represent an ECG and the white one represent an LFP. E. Data save During the acquisition process, the software keeps the acquired data saved in a .tdms file, in the guise of backup recording. At the end, the software produces a .mat file as a clone of the .tdms file. This approach lets the user import data into MatLAB for off-line processing.

F. Quality metrics The proposed software platform is able to manage a customized number of channels, without degrading the acquisition performances. In fact, each input channel is independent and requires the same computational effort. Consequently, the number of channels affects only linearly the overall software complexity. In this regard, it is worth noticing that the proposed software is explicitly designed to run with reduced CPU and RAM requirements and thus, exhibit good performances even in pretty old machines. For example, with an Intel Core i7-2620M, an acquisition lasting over two hours requires a CPU effort lower than 10% and a 500 MB allocation of RAM. Similarly, in order to assess the execution time, an observation interval of 100 seconds has been uniformly divided into 10 frames and acquired at a constant sampling rate equal to 10 kHz. Over 1000 iterations, an average execution time of 40 μs has been assessed, with a maximum value of 130 μs. The acquisition stage presents multiple parameters that can be adapted to the specific operative conditions. In this regard, a suitable tradeoff between visualization accuracy and computational requirements is recommended. In graphical programming languages such as LabVIEW, the traditional metrics for software quality assessment are hardly applicable. Nevertheless, the software hierarchical organization in modular substructures makes the program self-documenting and simplify the debugging operations, in compliance with the quality standard requirements, as formulated in ISO/IEC 1550 [12]. V. CONCLUSIONS We presented a flexible, portable, expandable and efficient software platform for acquisition and processing of biological signals from multichannel electrodes. Thanks to a user-friendly GUI, the software can be handled by investigators with no computer programming skills and visualize raw and filtered signals along with their power spectrum in real-time. Both continuous acquisition and frame recording lasting from few seconds to hours are implemented, while electrode stimulation can be operated with a precise synchronization relying on clock hardware

rather than on software. The software was optimized to exploit modern MultiCore architecture. Data can be saved in .mat and .tdms formats. Preliminary experimental tests within a standard setup for in vivo recording of mouse hippocampus have been successfully performed. As an outlook, the work represents the basis for future developments leading to integration of additional acquisition and analysis tools for operation with largescale recording systems. REFERENCES [1]

R. Caton, “The electric currents of the brain,” Br Med J, vol. 2, pp. 278, 1875. [2] G. Buzsaki, C.A. Costas and C. Koch, “The origin of extracellular fields and currents – EEG, ECoG, LFP and spikes,” Neurosci, vol. 13, pp. 407-420, 2012. [3] G. T. Einevoll, C. Kayser, N. K. Logothetis and S. Panzeri, “Modelling and analysis of local field potentials for studying the function of cortical circuits,” Neurosci, vol. 14, pp.770-785, 2013. [4] G. Buzsaki, “Large-scale recording of neuronal ensembles,” Nature Neurosci., vol. 7, pp. 446-451, 2004. [5] J. Du, T.J. Blanche, R.R. Harrison, H.A. Lester and S.C. Masmanidis, “Multiplexed, high density electrophysiology with nanofabricated neural probes,” PLoS ONE, vol. 6, e26204, 2011. [6] T. Kuki, T. Ohshiro, S. Ito, Z. G. Ji, Y. Fukazawa, Y. Matsuzaka, H. Yawo and H. Mushiake, “Frequency-dependent entrainment of neocortical slow oscillation to repeated optogenetic stimulation in the anesthetized rat”, Neuroscience Research, vol. 75, pp. 35-45, 2013. [7] D. Wagenaar, T. B. DeMarse, and S. M. Potter, “MeaBench: A toolset for multi-electrode data acquisition and on-line analysis,” Neural Engineering, vol. 521, pp.518, 2005. [8] H.P. da Silva, A. Lourenço, A. Fred, R. Martins, “BIT: Biosignal Igniter Toolkit,” Computer Methods and Programs in Biomedicine, vol. 115(1), pp. 20-32, 2014. [9] I.C. Christie, P.J. Gianaros, “PhysioScripts: An Extensible, Open Source Platform for the Processing of Physiological Data,” Behav Res Methods, vol. 45(1), pp. 125-131, 2013. [10] W.D Penny, E. Duzel, K.J. Miller and J.G. Ojemann, “Testing for nested oscillations,” J of Neurosci Methods, vol.174, pp.50-61, 2008. [11] Y. Huang, S. Yang, Z. Y. Hu, G. Liu, W. X. Zhou and Y. X. Zhang, “A new approach to location of the dentate gyrus and perforant path in rats/mice by landmarks on the skull,” Acta Neurobiol Exp, vol. 72, pp. 468-472, 2012. [12] International Organisation for Standardization (ISO/IEC), ISO/IEC 15504: Information Technology - Process Assessment, 2004.

RAW SIGNAL 1° FILTER 2° FILTER CURRENT FRAME POWER SPECTRUM AVERAGE AVG. P. SPECTRUM

Fig. 1. Front panel of GUI. On the left panel, device configuration, signal acquisition and real-time visualization, acquired data storage and report compilation. On the right: acquired frame indicator, “show all frame” button, start button and gain factor. On the right panel, real-time data graphs organized in column: raw signal, first filter, second filter, current frame, power spectrum, time-domain average, and power spectrum average.

Fig. 2. Device configuration module. On the left panel, physical device and input channel. On the central panel, stimulation setup and output device. On the right panel, input signal limit.

Fig. 3. Signal acquisition and real-time visualization module. On the left panel, acquisition parameters with acquisition type, sampling frequency, stimulation delay, number of frame, frame duration and frame delay. On the central panel, first and second filter parameters. On the right panel, DFT analysis with custom power spectrum axis and DFT window.

Fig. 4. Acquired data storage and report compilation module. On the left panel, configuration file with save and load button. On the central panel, tdms save file and linked path. On the right panel, log file with linked path and comment button.

Fig. 5. Data chart module. On the left, frame utilities with acquired frame and “show all frame” button. On the central panel, the start button. On the right panel, the gain factor of the input channel.

Fig. 6. A submodule of the output configuration code. The central block shows how to configure properly the hardware trigger functionality. Once the rising edge of the analog input Start Trigger is detected, the output channel starts the generation process.

Fig. 7. Example of two acquired signal: the red line represents an electrocardiogram (ECG) trace, while the white line represents a LFP. The observation interval is equal to 30 seconds.

Fig. 8. Example of two power spectra: the red and white line correspond, respectively, to the ECG and the LFP traces presented in Fig. 7. The frequency axis covers the bandwidth [5 : 200] Hz.