1.6 s

Warning

This package uses the squared loss! This means it is only appropriate for relatively high SNR images with zero-mean backgrounds, i.e. those generated by TIRF microscopy.

You may need to apply a variance-stabilizing transform in addition to removing any background.

3.5 μs

Simulation

6.5 μs

A ForwardModel describes the parameters of single molecule localization microscopy (SMLM) experiment. For square images and an isotropic Gaussian point-spread function a model can be constructed as follows:

8 μs
model
20.7 μs

This models a 16 by 16 image patch with an integrated Gaussian PSF with standard deviation of 1.5 pixels.

5.9 μs

Warning

Because ForwardModel uses statically-sized arrays, performance degrades rapidly with increasing patch size.

A PointSource has three properties: x and y are the coordinates of the source within an image, while intensity is the brightness.

6.7 μs
p
6.4 μs

constructs a unit-intensity point source at the spatial location (2.5, 3.7).

We can apply the forward model to a point source to generate a noiseless image:

6.3 μs
6.5 μs
57 ms

It's also easy to generate a noisy image of a collection of sources:

7.4 μs
8.1 μs
noiselevel
0.01
1 μs
31.3 μs
1.2 ms

Localizing small image patches

For small patches (less than about 20 by 20) we provide an efficient estimator, PatchLocalizer.

7.2 μs
50.4 μs
est_sources
141 μs
2.6 ms

The two arguments to patchlocalizer are the maximum number of sources the algorithm will estimate and the minimum drop in the loss function the algorithm will accept when adding a new source. When the drop in the squared loss function from adding a new source falls below 1E-1, the algorithm will return the previously estimated sources.

7.5 μs

Localizing in large images

For larger images we provide the ImageLocalizer type:

7.1 μs
54.6 μs

The first argument is again the standard deviation of the gaussian PSF, while the second is the minimum drop parameter discussed above.

ImageLocalizer's can comfortably handle large images:

8.3 μs
15.1 ms
large_image_estimated_sources
309 ms
16.5 ms