Home Documentation
Documentation

A preliminary version of a User Guide is available.

Download User Guide here.

Change the scroll speed of the keyboard more

The "keyboard mode" is used to manually scroll through detected events and tag/untag them. Programming-wise the keyboard mode is a bit of a dirty hack, because of Igor's limited keyboard functions. Basically, once the keyboard mode is activated, spacan's execution switches into a mode where it's awaiting specific keyboard strokes (this corresponds to the function called WaitForKey). As soon as the right key stroke is detected, it will execute the appropriate action (e.g. display the next event when pressing the right arrow). If the user makes a long press (for example to scroll quickly through several detected events), the corresponding action will be repeated extremely fast. To slow down the process, the hack consisted in adding to the code a dummy loop:

Do

i+=1

While (i < Number)

where Number defines how long WaitForKey will be stuck in the dummy loop. To tweak the scroll speed, you have to change the value of Number (increasing it slows down the scroll speed). In recent versions of spacan, Number was replaced by the expression:

300000/(1+exp(KbdSpeed/3))

where KbdSpeed can be changed by the user in the control panel of DetectedEvents, in order to change the scroll speed. If KbdSpeed does not do the job for you, you can go into spacan's code and change the number before the division sign (here 300000). Depending on your hardware you have to find the value that gives you the right speed. Don't hesitate to try several orders of magnitude highers (3e6 or 3e7).

To edit spacan's code:

  1. bring up the procedure window by selecting: Windows > Procedure Windows > SpAcAn-1.XX.X.ipf
  2. Look for WaitForKey using the control called Procedure (at the bottom of the procedure window). Select Go to function... and then WaitForKey (the last one in the list), then click on the button Go To.
  3. Scroll down until you find the expression 300000/(1+exp(KbdSpeed/3)). It appears twice in the function WaitForKey. You can look for the expression using Igor's search function (ctrl+F).
  4. Change the number before the division sign in both places (keep the two expressions identical to have the same forward and backward scroll speeds).

If you have some troubles getting this done, write to postmaster[at]spacan[dot]net.

A list of useful waves

Once a detection is performed, Spacan keeps the resulting waves in root:spacan. Spacan has a number of built in functions for displaying plots using these waves. But some users might want to manipulate these waves for specific analysis purposes. Here is a shortlist of useful waves generated by Spacan and how they are generated during the detection process.

Step1: a threshold detection is performed on the differentiated wave (see User Guide for more information). This yields a wave called BaselineX1(2) - 1 or 2 depending on which channel is being analyzed. BaselineX1(2) stores the time of occurrence of the center point of the baseline segment. BaselineY1(2) is created to store the baseline level. These 2 waves are used to display the baseline segment as a red cursor on individual detected events.

Step2: Spacan looks for the peak (negative or positive depending on the settings in the panel of MainWindow). The rule is simple: spacan takes the maximum (or minimum) value on the raw data in a time window having the following limits:

  • left limit: BaselineX1(2)[i] (i is the event number)
  • right limit: the above time point + half of the baseline segment + the rise time segment + the peak segment + a certain duration defined as the Peak Detection Window in the control panel of MainWindow.

To have a definition of what these segments mean, check the User Guide. Spacan subtracts the baseline level from this maximum or minimum and stores is in the wave RealAmp1(2). The time of occurrence of the peak is stored in RealPeakPosition1(2).

NOTE: The use of the waves PeakX1(2) and PeakY1(2) is deprecated.

NOTE: The waves WaveAmplitude1(2) are generated by some Spacan function2 based on RealAmp1(2) and have no specific meaning related to the detection algorithm.

Step3: based on the baseline and peak, Spacan looks for the 20%, 50% and 80% rise points. The time of occurrence of the 50% rise is stored in the wave Occurrence1(2). The times of occurrence of the 20 and 80% rise points are stored in the waves RT201(2) and RT801(2), respectively. The 20-80% rise time (RT801(2)[i] - RT201(2)[i]) is stored in the wave RiseTime20801(2).

Step4: Spacan looks for the "foot" of the event, which is defined as the intersection between the baseline and the line going through the 20% and 80% rise points. The time of occurrence of this "foot" is stored in the wave EventFootTime1(2).

Below is a schematics showing the meaning of the waves mentioned above. The example is based on the detection of spikes in the loose cell-attached mode, but the waves would have the same meaning for the detection of synaptic currents or potentials.

 

 

Can I cut and store individual events from the raw data?

You can cut and store events from the raw data like in Neuromatic, but the function is a bit hidden. To do so, use the tab "Sup" in the window DetectedEvents. When hitting the button "Display Graph", you will generate a graph of superimposed events (the box "Show Individual Events" has to be checked). The graph is made from waves that are cut from the raw data. Each event has its own wave and only tagged events are considered. The waves are stored in the folder root:spacan:SupEvents1(or 2). In this folder, the waves are saved in a subfolder called EventChXSeriesY where X = channel number (1 or 2) and Y = the number of the series of events. A new series of events is generated if you press "Display Graph" again with the box "Overlay Mode" checked. The Overlay function allows you to superimpose events belonging to distinct sets of tags.

 
Copyright © 2017 spacan.net. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.