A new checkbox within the Laser panel (labeled AGC) allows you to turn an automatic control of laser power on and off.
When AGC is on, Scanbox checks the distribution of pixel values on the image every T seconds, and increases or decreases the laser power by a certain factor if the fraction of pixels above a threshold is outside the desired range.
The values of these parameters are found in a new section of the sbconfig.m file:
% Laser AGC sbconfig.agc_period = 1; % adjust power every T seconds sbconfig.agc_factor = [0.93 1.08]; % factor to change laser power down or up if outside prctile bounds sbconfig.agc_prctile = [1e-5 1e-3]; % bounds on percent pixels saturated wanted sbconfig.agc_threshold = 250; % threshold above which is considered saturated (255 is max value)
Below is a video showing AGC in action.
At the beginning of the video, I focus on pollen grains using low power. When the AGC is turned on, it brings the power up. Then, if I increase the PMT gain, the laser power is decreased in response. If the laser power is changed manually, AGC will re-adjust it to bring the pixel distribution within the desired limits.
AGC of laser power is useful when running a z-stack with a range that is larger than 100um or so. In that case, engaging AGC will make Scanbox adjust laser power as a function of depth. Another situation where AGC may be useful is while running very long experiments/sessions where water may evaporate slowly leading to a reduction of the signal. In that case, turning AGC would compensate and could render the data usable.