Drop a TIFF movie anywhere, or choose an example.
Drop a TIFF movie anywhere, or choose an example.
Two-photon calcium imaging preprocessing in the browser: motion correction, summary images, ROIs, neuropil-corrected ΔF/F and spike deconvolution, all on the CPU in web workers.
Motion correction. Each frame is registered to a template by the Fourier cross-correlation (or, optionally, phase correlation) refined to 1/upsampling of a pixel with the matrix-multiply DFT of Guizar-Sicairos et al. 2008. The first template is the median of 10-frame means; later passes use the mean of the registered frames. Piecewise rigid splits the frame into overlapping patches as NoRMCorre does (Pnevmatikakis & Giovannucci 2017), limits each patch to a few pixels from the rigid shift and interpolates the patch shifts bilinearly to every pixel. Frames are resampled bilinearly with replicated borders. On the example the rigid shifts equal CaImAn's register_translation for every frame given the same template.
Summary images. Mean, maximum and the local correlation image: the mean Pearson correlation of each pixel with its eight neighbours (Smith & Häusser 2010).
ROIs. A simple, documented detector that is not Suite2p's or CNMF's: local maxima of the correlation image at least z robust standard deviations above its median seed a watershed limited to one cell diameter. It finds cells that are active during the recording; add silent cells with Add ROI at cursor, which places a disc of one cell diameter.
ΔF/F. F is the ROI mean, the neuropil the surrounding ring (from 2 px outside the ROI, at least 200 px, excluding pixels near any ROI), Fc = F − 0.7 · Fneu, F0 a running 8th percentile of Fc over 60 s, and ΔF/F = (Fc − F0)/F0. Where F0 is not positive ΔF/F is undefined, so that ROI is flagged and not deconvolved.
Deconvolution. OASIS for an AR(1) model with an L1 penalty (Friedrich et al. 2017), with λ chosen so the residual matches the noise, the noise from the high-frequency power spectrum and the decay from the autocovariance. It is written from the paper and matches the OASIS reference implementation on test traces.
Outputs: the registered movie (TIFF, input sample type), shifts (CSV), the summary images and ROI labels (TIFF), traces and ROI tables (CSV), the trace plot (SVG) and provenance (JSON).
Movies are processed locally in this browser and are never uploaded. Only the example is downloaded, from the Neurodesk dataset on Hugging Face.