Step 0. Image acquisition and program setup
Acquire the raw data, calibration, and dark offset images described in "Equipment":#equipment, and generate a .dat sequence log file.
Add the folder containing all Easy-DHPSF .m files to the MATLAB path using File>Set Path, and set the current folder to the folder containing your data. To initialize the GUI, run easy_dhpsf.m. This window (see "Figure 1":#f0) controls all the modules needed to process the data.
Before running any of the modules, set the conversion gain and pixel size of the detector (in object/sample space) using the fields at the top of the main window. These parameters should be the same for all .tif files within a project. Setting the pixel size incorrectly may cause artifacts in the recognition and localization algorithms. Changing these parameters after processing the data does not retroactively change the calculated results; use caution!
Figure 1. The Easy-DHPSF command window: (left) before running any modules and (right) after localizing single molecules.
Step 1. DH-PSF Calibration
The first module calibrates the relationship between the angle of the two lobes of the double helix and the axial position of single fiducial emitters, usually fluorescent beads. It also generates template images of the DH-PSF which are used for template matching later in the program.
1.1: Click the ‘run’ button in the ‘Calibrate DHPSF’ panel.
1.2: Set the EM gain used during the acquisition of the calibration images, and open the calibration images file, the dark offset image file matching the calibration, and the sequence log file for the calibration. The program will prompt for these data via dialog boxes.
1.3: Select a region of interest (ROI) containing at least one bright fluorescent object by adjusting the box and double-clicking inside it (see "Figure 2":#f1). Even though the calibration bead may be isolated (bright object toward lower-left of excitation spot in "Figure 2":#f1), it is helpful to select an entire widefield excitation region so that the background fluorescence can be estimated accurately.
1.4: Select fluorescent objects by clicking in the center of each DH-PSF. Each frame of raw data, as well as the accompanying double Gaussian fit, is displayed as it is processed (see "Figure 3":#f2). Note that by mistake you might select a bright single molecule instead of a bead, but you will be able to detect and ignore this in subsequent steps.
1.5: After processing, an output of calibration information will be generated (see "Figure 4":#f3). Inspect this for each bead to ensure that the angle vs. z position curve is roughly linear, and that the variation of angle measurements in each step is not unreasonably high (error bars in upper-left plot). Additional information from the calibration, such as the observed shift in x and y position with axial position, may be useful when aligning phase masks.
1.6: Select the most reliable calibration bead in the Easy-DHPSF main window using the drop-down menu. The calibration information and templates generated from this bead will be used in all later processing steps.
Figure 2. Choose region of interest for calibrating the DH-PSF.
Figure 3. A single raw movie frame being analyzed by the DH-PSF calibration module. Left: raw data after dark offset subtraction. Right: the reconstructed image of two beads in the raw data that were selected for fitting.
Figure 4. DH-PSF calibration statistics. For a good calibration standard, the calibration curve (upper-left) should be roughly linear, the xy position (upper-right) should deviate less than ±50 nm, and the localization precision (lower-left, lower-middle) in x, y, and z should be ≤15 nm over the course of the scan.
Step 2. Single-Molecule Detection Calibration
In this module, the templates generated from the calibration subroutine are used to generate a large array of matches to the raw image data. This step serves to assess what value of phase correlation is typical for a good match to a single molecule. After this step, the user will define a threshold for each template such that only DH-PSF images of reasonable quality will be analyzed with the double-Gaussian fitting algorithm.
2.1: Click the ‘run’ button in the ‘Calibrate SM identification’ panel.
2.2: Set the EM gain and select the templates to be used. By default, templates are chosen by the program such that the angle of the line connecting the two lobes is given by {-60°, -30°, 0°, 30°, 60°, 90°}, and this selection should generally be appropriate (see "Figure 5":#f4).
2.3: Select a region containing the single molecules of interest. This exact ROI will be used for the single-molecule fitting module and ideally should not contain fluorescent objects that are much (≥10×) brighter than the SMs you wish to analyze. Template matches are indicated as circles drawn over the raw data, and stronger matches are drawn as larger circles (see "Figure 6":#f5).
2.4: After the template-matching module is complete, open the ’threshold [DateAndTime]’ folder. This contains a selection of .png files that represent potential template matches. The filenames describe which template matched the data and the value of the phase correlation for the match (e.g. ‘template 3 threshold 272.png’).
2.5: Select appropriate thresholds for each template, and enter these into the ‘threshold’ field in the GUI (see "Figure 1":#f0). These thresholds should be chosen such that the two lobes of the DH-PSF are faintly visible and that there is a low rate of false matches for higher correlation values, as in "Figure 7":#f6. You should not be concerned if there are a few incorrect matches, say to one lobe of the DH-PSF from a very bright molecule, because these will be rejected by the subsequent double-Gaussian fit module.
Figure 5. Typical DH-PSF templates. Each template is chosen from the aforementioned calibration scan, where the rotation of the double helix between templates is evenly spaced at ~30°.
Figure 6. A single raw movie frame being analyzed by the SM-detection calibration module. Left: phase correlation of the raw image with the DH templates. Right: raw data with template matches indicated by colored circles. Larger circles indicate stronger matches, and will be saved with a higher threshold value.
Figure 7. Potential DH-PSF SMs identified by template matching. The image with an appropriate threshold is highlighted. Note that while thresholds 88, 92, 94, 102, 106, and 107 represent poor matches to the DH-PSF, the other matches for correlation values ≥84 are satisfactory.
Step 3. Fiducial Tracking (Optional)
This module tracks the movement of one or more fluorescent beads or other stationary markers. Stage drift during a SM experiment can be thus be removed by subtracting the movement of the fiduciary marker from the SM localizations.
3.1: Click the ‘run’ button in the ‘Track fiduciaries’ panel.
3.2: Select a region of interest containing at least one bright fiducial by adjusting the box and double-clicking inside it.
3.3: Select one or more fiducials by clicking in the center of each DH-PSF.
3.4: After fitting the fiducials, select whether or not to apply the averaged correction to the output data by clicking the ‘use fiducials’ checkbox. This may be changed at any time before outputting the data.
Step 4. Single-Molecule Localization
Using the results of the previous processing steps, this module identifies single molecules that score above the template matching threshold identified in step 2.5, then fits them using nonlinear least squares minimization to a double-Gaussian function.
4.1: Click the ‘run’ button in the ‘Localize DHPSF SMs’ panel.
4.2: Choose the frames from the raw data to process: by default, the entire image stack is processed.
4.3: Whenever starting a new experiment, monitor this process as it proceeds to ensure that the threshold used includes the single molecules visible in the raw data, and to ensure that the fits are performed successfully. Only matches that score above the thresholds are fit, and good fits are plotted in the frame-by-frame reconstruction (see "Figure 8":#f7). Here the definition of a good double-Gaussian fit is a fit that meets several straightforward criteria, hard-coded into the module. The tests performed to define a good fit are listed below under "Troubleshooting":#troubleshooting (step 4).
Figure 8. A single raw movie frame being analyzed by the SM-fitting module. Left: phase correlation of the raw image with the DH templates. Center: raw data with template matches indicated by circles. Right: the image reconstructed from good double-Gaussian fits.
Step 5. Viewing/Exporting the Processed Data
Easy-DHPSF gives three options for output of the processed data after all modules have been run, which are discussed in greater detail in the "Anticipated Results":#anticipated_results.
5.1: Click ‘Export to csv’ to generate a list of localizations in .csv format for direct manipulation. The columns of this file are labeled. Note that this listed z position does NOT correct for index of refraction mismatch between the sample and the objective! The user should supply that correction to the data before producing final reconstructions.
5.2: Click ‘3D scatterplot’ to generate a scatterplot of localizations at a particular ROI. Set the index of refraction for the immersion lens and the sample to apply a simple correction for index mismatch; by default, oil immersion and an aqueous sample are assumed.
5.3: Click ‘2D histogram’ to generate a histogram of localizations with median z position for each bin coded by color. As with the scatterplot, this module will correct for index mismatch.