SWC-Advanced-Microscopy / measurePSF

Measure PSF FWHM along different axes
GNU Lesser General Public License v3.0
24 stars 5 forks source link
imaging point-spread-function scanimage

measurePSF

This repository contains tools for measuring microscope performance with ScanImage. In particular, there are functions for recording and measuring Point Spread Functions (PSFs), and for measuring field of view size using an EM grid.

Main functions

cover image

Installation

Add the measurePSF code directory to your MATLAB path. You do not need to "Add With Subfolders".

Fill in the settings file

Output files contain meta-data associated with the microscope in order to make it easier to compare different microscopes and to track hardware changes. Before using the tools for the first time you must run mpsf.settings.readSettings; and then you must fill in the YAML file for your PC. The commands which record information assume this file has been created and filled in with your microscope details. Future changes to the software may add fields to this file automatically. If this happens, it will be reported to the CLI that a new field was added with default settings. If you don't change the defaults, probably nothing bad will happen but the information provided by that field will not be logged.

Obtaining a PSF in ScanImage with averaging and fastZ

To get a good image of a sub-micron bead:

To measure the PSF you can either use the included mpsf.record.PSF function or manually set up ScanImage (see documentation folder if you need to do that).

Using mpsf.record.PSF to obtain a PSF

Measuring the PSF

To view the PSF run measurePSF and load the saved stack using the GUI. For more info type help measurePSF. If loading ScanImage TIFFs the voxel size is extracted automatically from the header information in the file. Otherwise, this information can be provided using the second and third input arguments (see help measurePSF).

Measuring FOV size with an EM grid

See documentation folder for how to make an EM grid slide.

To image the slide:

Plotting mean frame intensity

Run mpsf_tools.meanFrame to bring up a figure window that plots mean frame intensity during scanning. This function is used for things like tweaking a pre-chirper. See help mpsf_tools.meanFrame for advanced usage.

Measuring field homogeneity

To record data:

mpsf.record.uniform_slide

The results are saved to a folder on the desktop. You can view the results as follows:

% cd to directory containing data
mpsf.plot.uniform_slide('uniform_slice_zoom_1_920nm_5mW__2022-08-02_10-09-33_00001.tif')

Measuring dark noise, electrical noise, and a standard light source

Remove all contaminant sources of light from the enclosure run:

 mpsf.record.electrical_and_dark_noise

Then place a standard light source under the objective and run:

 mpsf.record.standard_light_source

PDF report

You can generate a PDF report of all conducted analyses using

>> generateMPSFreport

Requirements

The function has been well well-tested under R2016b and later. It should also work on R2016a. It's known to fail on 2015b and earlier. Requires the Curve-Fitting Toolbox, the Image Processing Toolbox, and the Stats Toolbox. The MATLAB Report Generator is needed if you want to make PDF reports. It is known to work with ScanImage 2020 to 2022 and likely earlier versions are also OK.

Known Obvious Issues

Please see the list of known obvious issues before using the software.

Acknowledgments

This code has been written in collaboration with Fred Marbach (SWC), and Bruno Pichler and Mark Walling of INSS.

Change-Log