StimConfig Editor
Constructing Stimulus Sets
Last updated
Constructing Stimulus Sets
Last updated
The Stimulus Config Editor is a convenient way to create new configuration files for Zapit. You can start it by going to File
> New stim config
in the Zapit menu. If you are not at the rig, you can install Zapit and start editor standalone with the command zapit.stimConfigEditor
Once started, you can use the Load
button to open a previously created file or just start work on a fresh one. The New
button will issue a confirmation dialog then wipe all points and start over. The Save
buttons opens an interactive UI for saving the file; it does not simply over-write a file that is already loaded.
Moving the mouse cursor over the atlas image will highlight the brain area under the cursor and report its identity in the figure title. A plot symbol follows the cursor. In Bilateral
mode, there are two points over homologous positions on the left and right sides. In Unilateral
mode there is only one symbol: that under the cursor.
Clicking on the atlas image will place the point and symbol under the mouse cursor will change, indicating that the GUI is ready to place the next stimulus condition. Try placing a few bilateral points. Each pair of differently colored symbols represents a different stimulus condition. There is no limit on the number of conditions you add.
Now try Unilateral
mode: clicking will place a single point under the mouse cursor. The number of points per stimulus condition is limited to two, so in bilateral
mode you can not add further points to a stimulus condition. However, in unilateral
mode a point can be appended to a condition. To do this, after placing the first point press the shift
key: the symbol under the cursor will now match that of the last added point. Click again and a second point is added to the condition (there is a known bug that makes this process fail sometimes; just try again if that happens). By default you are blocked from adding more than two points. You can relieve this restriction by editing the experiment.maxStimPointsPerCondition
setting in the config file. Zapit will handle presentation of multiple points in a trial up to limits imposed by laser power and scanner motion time. You are responsible for ensuring that you have sufficient power to handle your stimulus set: see below.
You can only append points to the current stimulus condition. If you wish to append a point to a condition you added previously, you will need to delete that condition first (see below) then add it back, then append.
Stimuli composed of more than 2 points are a new feature to Zapit and not well tested. In particular, adding more points will reduce pulse duration and this can readily become shorter than the generally accepted minimum stimulation time for ChR2. For over about 3 or 4 points it is suggested you consider using a faster opsin, such as ChRmine.
Hold down the ctrl
key and the symbol under the mouse cursor turns into a red cross. The stimulus condition points nearest the cursor will enlarge slightly. Clicking will remove these points. If there are two positions in the stimulus condition, both are removed.
The parameters with which stimuli will be presented are set by the Rampdown
, Laser Power
, and Stim. Freq.
spin boxes.
The Rampdown
is the number of ms over which the laser power is gradually stepped down once the stop stimulus command is issued. Previous work indicates that about 250 ms is a safe and reasonable minimum value.
The Laser Power
setting defines the time-averaged power in mW at the sample surface used for stimulation. In other words, if two points are being stimulated in a single trial and requested power is 2 mW then the laser would deliver 4 mW at the sample. A power meter receiving light from just one of those points would report an average power of 2 mW.
The Stim. Freq.
setting defines the on/off modulation rate of the laser. For a condition with one position, the laser is modulated at this rate using a square waveform. For two locations, the beam is moved back and forth between the positions at this rate. The scanners take 1 ms to move from position to position regardless of the distance between points. The beam is blanked during this period.
Once you are happy click the configuration you save it to disk with the Save
button. If you launched the editor from Zapit, the saved file will appear immediately in Zapit's File
> Load recent
menu for quick access.
When presenting stimuli with large number of points, it is your responsibility to ensure that you have enough power for your stimuli to work. You can test this using the included example parameter file power_check_multipoint.yml
. This file has 21 conditions. In condition 1 there is just one point over unilateral V1. In condition 2 there is the same point over 1 and a second point far anterior to it. In condition 3 there are two anterior points and the V1 point. And so on. Place a power meter such that the V1 point hits the meter but none of the others do. Block with an iris if needed. Measure power of the one point as you increase the point number. Faster sensors and power meters will begin to under-estimate power as the number of points goes up! With the ThorLabs meter and a photodiode sensor, this can be counteracted by setting the scale range to 180 mW
. Alternatively, you might get around the issue by using a slower sensor. You should find a reasonably flat line up to the point at which Zapit starts to complain at the CLI that the requested laser power is unattainable. For example: