Online trial averaging

It is often the case that you may want to do some quick on-line analyses on our data during the execution of an experiment.  Scanbox provides a quick way to save, at the end of each experiment, the mean image during each trial.  To use this feature do the following:
  1. Select “Accumulate” in the Image Display Panel
  2. Click the “TTL Ctrl” checkbox in the Image Display Panel
  3. Feed a TTL signal that is initially low and goes high during each stimulus trial to the AlazarTech 9440 X1 input.
  4. Start your experiment
The result will be the following:
  1. During the experiment itself the TTL Ctrl text next to the checkbox will be displayed in black when the signal is low and will be displayed in red when it is high.  You can use this feature to monitor your TTL signal. Such updates only occur when the microscope is running.
  2. At the end of the experiment there will be an additional file with _trials.mat appended at the end of the name in your data directory.
  3. The file contains two Matlab variables trials_n and trials_acc.  They are ordered sequentially by the trial #.
  4. trial_n(j) contains the number of frames that were accumulated during the j-th time the TTL pulse went high.
  5. trial_acc{j} contains the accumulated images during the j-th trial.
  6. The mean activity of the j-th trial will be trial_acc{j}/trial_n(j).
  7. If you want “blanks” you need to include them separately as trials themselves.

Happy online processing!



  1. Scanbox 2.0 looking good.
    In version 2.0, is there a channel available to input a TTL signal for the purpose of identifying trials?
    If yes, physically, which connector is it? label: TTL1?
    We would like to generate the trials_n variable described above for our off-line analysis.

  2. Does version 2 include a similar method for indicating TTL1 is high in the acquisition window (on-line monitoring)? We have TTL1 set to high during vis stimulus. The saved .mat ‘Info’ variable is as described elsewhere in the posts, offline analysis very easy! We are curious if there is an indication in the actual acquisition window when TTL1 is high while data are being collected (similar to the feature described above for an earlier version)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s