Trade-offs between spatial and temporal resolutions in stochastic super-resolution microscopy techniques

Widefield stochastic microscopy techniques such as PALM or STORM rely on the progressive accumulation of a large number of frames, each containing a scarce number of super-resolved point images. We justify that the redundancy in the localization of detected events imposes a specific limit on the temporal resolution. Based on a theoretical model, we derive analytical predictions for the minimal time required to obtain a reliable image at a given spatial resolution, called image completion time. In contrast to standard assumptions, we find that the image completion time scales logarithmically with the ratio of the image size by the spatial resolution volume. We justify that this non-linear relation is the hallmark of a random coverage problem. We propose a method to estimate the risk that the image reconstruction is not complete, which we apply to an experimental data set. Our results provide a theoretical framework to quantify the pattern detection efficiency and to optimize the trade-off between image coverage and acquisition time, with applications to $1$, $2$ or $3$ dimension structural imaging.


I. INTRODUCTION
Optical microscopy is a convenient tool to study biological processes, but its resolution is fundamentally limited by Abbe's diffraction.The image of a point source is a pattern whose size is comparable to the optical wavelength (∼ 250 nm), hence source points separated by a distance smaller than a wavelength are hardly distinguishable [1].Electron microscopy provides a higher spatial resolution (∼ 1 nm) but at the cost of a more complex sample preparation which is incompatible with in vivoimaging [2].The recently developed super-resolution imaging techniques aim at combining the best of these two worlds.Using these techniques, spatial resolution as low as 10 nm have been achieved for imaging biological cell structures.However, their applicability to the study of dynamical biological processes is limited by their long acquisition times [3,4].
Though relying on different optical probes, the superresolution techniques known as PALM (Photoactivation Localization Microscopy) or STORM (Stochastic Optical Reconstruction Microscopy) rely on a common principle: sources that lie within the same diffraction-limited volume are separated by a sequential activation process, which introduces a temporal separation between source points [5].Within each frame, a small and random fraction of probes is activated by illumination.This sparse subset of randomly activated probes is imaged to produce a frame.Then, finding the centroid of each diffraction patterns leads to a set of coordinates, having a nanometer-level precision [1,6].Merging all the single-molecule positions obtained on successive frames produces the final image.Since only a small fraction of probes is imaged per frame, a certain number of frames * Electronic address: mbijr@nus.edu.sg is required in order to obtain a reliable reconstructed image.Multiplying this number by the typical acquisition time of frames (typically in the 10 − 100ms range), we obtain the minimal time, denoted T , to obtain an image at a nanometer-scale resolution.A typical reported value is T ∼ 30 min for a whole cell imaging at a 10 nm resolution [4].This value is too large to study many dynamical processes that occur in living cells, such as the contraction of acto-myosin units [7], reorganization of focal adhesion complexes [8] or protein cluster formation within the plasma membrane [9,10].
In addition, stochastic microscopy is prone to localization errors.These errors may either originate from overlapping spread functions or from emission outside of the region of interest.However, given a set of localized observations, one can generally assume that spurious detections corresponds to regions with low count-density, e.g. the density-based spatial clustering of applications with noise (DBSCAN) algorithm operates noise filtering by eliminating observations whose nearest neighbors are further than a prescribed threshold distance [11].Here, we consider the reconstruction criteria in which a region of space is assumed to belong to the region of interest if and only if it has collected at least a number r of observations during the duration of the experiments T .If the number of observations is insufficient, the reconstructed structural image displays voids within the region of interest (ROI) -parts of the ROI are assigned to the background noise.We refer to these voids as stochastic aberration.This leads to the following two formulations of the main question of the present paper: What should be the minimal acquisition time in order to reliably discriminate between the region of interest from the rest of the field of view?How can we reliably discriminate whether a hole in the reconstructed super-resolved image is a genuine gap in the structure rather than an aberration due to a lack of observations?
It is generally thought that in widefield stochastic tech-niques, such as PALM, the imaging time T is solely controlled by the density (denoted ρ) of activated fluorophores per frame and by the spatial resolution (σ) following the relation T ∼ 1/(ρσ).The latter relation does not depend on the total size of the field of view (S), which represents a subtantial advantage of stochastic techniques over deterministic one.In raster-scanbased techniques, e.g.STimulated Emission Depletion (STED), the resolution is exempt of stochastic aberration but the acquisition time t increases linearly with the size of the field of view [14].
In this paper, we argue that the imaging completion time T should be expected to depend on the size of the field of view, due to the random localization process that results in an uneven spatial distribution of events.Based on a stochastic model, we derive the relation: which means that the trade-off between the spatial (σ) and temporal (T ) resolutions depends (i) on the ratio of the size of the field of view to the desired spatial resolution (ii) on the necessity to separate the ROI from the noisy background, via a minimal number of redundant observations r that is an increasing function of the background noise intensity, (iii) on the risk of an incomplete coverage of the ROI (i.e. of stochastic aberrations) via the 5%-centile parameter θ = 0.95 and finally (iv) on the dimensionality D ∈ {1, 2, 3} of the ROI via the constant γ D .The prefactor ln(S/σ) in Eq. ( 1) can be significantly larger than 1, eg. a cell of extension S = 10 3 µm 2 contains 10 7 squares of area σ = 10 −4 µm 2 (ie. a typical size for an Abel diffraction pattern), which leads to ln(S/σ) = 16.The result Eq. ( 1) applies to experimental situations in which a high reconstruction fidelity is needed.Obtaining a complete image reconstruction can be of critical interest in structural reconstructions, e.g. when evaluating the integrity of a DNA segment [15] or the tensegrity of the actin network within a cell [16].Indeed, a broken actin filament cannot support tension, similarly to a nano-wire which cannot conduct current when it is cut in two.Mind that the logarithmic scaling with the image size stems also holds for a near complete image reconstruction (see Sec. III B).However, in some other experimental contexts in which a high fraction of missed pixels in the reconstructed image is tolerable, we show that the image time should be expected to scale linearly with size of the sample (see Sec. III G).
We tested the applicability of Eq. (1) on experimental localization sequences.We find that Eq. ( 1) is no longer valid at high level of background noise.This is expected since Eq.(1) does not hold when the minimal number of redundant observations r is larger than a critical value r c = ln(S/σ).In the regime r r c , we find that the image time behaves as T ∼ r/(ρσ).
The paper is organized as follows.We first present the two experimental setups: (i) a PALM setup and (ii) a Total Internal Reflection Microscopy (TIRM) experiment in which we measure the scattered light from Brownian nano-particles at the surface of a two-dimensional sample.We then define two image rendering schemes, called patch and box-filling methods (see 1).We then prove the relation Eq. ( 1) and we show its connexion to the coupon-collector problem [32][33][34].Therefore, we refer to the result of Eq. ( 1) as the coupon-collector scaling.
We then consider the robustness of the couponcollector scaling for several image completion requirements, and in particular the effect of correlations between successive frames.This case is particularly motivated by the Brownian setup, in which the escapes and returns of the Brownian particles within the detection zone leads to temporally correlated scattering events between successive frames.We point out that there is a close analogy between the gold nanoparticle experiments and PALM techniques relying on organic dyes whose blinking statistics exhibit time-correlations [31].We recall that bleaching refers to an irreversible transition of a probe to an inactive state [5].The analogy holds both on correlated blinking events -which corresponds to the correlated returns of the Brownian particles to the illuminated region -and on bleaching events -which corresponds to the escape of the Brownian particle far from the illuminated region.
We conclude our article by presenting a procedure by which, in real-time during the acquisition, we can estimate the risk that the image is prone to stochastic aberrations.

A. PALM experiments
We analyzed the sequence of localization events from two sets of samples: (i) silane sample with quasi-uniform sampling in fluorophores, and (ii) fibroblast cell with tagged actin structure.In particular, we illustrate our noise removal procedure in Fig. 2, by requiring a minimal number of r = 30 events.Details on the PALM experiments are provided in the SI [47].

B. TIRM experiments
In a recent work [30], we presented a new stochastic imaging technique to map an electromagnetic field with a nano-scale resolution using light-scattering Brownian particles as local probes of the field intensity.The Brownian motion of the scatterers eventually lead to a full coverage of the imaged field.Following [30], we consider the imaging problem of an evanescent wave created by a Total Internal Reflection Microscopy setup.In this setup, we consider that the optical intensity of the electromag- j , for each pixel j and for each frame t.Complete image completion (with r ≥ 1) is obtained after t = 4 frames.At t = 50, all pixels have been observed at least r = 10 times.netic field can be modelled as where β is the penetration length of the field, and I 0 is proportional to the optical intensity of the field at the surface -with a proportionality constant related to the scattering cross section of the particles.In principle, in most situations of interest, both quantities β and I 0 can vary with the location (x, y) on the surface.In this context, the term image acquisition refers to the determination of the field intensity I 0 and β.However, as a first test of the method, the experimental data set from [30] corresponds to a situation where both I 0 and β are homogeneous within the whole field of view.We detail a procedure that leads to the determination of I 0 and β in the SI [47].

C. Two image rendering methods
Super-resolution techniques rely on the localization of the center of diffraction spots, which provides a set of points.However, a spatial extention needs to be attributed to each point to obtain an image that is readable to the human eye.In the following, we will be interested in the two following image rendering methods: (i) the box-filling method (BFM), which is adapted to a density image representation [24] and (ii) the patch method (PM), which is associated to a pointillist representation [25].
The BFM considers the structure of interest as tessellated into F square pixels of equal area, which can therefore be expressed as the ratio of the total volume by the resolution volume: F = S/σ.Each new event falls within a specific pixel, thereby increasing by one the cumulative number of observations of this pixel.This method is naturally adapted to measure the densities.Though we employ the term pixel in the following, our method also applies to 3D imaging problems in which F refers to the number of voxels within the structure of interest [26][27][28][29].
In the other hand, the PM associates to each event a surrounding extension, characterized by the quantity σ, which is either a length (1D), an area (2D) or a volume (3D).Generally, the spatial extension is chosen to correspond to the spatial uncertainty associated to the localization procedure (e.g. a few nanometers, [25]).The image completion time is related to the minimal number of patches required to cover the structure of interest.

D. Statistics of events
We assume that fluorescent events are distributed according to a homogeneous Poisson process, such that the probability density dP that an event occurs in an infinitesimal space of volume ds reads dP = ρds [17].We now consider a regular domain of volume S within a D dimensional space, in which we assume a constant density of fluorophore d.Furthermore, we assume that at each frame, only a fraction f of fluorophores are detected.The number of detected fluorescence events after one frame, denoted N (1) , is a Poisson process of density ρ = f d; hence P N (1) = n = exp(−ρS)(ρS) n /n!.If S = A refers to the volume of the Abel diffraction pattern, the mean number of fluorescence events per frame ρA should be lower than 1 in order to limit the risk of overlapping point spread functions.Typically A = (10 2 nm) D [5], hence ρ < 10 −2D nm −D .In the case of membrane (D = 2) with fluorophore density d = 10 4 µm −2 , the corresponding maximal fraction of activated fluorophores should be f < 10 −3 .After a number T of frames, the total number of collected events is distributed according to a Poisson distribution, with P N (T ) = n = exp(−ρST )(ρST ) n /n!.
We finally assume that the density of events ρ is timeindependent, hence neglecting the progressive bleaching of fluorophores [31].Our time-independent assumption corresponds to two situations, in which either (i) the total number fluorophores per elementary resolution volume remains large compared to the number bleached fluorophores, or (ii) if the activation laser is increased as a function of time in order to balance the effect of bleaching.

E. Estimation of the structure size
In many situations, the volume of the structure is either completely unknown a priori, or can only be partially inferred -e.g. by assuming randomly oriented linear order.Within the BFM, we show (see SI, Sec.B 1 [47]) that the maximum likelihood estimator of the number of relevant pixels F corresponds to the quantity: where is the cumulative number of measures of the pixel j, e.g.M (t) j = 0 if the pixel j has never collected any event up to time t and M (t) j ≥ 1 if the pixel has been observed at least once up to time t (see Fig. 1).Similarly, within the patch-method framework, the maximum likelihood estimator of the structure volume consists in the covered volume at the time t.These two estimators are biased, as they tend to underestimate the structure volume.

F. Mathematical definition of the image completion time
We call image completion time the minimal number of frames required to obtain a complete image of the region of interest.The term complete refers to the condition that every pixel or point (among those that should be observed) has been covered at least a certain number of times, denoted r ≥ 1.More precisely, the image completion time T is the random variable (called stopping time) that corresponds to the minimal time t such that min j M (t) j = r; where j ∈ [1, . . .F ] in the BFM framework, or j refers to any point within the volume of interest in the PM framework.We will be mainly interested in the centile of T , denoted t θ and defined as: where θ is the tolerated risk.To summarize, the quantity t 0.05 refers to the minimal number of frames that guarantees, with 95% probability, that there is no stochastic aberration within the reconstructed ROI image.

G. Simulations
Both in the BFM and PM frameworks, the volume of the region of interest is tessellated into a grid of elementary squares.In the BFM, each event covers a single elementary square; while in the PM, each patch σ covers a square matrix of elementary squares.In both frameworks, we generate a large sample of coverage events and we analyse the resulting distribution of coverage times using Matlab's prctile function.

A. The image completion time follows a coupon-collector scaling
We first derive the main result of Eq. ( 1) in the case of the BFM with no time-correlation between frames.Here, we assume that the value of the total number of pixels F is known.Under the assumption that detection events occurring in separate pixels are independent, the probability that exactly M pixels have been observed at least once (r = 1) reads: where p 0 = 1 − p 1 , and p 1 = ρσ is the probability that an event occurs in a given pixel and at a given frame.
In particular, the probability that the estimator F (t) is equal to its target value F reads: We now determine the centile of the image completion time, defined according to Eq. ( 4) as the solution of the equation P ln (1 − p 1 ).In the limit p 1 1 and for sufficiently high centiles (θ < 0.1), we find that the centile of the imaging time reads: where µ = F p 1 is the mean number of observations per frame.The latter expression corresponds to the announced Eq. ( 1) with r = 1.
A key feature shared by Eqs. 1 and 7 is the non-linear dependence of the imaging time in terms of the number F of pixels that characterize the structure.This scaling is related to the classical coupon-collector problem [32][33][34].The problem consists in buying a minimal number of the boxes (each containing a random coupon) in order to gather a complete collection of coupons, with a sufficiently high probability.Here, we focus on the case where each box contains, at random, either 0 (with probability p 0 ) or 1 coupon -in which case the mean number of coupons per box is equal to µ = 1 − p 0 .A straightforward proof leads to the following exact expression for the mean number of bought boxes t (i.e.frames) required to collect all coupons (i.e.all pixels) is E [T ] = F (1 + 1/2 + . . .+ 1/F )/µ.If the number of coupons F is large, the latter expression takes the asymptotic form E [T ] = F ln(F )/µ.Adapting the identity (2) of Ref. [32], one shows that the centile of the stopping time reads t θ = (F/µ)×ln(F/θ) in the same limit F 1, which corresponds to Eq. ( 6) after identification of the mean number of coupons per box to the mean number of events per frame.
Furthermore, the expression for the image completion time in Eq. ( 7) only depends on the number of pixels but not their spatial organization, e.g. on the 1D, 2D or 3D nature of the structure.This is expected since pixels are considered to be independent.

B. The coupon-collector scaling holds for a near complete coverage
A simple argument shows that Eq. ( 1) holds even in the near total coverage, ie.when the final image should contain a significant fraction (e.g.90%) of the total number of pixels within the ROI.Consider that a single pixel i is missing after t frames.The additional number of frames ∆t that is required to find the missing pixel i is of the order of the total number of pixels, ie.∆t ∝ F .This increment is small compared to the total completion time T = T near−complete + ∆t ≈ F ln(F ).Provided that the missing fraction of pixels is small, the near-completion time T near−complete is approximatively equal to the completion time T .

C. The coupon-collector scaling holds when redundant observations per pixel are required
To distinguish relevant observations from spurious ones, we consider that a pixel should collect a minimal number of observations denoted r to be considered as being part of the region of interest.Assuming that all pixels within the ROI are equivalent, the probability that all pixels have collected at least r observations can be expressed in terms of the probability that the pixel 1 have collected at least r observations as P F (t) = F = P(M We show in the SI B 2 a [47] that, in this case, the centile of the image completion time reads The latter relation corresponds to the centile of the coupon collector's problem when r copies of each coupon need to be collected (see [32,37]).We emphasize that Eq. ( 8) requires that the required number of coverage r is sufficiently small, ie. that r ln(F ).We also generalize the result of Eq. ( 8) to a multicolor imaging problem (see SI B 3, [47]).

D. The coupon-collector scaling holds in the presence of spatial inhomogeneities
In this section, we discuss the case of a nonhomogeneous rate of activation, which is particularly important in PALM (see Fig 2).
We model the non-homogeneity of detection events by assuming that, among pixels, the probability p 0 is distributed according to a probability distribution ψ(q).Under this assumption, the probability that there has been more than r observation in a particular pixel i reads: where P(M 1 ≥ r|p 0,i = q) is given in 5 (see also SI, Eq. (B3), [47]).From the expression in Eq. ( 9), we numerically solve the relation Eq. ( 4) to obtain the imaging time t θ .In the Experimental Comparison section IV, we consider a model in which the probability ψ is Gaussian distributed.We find that the coupon-collector logarithmic scaling still holds in that case.However, the precise distribution of spatial hetereogeneities is needed in order to obtain a quantitative fit to the experimental data (see Fig. 5).

E. The coupon-collector scaling holds with the patch image-rendering method
We now consider that the image results form the accumulation of circular patches, whose radius σ corresponds to the spatial resolution.The patch centers are distributed according to a homogeneous Poisson distribution within the region of interest, of volume S.
The study of coverage problem has a long history [38,39].However, analytical results concerning coverage problems in two dimensions are rather recent [40,41].These studies were motivated by the study of the wifi coverage resulting from randomly located routers.We will make use of results concerning the expression of the centile n θ of the number of patches required to cover a circle [38] or a square [40] by circular patches.
Here, we seek an expression of the centile time t θ , i.e. a time expressed in terms of a number of frames t, rather than the centile time expressed in terms of the number of patches n.We expect that t θ = n θ /µ where µ is the number of events per frame.Indeed, in the small patch limit σ/S 1, full coverage events occur when the number of events is large (n 1) in which case the number of events is simply proportional to the number of frames t.This approximation is further justified in the SI [47].Therefore, following Refs.[38] and [40], we find that Eq. ( 1) corresponds to the time required to obtain a r-fold coverage of a D-dimensional ROI of total volume S by circular patches of volume σ.In particular, we obtained that γ 1 = 0 in 1D (following [38]) and that γ 2 = 2 in 2D (following [40]) and finally that γ 3 = 3.
Remarkably, Eq. ( 1) takes a similar form as the coupon-collector problem from Eq. ( 8).This similarity suggests that in the limit σ/S 1, regularly spaced patches of size σ/S behave as if they were independent.Mind, however, that the expression from Eq. ( 8) corresponds to a value γ D = −1 for any space dimension.The origin of this discrepancy at second order in the ratio σ/S 1 is discussed in Ref. [38].In conclusion, we have shown that both the PM and BFM lead to similar expressions for the image completion time.
Another interest of the PM representation is that we can answer the following question: after a time t has elapsed, what is the probability P ( ) that a hole of size in reconstructed image corresponds to a genuine gap in the structure?We identify P ( ) as being equal to the empty-space distribution defined in [39], hence we find that where Ω = π D/2 /Γ [1 + D/2] is the volume of a sphere of radius 1.We expect Eq. ( 10) to hold within the BFM framework, hence providing the probability that a connected set of N = /σ missing pixels corresponds to a genuine hole.

F. The coupon-collector scaling holds in the presence of correlations between frames
In the Brownian scatterers experiments, the gold particle may enter, escape or return within the field of view, leading to correlated observations between successive frames.In contrast to the discussion leading to Eq. ( 6), these temporal correlations invalidate the independence hypothesis that allows to factorize the final time probability distribution.We encompass these correlated observations through the following box-filling model, in which the number of events per pixel and per frame is assumed to be a random variable K with a general probability law p k = P(K = k) for all k ≥ 0. The statistics of K encompass the effect of time-correlated observations by neglecting the time between successive correlated events.Comparison of this model to experiments is satisfactory, as visible in Figs.3(e) and (f), in which we represent the experimental data from Ref. [30] and simulated evolutions of the cumulative number of events M (t) j .We define the mean and variance of the number of observation per pixel per frame as ν = ∞ k=1 kp k and σ 2 = ∞ k=1 k 2 p k − ν 2 , respectively.We assume that the set of probabilities p k , k ≥ 0 is identical for each of the pixels of the structure to be imaged.In SI B 2 a [47], we show that the imaging completion time reads provided that p 1 = 0. Mind that Eq. ( 11) differs from Eq. ( 7) due to the prefactor 1 − p 0 , which is determined by the precise statistics of K and may significantly differ form the value of µ/S.In particular, at a constant total mean number of events per frame µ, an increase in the mean number of correlated events ν also increases the imaging time.We conclude that, temporal correlations can significantly affect the value of the image completion time, yet without affecting the coupon-collector scaling of the image completion time.occuring in pixel 3 (c) as seen experimentally (d) as represented in our model, where all correlated observations are collapsed into one single instantaneous events.(e-f) Evolution of the cumulative number of observations obtained, either (e) from the experimental data set of Ref [30], or (f) from Monte-Carlo simulations, with the fitted jump distributed.The different colors correspond to different pixels (4 among F = 100).(g-h) Distribution of jump length p k ∝ exp(−k/kc) (in log-scale): (g) from experiments (blue circles), where the maximum likelihood estimator of the exponential model [46] provides the value kc = 2.9±0.1 (black line); (h) from simulations, with kc = 2.9 and the same number of 2792 simulated events.

G. Situations in which the coupon-collector scaling does not hold
First, when a small subset of observation is sufficient to reconstruct the image, the coupon-collector scaling should not be expected.This may include situations in which the structure can be inferred, e.g. by assuming randomly oriented linear shapes [16].Consider that the image is considered to be complete as soon as M F different pixels have been acquired.We find that the probability defined in Eq. ( 5) is maximal after a number of frames t opt (M ) ∼ M/(νF ) in the limit µ/F 1 and M/F 1.Hence, the image completion time is proportional to M , with no logarithmic dependence on the parameters.
Secondly, when the ratio of structure signal to the background noise is weak, a large number r F of redundant observations per pixel is required; we show that the coupon collector scalings from Eqs. 8 and 1 does not hold in this limit.Indeed, due to the central limit theorem, the number of observations collected in the pixel j eventually converges with t towards a Gaussian distribution: M (t) j ∼ N tµ/F, tΣ 2 /F , where, as in the previous section, µ and Σ 2 are the mean and variance of the number of observation per frame within the total field of view (which, in principle, can be different from ν and σ 2 in the presence of temporally correlated noise).Under the Gaussian assumption, we find that the probability distribution of the image completion time T reads: where erf(x) = x −∞ dt exp(−t 2 )/ √ π is the error function [44].In the limit of a large number of observations r ln(F ), the expansion of the error function around 0 provides the following approximate expression: in the limit r ln(F/µ).The key feature from Eq. ( 13) is that the image completion time t θ does not follow the coupon-collector scaling.Similarly to a deterministic imaging techniques, the image time scales linearly with F -which should be expected since the effects of the localization randomness are all the more averaged out that the required redundancy per pixel is large.
To conclude, we have obtained analytical results for the image completion time problem in the limits r ln(F/µ) and r ln(F/µ) while we resorted to numerical simulation to describe the intermediate regime.

IV. COMPARISON TO EXPERIMENTS A. Comparison to PALM experiments
We analyzed the sequence of localization events from a silicon wafer with quasi-uniform coating.The nonuniformity in the fluorophore density leads to heterogeneities in the value of p 0 , i.e. the probability per frame that a pixel does not collect any observation (see Fig. 4).We fit the distribution p 0 by a Gaussian distribution  8) (solid blue line) provides a better fit of simulations (red error bars, obtained by bootstrapping [43]) than the approximate solution from Eq. ( 13 Based on the estimation of probability distribution from Eq. ( 9), we find our predicted centile time is in quantitative agreement with the analysis of two experimental data sets.We point out that taking into account the spatial heterogeneities in p 0 is required to obtained the quantitative fit represented Fig. 4d.

B. Comparison to TIRM experiments
We represent the TIRM experiments data from Ref. [30] within the BFM framework and we include temporal correlations between frames.First, the mean number of particles per frame and over the whole field of view reads µ = 0.70.Secondly, the jump distribution is estimated as follow: two successive events are assumed to correspond to the return of the same particle if (i) they occur within the same pixel and (ii) they are separated by a time interval of less than ∆ = 5 frames.13); (blue circles) exact centile time obtained by numerical inversion of Eq. ( 12).(b) TIRM experiments from Ref. [30], with F = 4: (red bars) centile estimation from experiments, where the error is estimated by bootstrapping [43]; (black dots) theoretical prediction from Eq. ( 13).
The experimental histogram is fitted by the distribution and k c = 2.9 (see Fig. 3.g.).This leads to a mean jump size ν = 1/(1 − exp(−1/k c )) = 3.4 and a variance σ 2 = 1/(cosh(1/k c ) − 1) = 17.We check that our results weakly depend on the specific value attributed to the separation time ∆.As described in Figs.4a and 5b, we show that our theoretical expressions from Eqs. ( 11) and ( 13) both fit to the experimental estimation of the centile time in their respective validity range.We point out that a straightforward implementation of Eq. ( 8), which would neglect temporal correlations, leads to a value that is an order of magnitude lower than what is experimentally observed.
In the SI [47], Sec.D, we justify that a large number of redundant observations r ≈ 4 • 10 3 is required in order to obtain a reliable measure of the penetration length β.

V. REAL-TIME ESTIMATION OF THE RISK OF STOCHASTIC ABERRATION
Experimentally, the two quantities F and µ are unknown a priori.These quantities are indeed associated to the structure to be imaged, whose properties are unknown prior to imaging.Here, we propose a real-time procedure to determine whether we can safely consider that the image is complete.We emphasize that this procedure is not specific to a choice of image representation method, nor on the required number of redundant observations r.
We evaluate the probability that the image is complete based on the two estimators F (t) and µ (t) of number of pixels and of the mean number of events per frame, respectively.For example, in the BFM with r = 1, the estimator of the image completion probability reads: We also represent the probability P ( F (t) = F ) for the image completion (solid magenta curve).In both cases, error bars indicate the standard deviation estimated from the random sampling.Hence a single random realization (i.e. a single experiment) is sufficient to obtain a good estimate of F (t) and P ( F (t) = F ).(d) Probability distribution for the estimator t0.05 (t) .The distribution converges to the centile t0.95 = 760 (red vertical line) as t increases.The value t0.95 (50) = 264 is significantly larger than the current number of frame t = 50: this is consistent with the conclusion that more observations are required.
We represent the evolution of the estimated probability corresponding to Eq. ( 14) in Fig. 6c.We set the values to F = 100 and p 1 = 10 −2 .At t = 300 the image completion probability is lower than 4.10 −3 : hence more frames are needed.The question is now to determine how many additional number of frames are required.
Our analytical expression of the image completion time can then be used to the required additional number of frames.For example, the quantity t θ (t) = ( F (t) µ (t) ln( F (t) /θ) is an estimator of the completion time, where we consider the BFM with r = 1 for simplicity.We represent the convergence of the latter estimator to the value of the centile time t θ in Fig.
After t = 300 frames, we estimate that about 420 frames are required, which is consistent with the theoretical value of the centile time t θ = 760.
Based on the estimators P[ F (t) = F ] t θ (t) , we propose the following procedure to analyse an imaging experiment in which t frames have been collected: 1. Compute the estimators of the number of pixels ( F (t) ) and of the mean number of events per frame ( µ (t) ).
2. Compute the estimator of the probability that the image is complete.If this estimator is higher than a desired confidence threshold, the imaging process can be stopped.
3. Otherwise, compute the estimated image completion time t θ (t) .Perform t θ (t) − t additional frames and return to step 1 with the substitution t ← t θ (t) .
The above procedure is not specific to any particular criteria for the image completion.For example, if a large redundancy is required (r ln(F )), one should use the expressions of Eq. ( 12) for the probability that the image is complete and Eq. ( 13) for the image completion time.In the SI C 3 [47], we provide an expression for the probability that the image is complete within the PM framework.

Conclusion
Our theoretical model provides a unified framework to describe the temporal resolution of several types of stochastic microscopy techniques.These include PALM, in which a large number of fluorescent probes are attached to the sample and are stochastically activated, or techniques in which a smaller number of scattering probes stochastically explore the imaged region.We derive analytical expressions for the centile of the imaging time for several types of image completion criteria.When a sufficiently low number of accumulated events per pixel are required, the temporal resolution is shown to be logarithmically coupled to the spatial resolution (pixel size), due to the spatial redundancy of detection events.However, the temporal resolution becomes linearly coupled to the spatial resolution when a large spatial redundancy of events is needed, as the effects of the localization randomness are averaged out.Our results on the imaging time are readily applicable to estimate the minimal time required to reliably characterize spatial patterns by stochastic imaging, with applications ranging from the detection of protein clusters by PALM [9] to the detection of the electromagnetic field around nano-antennas by Brownian particles [30].
Supplementary material Electronic supplementary material is available at XXX or via YYY.

b. Random number of observations per frame
In this section, we consider that, at each frame, the number of observations of a given pixel is random variable equal to (i) 0 with probability p 0 and (ii) to a value k ∈ [0, r] with a probability law p k .
Following the method of the previous paragraph B 2 a, we consider the coverage dynamic for a single pixel.The probability that the single pixel has been observed jtimes, with 1 ≤ j ≤ r − 1, during a sequence of t frames is: where (i) the sum holds over the sets of indices (j 1 , . . .j r ) that guarantee the condition that r m=1 mj m = j, and (ii) j u = r m=1 j m is the total number of adsorption events.
The imaging time t θ is defined by the equation: (q (t θ ) r ) F = 1 − θ, in agreement with Eq. ( 4).In order to obtain a more explicit expression for t θ , we focus on two simple cases where the asymptotic behavior of q 1 can be analytically studied.
We first review the case where steps are all of equal height: p k = p s δ(s−k) (e.g.p 1 = 0) and r is a multiple of s i.e. there exists q such that r = qs.Then the situations amounts to the case considered in the section B 2 a, with the substitution r ← q and p 1 ← p s .
The second case relies on the hypothesis that p 1 > 0. The set of indexes that maximizes the exponent j u in Eq. (B8) under the constraint that r m=1 mj m = j is (j, 0, . . .0).Moreover, j = r − 1 maximizes the exponent j u = j 1 = j.At the leading order in t, Eq. (B8) reads which is identical to Eq. (B3), and leads to the scaling Eq. (B7), and which therefore proves Eq. ( 11).

Multi-colored images
Our results are readily adaptable to the case of a colored image, i.e. resulting from the combination of several channels of light emission produced by different imaging probes.This technique is frequently used in cell biology to image simultaneously actin, myosin and other proteins [45].The number of distinct types of imaging probes is denoted C ; the number of pixels that contain the j-type probe is denoted F j ; the probability (per pixel and per frame) to detect an imaging probe is denoted p 1,j .The estimators F (t) j are defined similarly to Eq. ( 3).The imaging time is now defined by the rela- Assuming that the imaging probes act independently, the imaging time t θ (with C colors) is given by the relation: The imaging time defined in Eq. (B10) exhibit a coupon collector scaling in the following two situations: (i) if the emission probabilities are identical for all probes (i.e.p 1,j = p 1 ), the expression from Eq. ( 7) holds after the substitution of (a) F by F 1 + . . .+ F C , and (b) µ by µ = µ 1 + . . .+ µ C , which corresponds to the total number of events per frame.Therefore, if we further assume that F j = F for all j, we show that the imaging time exhibits a coupon-collector type behavior (CF ln(CF )) in terms of total number of pixels CF .
(ii) if one channel is characterized by a weak blinking probability compared to all the other probes (e.g.p 1,1 p 1,j for all other j, then it will likely be the limiting factor in the imaging process, in which case Eq. ( 7) holds after the substitution of F and p 1 by F 1 and p 1,1 .

Inhomogeneous field of view
We first consider the case in which at most one observation per pixel and per frame can occur.We suppose Following the method presented in the final section in the main text, we propose an estimator of the risk that the image is not complete, based on the collected information after t frames.In particular, we provide an estimate of the additional number of frames that should be taken to obtain a complete image at a given confidence ( t (t) θ ).This estimator rely on the current covered area of the experimental realization S (t) , which corresponds to a maximum-likelihood estimator of the volume of the  structure to be imaged.We assume that the covered length F (t) is well described by the mean covered area at time t, hence that P (t) S (t) = S ≈ P S(1−e −σt/S ) [0 gap] , where P S(1−e −µσt/S ) refers to the probability defined in Eq. (C2), that the total area to be covered is S 1 − e −µσt/S .We test the method on Fig. SI.7a, in a case where the ratio S/σ is known, and we find that the approximation of Eq. (C5) is very satisfactory.Following the procedure defined in Sec.V, we estimate the additional number of frames required to obtained a complete image, which can be deduced from Eq. ( 1), through the substitution of S and µ by their corresponding estimators.
Appendix D: Calculation of the minimum number r of observations per pixel In this section, we justify that a large number of observations is required per pixel to obtain a reliable measurements of the electromagnetic field considered in Ref. [30].We recall that the experimental data consists in 2792 measurements of heights and intensities (Z i , I i ) (i ≤ 2792).We model the noise on the height measurement through the following linear Gaussian model: where η is a standard Gaussian white noise process.We define the vector of unknown parameters B = β(−1, ln I 0 ), where β refers to the penetration length and I 0 to the intensity at the surface, as well as Y = √ I i Z i  (vector of observations) and X = ( √ I i ln I i , √ I i ) (explicative matrix).In terms of these quantities, the model defined in Eq. (D1) reads Y = XB + ση, which corresponds to the well-known linear Gaussian model.The estimator of the vector B that maximizes the likelihood function is B n = (X T X) −1 X T Y [46] ; the developed ex-

Figure 1 :
Figure 1: (Color online) Structural reconstruction by stochastic super-localization microscopy.Probes (colored dots) are bound to a structure of interest (green line).(a-b) Circular patches representation: (a) Upper left inset: Abel diffraction pattern observed in a CCD camera.The super-resolution algorithm yields a set of coordinate corresponding to the center of the pattern (black cross).In the patch method representation, each point coordinate is represented by a disk with a radius σ that is proportional to the uncertainty of the superlocalization procedure (blue disk).(b) Patches accumulate with the acquisition time, eventually covering the whole structure of interest (patches are represented by different colors for separate time frames).(c-f) Box-filling representation, which leads to a density map in terms of a number of accumulated events per pixel.(c) The field of view is divided into N = 9 pixels among which F = 5 pixels contain probes.(d) A sequence of frames (blue circle: size of the Abel pattern).(e) Target image.(f) Map of the cumulative number of observations M (t)

Figure 2 :
Figure 2: (Color online) PALM imaging of the actin mesh within a fibroblast cell.(a) Image obtained by representing detection events as circles of radius 5nm (i.e.patch method).(b) Density plot, in which the field-of-view is divided into 100 × 100 pixels of width x nm.(i.e.box-filling method).(c-d) Zoom on the cell boundary plot, which reveals three regions defined according to the density of observations: low (above red line), intermediate (below black line) and high (between the two lines).(d) Low density filtering: only pixels which have collected more than r = 30 observations are represented, to isolate the region of interest (i.e.actin fibers at the boundary).Mind that r represents the number of redundant observation required to separate a region of interest from a noisy background.

Figure 3 :
Figure 3: (Color online) Schematic view of the stochastic Brownian TIRM technique and its modeling.(a) Global view of the total field of observation, divided into F pixels (BFM framework).(b) Zoom on pixel 3, including a particle labelled by the frame instant.After t ≥ 6, the probe is not detected again.(c-d) Scheme of the evolution of the cumulative number of observations M (t) 3

Figure 4 :
Figure 4: (Color online) Centile t0.05 of the image completion time as a function of the required number of redundant observations per pixel r.(a) Simulations with at most one observation per pixel and per frame, F = 15 and p1 = 0.1.The analytical expression from Eq. (8) (solid blue line) provides a better fit of simulations (red error bars, obtained by bootstrapping [43]) than the approximate solution from Eq. (13) (black circle) .(b) Comparison of our theoretical expression to the TIRM experiments from [30], with F = 15: (red error bars) centile estimation from the experiments; (blue solid line) theoretical prediction from Eq. (8) with a jump probability distribution p k ∝ exp(−k/kc) with kc = 2.9; (green crosses) stochastic simulations.(c-d) PALM imaging of a silicon wafer with quasi-uniform coating in fluorophores (the ROI corresponds to the whole field of view, with N = F = 100).(c) Non-uniform fluorophore density leads to spatial heterogeneities in p0, i.e. the probability per frame that a pixel does not collect any observation: the experimental distribution (blue boxes) is fitted by a Gaussian (dashed red line).Inset: field of view in terms of the number of collected observations per pixel.(d) Centile t0.05 for (blue and red) two distinct samples with identical concentration of fluorophores: (solid lines) analytical expression and (error bars) experimental result.
Figure 4: (Color online) Centile t0.05 of the image completion time as a function of the required number of redundant observations per pixel r.(a) Simulations with at most one observation per pixel and per frame, F = 15 and p1 = 0.1.The analytical expression from Eq. (8) (solid blue line) provides a better fit of simulations (red error bars, obtained by bootstrapping [43]) than the approximate solution from Eq. (13) (black circle) .(b) Comparison of our theoretical expression to the TIRM experiments from [30], with F = 15: (red error bars) centile estimation from the experiments; (blue solid line) theoretical prediction from Eq. (8) with a jump probability distribution p k ∝ exp(−k/kc) with kc = 2.9; (green crosses) stochastic simulations.(c-d) PALM imaging of a silicon wafer with quasi-uniform coating in fluorophores (the ROI corresponds to the whole field of view, with N = F = 100).(c) Non-uniform fluorophore density leads to spatial heterogeneities in p0, i.e. the probability per frame that a pixel does not collect any observation: the experimental distribution (blue boxes) is fitted by a Gaussian (dashed red line).Inset: field of view in terms of the number of collected observations per pixel.(d) Centile t0.05 for (blue and red) two distinct samples with identical concentration of fluorophores: (solid lines) analytical expression and (error bars) experimental result.

Figure 5 :
Figure 5: (Color online) Centile t θ of the image completion time as a function of the required number of events per pixel in the regime r ≥ ln(F ).(a) Simulations with at most one observation per pixel, F = 15 and p1 = 0.1: (red cross) centile from stochastic simulations; (solid green line) approximate solution from Eq. (13); (blue circles) exact centile time obtained by numerical inversion of Eq. (12).(b) TIRM experiments from Ref.[30], with F = 4: (red bars) centile estimation from experiments, where the error is estimated by bootstrapping[43]; (black dots) theoretical prediction from Eq. (13).

FFigure 6 :
Figure 6: (Color online) Numerical simulation of the real-time imaging method (Sec.V), where the total number of pixels is F = 100, the probability of an event observation per frame and per pixel is p1 = 10 −2 , averaging is performed over 10 4 samples.(a) Histogram of the values of the estimator F (t) after a number t = 50 of observations (light orange) and t = 300 (dark blue); (red vertical line) the limit value is F = 100.(b) Histogram of the values of the estimator t0.05 (t) after a number t = 50 of observations (light orange) and t = 300; (red vertical line) the limit value is t0.95 = 760.(c) Evolution of the mean value of the estimator F (t) (solid blue curve), together.We also represent the probability P ( F (t) = F ) for the image completion (solid magenta curve).In both cases, error bars indicate the standard deviation estimated from the random sampling.Hence a single random realization (i.e. a single experiment) is sufficient to obtain a good estimate of F (t) and P ( F (t) = F ).(d) Probability distribution for the estimator

Figure 7 :
Figure 7: (Color online) (a) Probability of the full coverage of a circle of circumference S by a number of t of patches (arcs segments) of size σ/S = 10 −2 : (blue solid line) mean covered area Y (t) after t-frames (with 1 event per frame) ; (orange line) exact probability of a full coverage at time t from Eq. (C2) (black circles) estimated probability for a full coverage at time t, as constructed from the mean covered area Y (t) , from Eq. (C5).(b) Evolution of the centile of the image time as a function of the ratio of the volume covered at each localization event (σ) by the total volume of the field of view (S).

Figure 8 :
Figure 8: (Color online) Analysis of the experiments from Ref. [30] using the Gaussian model defined in Eq. (D1).(a) Density representation of the experimental data: measured scattered intensity Ii as a function of the measure height Zi: (colormap) experimental number of observations per boxes (red line) linear regression for ln(I) in terms of z.(b) Residual analysis and validation the linear Gaussian model: we verify that residual Ri = √ IiZi + √ Ii ln(Ii/ I0 n )) is centered (red line) and maintains a constant variance (red box) with the intensity I obs .