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.
mpsf.record.PSF
to easily acquire PSF stacks with ScanImage.mpsf.record.lens_tissue
to acquire standardised data from lens tissue.mpsf.record.standard_light_source
to data from a standard light sourcemeasurePSF
to estimate PSF size. For a demo, run measurePSF('demo')
. Grid2MicsPerPixel
measures the number of microns per pixel along x and y by analyzing an image of an EM grid. mpsf_tools.meanFrame
plots the mean frame intensity as a function of time whilst you are scanning.Add the measurePSF code
directory to your MATLAB path.
You do not need to "Add With Subfolders".
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.
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).
mpsf.record.PSF
to obtain a PSFmpsf.record.PSF
with number of microns obtained above as the first input argument. This will obtain the stack with a 0.25 micron resolution using the averaging you have set. e.g. record.PSF(12)
for a 12 micron stack. The save location is reported to screen. You can define a different z resolution using the second input argument.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
).
See documentation folder for how to make an EM grid slide.
To image the slide:
Grid2MicsPerPixel
.Grid2MicsPerPixel
to measure the FOV. The function will automatically pull data from ScanImage.
Look at the diagnostic figures to ensure function has found most of the grid lines (it uses the median grid line distance so you don't need all the lines). If very few grid lines are detected, the results will be meaningless. 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.
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')
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
You can generate a PDF report of all conducted analyses using
>> generateMPSFreport
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.
Please see the list of known obvious issues before using the software.
This code has been written in collaboration with Fred Marbach (SWC), and Bruno Pichler and Mark Walling of INSS.
record.PSF
.measurePSF
to a class so adding new features is easier.