LabView multichannel analog input

Hardware

When we need access to several analog input channels, we sometimes acquire this information on a separate National Instruments data acquisition board, such as the National Instruments 6071E. (You may ask why we use a separate card for this purpose: the reason is that the CED micro1401/Spike2 system that we use to acquire stimulus timing information and up to 4 analog inputs cannot be inexpensively expanded to handle 32 or 64 channels at high sampling rates.)

Synchronization

Because we are using 2 acquisition devices (micro1401/Spike2 for stimulus timing information and a few analog inputs, and LabView for several analog inputs), we need to learn the time conversion between these devices. This means we need to identify the time shift between when the 2 devices were started (that is, what time on the LabView system corresponds to time 0 on the Spike 2 system?) as well as the time scaling between the 2 clocks (because the clocks on the 2 devices will advance at slightly different rates, and this difference matters over the course of a several minute recording).

To do this, we typically record the stimulus trigger signal on 1 analog input channel of the National Instruments board (usually channel ai63 -- analog input 63 -- on the 6071E). Because the CED 1401/Spike2 system is also acquiring trigger times from this channel, we can analyze the signals from the National Instruments board to learn the exact mapping in shift and scale.

(Note for developers: The function in our library that does this is: vhlv_sync2spike2.m)

Acquisition software

The acquisition software we use is our own custom VHLVDaq, written in LabView.

[INSTRUCTIONS HERE]

Output of the acquisition program VHLVDaq: It writes 2 files: vhlvanaloginput.vlh (the header file, in text format and human readable, and readable in Matlab with function readvhlvheaderfile.m), and vhlvanaloginput.vld (binary file, readable in Matlab with readvhldatafile.m).

Note: In the next release, it should also write the files vhlv_filtermap.txt, which describes how the channels should be grouped for filtering (see help vhlv_filtermap in Matlab), and vhlv_channelgrouping.txt, which describes how channels should be grouped for spike extraction and spike sorting (see help vhlv_channelgrouping in Matlab).

Note 2: In the meantime, one has to create these files manually. Follow the example in Step 0 to do this.

How to extract and cluster spikes (spike sorting)

Step 0: Making sure all of the description files are correct

Before starting, please make sure you go through your experiment directory to find all of the directories (t00001, t00002, etc) that contain multichannel data to make sure the reference.txt, vhlv_filtermap.txt, and vhlv_channelgrouping.txt files are specified correctly. For example, if you acquired using 16 channels on 2 head stages, and want each electrode site to represent an individual channel, you should use:

reference.txt:

name<tab>ref<tab>type

extra<tab>1<tab>singleEC

extra<tab>2<tab>singleEC

extra<tab>3<tab>singleEC

extra<tab>4<tab>singleEC

extra<tab>5<tab>singleEC

extra<tab>6<tab>singleEC

extra<tab>7<tab>singleEC

extra<tab>8<tab>singleEC

extra<tab>9<tab>singleEC

extra<tab>10<tab>singleEC

extra<tab>11<tab>singleEC

extra<tab>12<tab>singleEC

extra<tab>13<tab>singleEC

extra<tab>14<tab>singleEC

extra<tab>15<tab>singleEC

extra<tab>16<tab>singleEC

vhlv_filtermap.txt:

channel_list

[1 2 3 4 5 6 7 8]

[9 10 11 12 13 14 15 16]

vhlv_channelgrouping.txt:

name<tab>ref<tab>channel_list

extra<tab>1<tab>[1]

extra<tab>2<tab>[2]

extra<tab>3<tab>[3]

extra<tab>4<tab>[4]

extra<tab>5<tab>[5]

extra<tab>6<tab>[6]

extra<tab>7<tab>[7]

extra<tab>8<tab>[8]

extra<tab>9<tab>[9]

extra<tab>10<tab>[10]

extra<tab>11<tab>[11]

extra<tab>12<tab>[12]

extra<tab>13<tab>[13]

extra<tab>14<tab>[14]

extra<tab>15<tab>[15]

extra<tab>16<tab>[16]

Step 1: Launch the LV Sorting tool

Make sure you have a good RunExperiment window for your experiment, that is set so that it is looking at your experiment directory. Then, on the RunExperiment panel, click the LV Sorting button.

Step 2: Set thresholds and extract spikes

On the LV sorting window, click the Set thresholds / extract spikes button. The directories that contain data are listed in the Directory menu popup, with codes (_, t, or T indicate no thresholds have been set (_), some thresholds have been set (t), or all thresholds have been set (T)). The channels that are grouped together in vhlv_filtermap.txt are listed together in the Channel List. Be sure to view all of the channels. Clicking in the white space in a graph (it has to be clear of the graphed data by a few pixels) will set the threshold for that channel, and the spikes that are detected in the bit of data shown will be displayed. You can turn on Zoom in the tools menu to zoom in on the traces, but you'll need to turn it off to select thresholds. Be sure to visit every directory and set thresholds using the GUI.

After you have set all thresholds for a given directory, you can extract the spikes by clicking Extract. This takes a few minutes to run, especially over the network.

Step 3: Cluster the spikes

After you have extracted spikes, then turn attention to clustering spikes. For each name/reference pair in the list, click Cluster. Upon opening the GUI, the system will attempt to use its default clustering methods to cluster the spikes. It will display the features (colored by cluster number) in the feature window on the lower left, and the individual waveforms on the right. You can choose to re-cluster the spikes, use different features, or to merge or re-order the clusters (by moving a given cluster to position 1 using Move to cluster 1). It is important (and the program requires) that you assign a "quality" label to each cluster. Once you are done clustering you can click Done.

That's it! You're ready to analyze the responses.