Raw frames → band-pass detection → phasor / Gaussian fitting → zoomable super-resolution render. All client-side, no upload.
© 2026 Johannes Hohlbein · CC BY 4.0 · GitHub · see Help & guide for methods & references
A proof-of-concept single-molecule localization pipeline that runs entirely in your browser. Nothing is uploaded.
.tif/.tiff stack, or Simulate movie for a test dataset (open Simulation settings to adjust frames, blink density and photons).TIFF headers are parsed first to get the frame count and dimensions, then the decoded working-set size is estimated (frames × width × height × 4 bytes).
If it fits the memory budget (default 3 GB, adjustable) all frames are decoded into RAM with a progress bar — changing the threshold and re-running is then instant (no re-decode).
If it exceeds the budget, the loader streams: frames are decoded as the analysis reaches them and discarded again, so memory stays bounded no matter how long the stack is. Trade-off: re-running re-decodes. For ordinary TIFFs this happens in heaps of ~500 MB (adjustable) because every frame must pass through the TIFF decoder; one heap is decoded, localized, freed, then the next. This is exactly the pattern that would let you localize a live camera buffer in real time.
Large ImageJ stacks (above ~4 GB) are written with a single directory entry and all frames laid out contiguously after it, because 32-bit TIFF offsets cannot address further. webSMLM detects this from the images=N record and indexes frames arithmetically, decoding one at a time — no heaps needed.
Note: “streaming” currently refers to decoded frames. The file itself is still read into memory in full, so a 5 GB stack occupies 5 GB while open.
Bit depth (8/16/32-bit) and endianness are handled automatically; 16-bit is preserved (not flattened to 8-bit).
Band-pass filter (Difference of Gaussians). Each frame is blurred at a small scale (0.8×PSF σ) and a large scale (3×PSF σ); the large-scale blur is subtracted from the small-scale one. This removes flat background and slow gradients while keeping PSF-sized spots. DoG = G(0.8σ) − G(3σ).
Local-maximum picking with a k·σ threshold. On the filtered image we compute the mean and standard deviation of pixel values, and keep any strict 8-neighbour local maximum whose value exceeds mean + k·σ. Here σ is the noise spread of the band-passed image (not the PSF width), and k is the slider: k = 4 keeps peaks > 4 noise-standard-deviations above background. Lower k → more (dimmer) detections; higher k → fewer, more confident ones.
Each surviving maximum defines a small ROI (Fit window, e.g. 7×7 px) passed to the fitter.
Phasor (fast). Takes the phase of the first Fourier coefficient of the ROI in x and y to get the sub-pixel centre. No iteration — ~100–170× faster than Gaussian fitting, ~19 nm precision at 900 photons. Great for large stacks and real-time.
Gaussian (least-squares). Fits a 2-D Gaussian to the ROI by Gauss–Newton with a line search (~16 nm at 900 photons). Slightly better precision, much slower.
Note: the Gaussian fit is ordinary least-squares, not Poisson MLE. MLE is statistically optimal at low photon counts and would be a natural future addition; phasor is provided as the speed option.
Localizations are splatted into a high-resolution accumulation image at the chosen Magnification (super-res pixels per camera pixel) and optionally smoothed by Render blur. Both re-render from stored localizations without refitting. The scale bar is computed from your pixel size and the current zoom; scroll/drag/double-click to navigate.
Precision figures above are for the synthetic model; real data depends on your photon count, background and PSF.
What this tool borrows from, and where to read more:
Phasor localization — the fast fitter here directly implements:
K. J. A. Martens, A. N. Bader, S. Baas, B. Rieger, J. Hohlbein, “Phasor based single-molecule localization microscopy in 3D (pSMLM-3D): an algorithm for MHz localization rates using standard CPUs,” J. Chem. Phys. 148, 123311 (2018). doi:10.1063/1.5005899
Extended to engineered PSFs: Martens et al., “Integrating engineered point spread functions into the phasor-based SMLM framework,” Methods (2020).
Spot detection & thresholding — the DoG band-pass + “mean + k·σ of the filtered image” threshold follows the detection/threshold design of:
M. Ovesný, P. Křížek, J. Borkovec, Z. Švindrych, G. M. Hagen, “ThunderSTORM: a comprehensive ImageJ plug-in for PALM and STORM data analysis and super-resolution imaging,” Bioinformatics 30(16), 2389–2390 (2014). doi:10.1093/bioinformatics/btu202
Wavelet-based detection (a more refined alternative to DoG): I. Izeddin et al., “Wavelet analysis for single molecule localization microscopy,” Opt. Express 20(3), 2081–2095 (2012). doi:10.1364/OE.20.002081
Fitting & precision (why LS ≠ MLE) —
R. E. Thompson, D. R. Larson, W. W. Webb, “Precise nanometer localization analysis for individual fluorescent probes,” Biophys. J. 82(5), 2775–2783 (2002). doi:10.1016/S0006-3495(02)75618-X
K. I. Mortensen, L. S. Churchman, J. A. Spudich, H. Flyvbjerg, “Optimized localization analysis for single-molecule tracking and super-resolution microscopy,” Nat. Methods 7, 377–381 (2010) — shows MLE is near-optimal and unweighted least-squares wastes ~⅓ of the information. doi:10.1038/nmeth.1447
Measuring precision on real data — U. Endesfelder, S. Malkusch, F. Fricke, M. Heilemann, “A simple method to estimate the average localization precision of a single-molecule localization microscopy experiment” (NeNA), Histochem. Cell Biol. 141, 629–638 (2014). doi:10.1007/s00418-014-1192-3
Overview — M. Lelek et al., “Single-molecule localization microscopy,” Nat. Rev. Methods Primers 1, 39 (2021). doi:10.1038/s43586-021-00038-x
webSMLM © 2026 Johannes Hohlbein, licensed under
CC BY 4.0.
You may share and adapt it, including commercially, with attribution.
Bundled decoders retain their own licenses: UTIF.js and pako are MIT-licensed.