Drift Correction - UU-cellbiology/DoM_Utrecht GitHub Wiki

This module corrects for microscope's stage drift for localization microscopy acquisitions using normalized cross-correlation of partially reconstructed images. Requires loaded Results table.

The idea is that if there is a STORM/PALM acquisition of 10 000 frames, for example, then split it into 10 portions of 1000 frames (called window size), reconstruct detections in each window to 10 corresponding images (called here intermediate reconstructions) and find drift between them using normalized cross-correlation. After finding precise values of shift in X and Y for each window, they are assigned to the middle position of each window and all values for frames inbetween are calculated using linear interpolation. As an output, this method generates additional table with drift in X and Y for each frame. It can be saved for inspection and analysis or for delayed Load and Apply Drift Correction.

Here is how it looks like all together:

scheme

Be aware that for the rendering of intermediate reconstructions, this method automatically picks some values from the last used parameters of Reconstruct Image menu, shown at the bottom of the parameters window:

menu view

Method uses following parameters:

Pixel size for intermediate reconstruction

is in nm. Average localization precision in X and Y provided above should get an estimation. Also defines minimum possible shift.

Batch size

Number of frames used to build one intermediate reconstruction (one batch). Total number of frames is split into portions of this size. If anything left, let's say there are 10200 images and window size is 1000, there would be 10 images of 1000 frames and last 200 would use drift values from the last frame. To estimate its minimal possible value, pick a number of frames that would give at least crude recognizable picture of structure that is imaged.

Method

There are two available methods for now. Direct CC first batch and all others will calculate cross-correlation between first batch (window) and second then third, etc. This method is good for slow small drifts, but relies on a quality of the first batch. Direct CC consecutive batches will look for the shift between first and second, second and third batches, etc. It works better with large drift.

Apply correction to Results table

when checked, modifies X and Y coordinates of Results table (both in px and nm) with drift corrected values. Otherwise leaves table unchanged.

Show corrected image (using settings from Reconstruct)

Renders final drift corrected image using last set of parameters from Reconstruct Image parameters window.

Show intermediate reconstructions

Does that by adding new image stack with intermediate reconstructions.

Show cross-correlation maps

Shows stack of normalized cross-correlations in X and Y between intermediate reconstructions.The final drift values before linear interpolation are picked as values corresponding to pixel with maximum intensity on each map. Keep in mind that zero shift in X and Y corresponds to the middle pixel of the image. Read more about correlation here.


Tips on usage

To find optimal parameters, check the option Show intermediate reconstructions to see if they have enough localizations to visualize the structure of interest at each window.

Can be applied iteratively with gradually reducing pixel size of reconstructions and checked box for Apply correction to Results table.

Fast and crude estimations can be done using big values of pixel size and localizations rendered with fixed SD.