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!