spatial calibration

Spatial Calibration for Multiple Objectives

Multiple users of the scope may be running projects that require different types of objectives.  How to keep a spatial calibration for each and switch between them when necessary?

Scanbox now includes an “objective” configuration variable — a cell array of strings each with the name of a different objective.  Right now I have:


% objective list
sbconfig.objectives = {'Nikon 16x','Nikon 25x'};

Now, within the Knobby panel you will see a pull down list containing the objective names:

objectives

Select the desired objective before performing a calibration.  Once the calibration is finished it will be saved.  If a calibration is not present for a given objective the calibration button will read “No Calibration” and the mouse control will be disabled. If you change the objective, simply select the corresponding entry in the pull down list to apply the new calibration (no need to restart Scanbox).

When collecting data the info structure will include the objective name and calibration data:


info =

struct with fields:

resfreq: 7930
postTriggerSamples: 5000
recordsPerBuffer: 512
bytesPerBuffer: 10240000
channels: 2
ballmotion: []
abort_bit: 0
scanbox_version: 2
scanmode: 1
config: [1×1 struct]
sz: [512 796]
otwave: []
otwave_um: []
otparam: []
otwavestyle: 1
volscan: 0
power_depth_link: 0
opto2pow: []
area_line: 1
calibration: [1×13 struct]
objective: 'Nikon 25x'
messages: {}
usernotes: ''

Spatial Calibration and return to origin

We added two new features to the knobby scheduler panel, as shown below by the arrows.

knobby2nf

One (left arrow) allows knobby to perform an automatic spatial calibration of the system, measuring the (x,y) size of pixels at all magnifications.  To perform this calculation do the following:

  1. Focus on some pollen grains.  Make sure one of the pollen grains is well centered on the screen at the highest magnification (x8).
  2. Make you there is an empty folder named xx0 in the data directory you selected.
  3. Hit the calibration button (pointed by the left arrow).
  4. The system will ask you if you want to proceed.
  5. Scanbox will then loop over all magnifications, collecting data for 8 sec and moving the sample by a known distance.
  6. When it finishes, Scanbox will display the optimal value of a resonant gain magnification variable that will make your pixels square.  Note that value.

Now, when you restart Scanbox the system will read the new spatial calibration in the calibration button.  The format is [xsize ysize] [xfov yfov].  The left pair shows the width and height of a pixel (in micrometers), and the right pair shows the width and height of the field-of-view at the current magnification setting (also in micrometers).  In the example above, the (x,y) size is [0.72 0.70] um, meaning the aspect ratio is close to one.

If the aspect ratio is far from one, and you prefer square pixels, do the following:

  1. Change the value of the “gain_resonant_mult” variable in the configuration file to the one suggested by the Scanbox spatial calibration, restart Scanbox.
  2. Re-run the spatial calibration.  Thi will create a new calibration file.
  3. Restart Scanbox to read the newly created calibration file.  Now the aspect ratio should be close to one.

The second feature is one is a checkbox labeled Return. When you run a knobby schedule you have click this box to make knobby return to the initial position it started from. So, for example, upon completion of a z-stack the system will go back to where it started. Note: this feature uses the Store/Recall C function, so if you have anything stored there it will be erased.

 

 

Measuring the field of view and validating the uniformity of spatial correction

If you followed the instructions on spatial calibration you should have a nice uniform field in Scanbox.  One simple way to measure the resulting spatial resolution and spatial uniformity at each zoom setting is to mount a 40 line pairs per mm RONCHI calibration slide on top of a green aut0-fluorescent slide.  By aligning the slide with the horizontal and vertical axis of the scan you can precisely measure the size of your field:

h

v

You can also superimpose them to visually judge if the spatial correction is isotropic throughout the field… which, in our setup it is rather uniform:

both

The dark side bands are blanked by the pockels cell and their size is controlled by deadband configuration parameter.