Terminology
In Wavesurfer, a "trial" is a single acquire for a (usually) fixed duration.
In Wavesurfer, an "experiment" is a series of trials, acquired one after the other (possibly with gaps between).
Step-by-step guide
By following these steps, WaveSurfer will be allowed to send commands to ScanImage to coordinate trial and experiment acquisition with ScanImage.
- Start MATLAB and run ScanImage.
- Load a .usr and .cfg file in ScanImage or save the current settings to a .usr and .cfg (This sets up a usr/cfg file path for SI, which is currently required for ScanImage-WaveSurfer communication).
- If the .usr/.cfg files haven't set up ScanImage for external triggering for interacting with WaveSurfer, follow these steps:
- Go to the "Settings" menu on ScanImage.
- Select the "Triggers" menu entry.
- Choose the desired Terminal and Edge type for "Acquisition Start". If WaveSurfer is using internal triggering only, connect ScanImage to WaveSurfer's internal trial-trigger terminal, for most cases this should be "PFI12" on the corresponding board
- On the "Main Controls" window, select the "EXT" button to turn on external triggering.
- Start a new instance of MATLAB and run WaveSurfer. At the moment, Wavesurfer should be installed in a different directory.
- Go to the "Settings" menu on ScanImage and click on the entry "Yoke to Wavesurfer". A check mark should become visible next to the menu entry.
- Go to the "Settings" menu on WaveSurfer and click on the entry "Yoke to ScanImage". A check mark should become visible next to the menu entry.
You should now be in "Yoked" mode. In this mode you have the following coordinated options:
- Clicking "Play" or "Record" on Wavesurfer will also start acquisition in SI if SI is in an idle state. This will cause SI and Wavesurfer to start their trials at the exact same time, due to external triggering on ScanImage's side. Additional clicks of "Play" or "Record" in Wavesurfer will again start acquisition in SI if SI is in an idle state, with no need for the user to do anything in SI. Trials started in this way will have the same trial index in SI and Wavesurfer.
- Wavesurfer opening/saving a Protocol (.cfg) / User (.usr) file causes the opening/saving of a "parallel" .cfg/.usr file in ScanImage. A "parallel" .cfg/.usr file is a .cfg/.usr file with the same name as the Wavesurfer file, but in a different directory. At the moment, yoking requires the user have one directory with wavesurfer .cfg/.usr files, e.g., "C:/prep/wavesurfer", and another parallel one with ScanImage .cfg/.usr files, e.g., C:/prep/scanimage.
To turn off "yoked"-mode, simply click on the aforementioned entries "Yoke to Wavesurfer" and "Yoke to ScanImage" in ScanImage and WaveSurfer, respectively. The check mark next to the menu entries should no longer be visible.