Zapit Optostim
  • Zapit Optostim: Introduction
    • Feature List
    • FAQ
  • Installation and Setup
    • Hardware setup
    • Software setup
    • Configuring Zapit
      • General settings
      • NI DAQ settings
      • Experiment settings
      • Scanner & Camera settings
      • Laser Power Calibration
      • Blanking settings
    • Staying up to date
  • Using the GUI
    • Introduction: Using the GUI
    • Scanner Calibration
    • Sample Calibration
    • StimConfig Editor
    • Generating stimulus patterns at the CLI
    • Advanced Usage
  • Running Experiments
    • Introduction: Running Experiments
    • MATLAB
      • Basic API Usage in MATLAB
      • Running an Experiment in MATLAB
    • Python
      • Connecting Python to Zapit
      • Basic Zapit API Use in Python
    • Remote Control and Other Programming Languages
  • Developer Notes
    • Project Structure
    • Conventions
    • Hints and Tips
Powered by GitBook
On this page
  1. Using the GUI

Generating stimulus patterns at the CLI

How to generate complicated stimulus patterns at the command line

PreviousStimConfig EditorNextAdvanced Usage

Last updated 1 year ago

There is a command line tool called zapit.utils.stimConfigPatternGenerator for generating patterns of stimuli, like grids or crosses, at the command line. You can access doc text for the tool at the command line:

help zapit.utils.stimConfigPatternGenerator

This page show with plots how it works.

Grid of points over V1 stimulating bilaterally

zapit.utils.stimConfigPatternGenerator('myV1', [-2.75,-3.8], ...
                                       'num', [3,5], ...
                                       'patterns', [1,1.5], ...
                                       'bilateral',true)

The grids above are bilateral stimulation points. In other words, they constitute 15 different trials. All 15 points are not stimulated in a single trial.

Square grid over V1 with independent stimulus conditions on the two sides

To create grids that are independent you need to generate the patterns in two steps. Note that second has 'overwrite', false to allow the new points to be appended to the file created by the first step.

zapit.utils.stimConfigPatternGenerator('myV1', [-2.75,-3.8], ...
                                       'num',3, 'patterns', 1, ...
                                       'overwrite', true)
zapit.utils.stimConfigPatternGenerator('myV1', [2.75,-3.8], ...
                                       'num', 3, 'patterns', 1, ...
                                       'overwrite',false)

Generate a variety of patterns

zapit.utils.stimConfigPatternGenerator('myPattern', [3.55,-1.3], ...
                           'pattern','cross', 'num',3, 'patternsize',0.8, ...
                           'overwrite',true)

zapit.utils.stimConfigPatternGenerator('myPattern', [0.55,-2.5], ...
                           'pattern', 'APline', 'num',7, 'patternsize',2, ...
                           'overwrite',false, 'bilateral',true)

zapit.utils.stimConfigPatternGenerator('myPattern', [1.55,2.75], ...
                           'pattern', 'MLline', 'num',5, 'patternsize',1.5, ...
                           'overwrite',false, 'bilateral',true)

zapit.utils.stimConfigPatternGenerator('myPattern', [-3.5,0], ...
                            'pattern','cross', 'num',[3,5], 'patternsize', [0.75,1.5], ...
                            'overwrite',false)

Generating plots of the stimulus locations

You can generate plots of the stimulus locations in one of two ways.

zapit.utils.plotStimuli('myPattern.yml')

Or with the 'makePlot', true parameter/value pair as an argumnent to the stimConfigPatternGenerator. These files can also be loaded into the stim editor GUI and modified.

Bilateral non-square grid over V1. In a single trial corresponding points on the two sides will be stimulated. e.g. both points labelled "5" will be stimulated in one trial.
Bilateral square grids over V1. In a single trial only one location is stimulated, unlike the bilateral example above. e.g. Point "3" on the left is stimulated alone in one trial.
The two crosses are independent. The AP and ML lines each contain points that are stimulated bilaterally.