Scanner & Camera settings

The remaining settings will mostly need to be set interactively once Zapit has started. Let's start the software:

>> start_zapit
Available interfaces:
1  -  videoinput('gentl', 1, 'Mono12')
2  -  videoinput('gentl', 1, 'Mono8')

Connecting to number 1
Connecting to DAQ
Connecting to NI hardware via .NET DAQmx.
No laser fit file found. Laser is uncalibrated
Zapit is installed at C:\UsersMatlab_Scripts\zapit\
Building GUI
Zapit has started
Zapit is up to date.
Zapit version 0.10.2  --  2023/2/1

You should see some messages at the command line then after a short delay the GUI will appear. The image is a live camera feed. Place an object in the field of view and focus. Now you will set the scanner and camera settings.

Setting the scanner orientation

Start the laser and Zapit. Press "Point Mode" in the GUI and click on a location in the image feed. Adjust "Exposure" if needed. The desired position is shown by the red circle. The beam will not go to the desired position because the calibration has not yet been performed. However it should go in the correct direction. You can verify this further by setting the system to "Cat & Mouse" mode, and moving the mouse cursor over the field of view. If the beam motion seems inverted in its behavior, it can be corrected with scanners.invertXscanner or scanners.invertYscanner. Close Zapit and alter the appropriate settings to 1 (true) or 0 (false) as needed. Restart Zapit and verify. Once done you should have the beam going in the correct direction when you point but with an offset.

Setting the image orientation

You should confirm that the image itself is not inverted! If it is, there is a chance that the beam will go the Left hemisphere when you asked for the Right. This will not be obvious unless you look at the sample itself!

Make some target with a clear left/right/up/down directions. Then confirm with "Cat and Mouse" that when the beam is going to the left of the sample in the image feed that it's also hitting the left of the sample when you look at it. Confirm for all directions. If the behavior is not as expected, alter the flipImageUD or flipImageLR parameters under camera until the system behaves as expected. Again: 0 for false and 1 for true. After flipping you may need to alter the scanner invert paramters (see above).

Exposure settings

You will see a camera.default_exposure and a calibrateScanners.beam_calib_exposure. These are both changed via the GUI and you can ignore them.

Scale settings

camera.micronsPerPixel is the number of microns per pixel at the sensor. To obtain this, find the pixel size in your camera spec sheet (for example, the Basler ACA1920-40um, has a pixel size of 5.86 microns) then divide that by the magnification of your optical system. Our suggest setup for mouse brains, for example, has an f=100 mm objective and an f=50 mm tube lens. This yields a magnification of 0.5 and a pixel size of 11.72 microns.

scanners.voltsPerPixel is used to map scanner control voltage to a pixel location on the screen. A reasonable default value for this assuming an f=100 mm objective and Saturn5 Scanners is 0.022. This value does not depend on the number of microns per pixel the system is set to. Having a reasonably accurate value is necessary for the the "Point Spacing" and "Border Buffer" settings used during scanner calibration to be accurate. However, so long as the system can calibrate itself, an accurate voltsPerPixel value is not important. To set this value, start Zapit and wipe any existing scanner calibration there may be (hZP.wipeScannerCalib). Set the system to "Cat and Mouse" mode. Place the red circle near the middle of the field of view (0/0) and align final fold mirror until the beam points at the circle. Now move the circle and ensure the beam remains near the circle throughout. If the gain of the laser spot if obviously larger or smaller, edit the value of hZP.settings.scanners.voltsPerPixel at the command line until the mismatch has gone. You don't have to be spot on: just ensure there is no obvious gain difference. The scanner calibration procedure should get rid of any residual mismatches.

Last updated