# Event-based hyperspectral EELS: towards nanosecond temporal resolution

Yves Auad<EMAIL_ADDRESS>Michael Walls  Jean-Denis
Blazit  Odile Stéphan  Luiz H. G. Tizei  Mathieu Kociak  Francisco De la Peña
Marcel Tencé<EMAIL_ADDRESS>Laboratoire des Physique
des Solides, Université Paris Saclay, Orsay, France  Unité Matériaux et
Transformations, Université de Lille, Lille, France

###### Abstract

The acquisition of a hyperspectral image is nowadays a standard technique used
in the scanning transmission electron microscope. It relates the spatial
position of the electron probe to the spectral data associated with it. In the
case of electron energy loss spectroscopy (EELS), frame-based hyperspectral
acquisition is much slower than the achievable rastering time of the scan unit
(SU), which sometimes leads to undesirable effects in the sample, such as
electron irradiation damage, that goes unperceived during frame acquisition.
In this work, we have developed an event-based hyperspectral EELS by using a
Timepix3 application-specific integrated circuit detector with two
supplementary time-to-digital (TDC) lines embedded. In such a system, electron
events are characterized by their positional and temporal coordinates, but TDC
events only by temporal ones. By sending reference signals from the SU to the
TDC line, it is possible to reconstruct the entire spectral image with SU-
limited scanning pixel dwell time and thus acquire, with no additional cost, a
hyperspectral image at the same rate as that of a single channel detector,
such as annular dark-field. To exemplify the possibilities behind event-based
hyperspectral EELS, we have studied the decomposition of calcite (CaCO3) into
calcium oxide (CaO) and carbon dioxide (CO2) under the electron beam
irradiation.

###### keywords:

electron microscope; electron energy-loss spectroscopy; event-based; hybrid
pixel direct detector; timepix3

††journal: Ultramicroscopy

## Introduction

The scanning transmission electron microscope (STEM) works by rastering a
focused electron beam on a sample. The image formation is usually performed by
the single-channel annular dark field (ADF), bright field (BF), or annular
bright-field (ABF) detectors. As the transmitted electrons carry spectral
information from the sample, the focused electron probe makes STEM an
interesting tool for performing electron energy loss spectroscopy (EELS) with
high spatial resolution [1, 2, 3, 4]. Data is usually acquired in the form of
a hyperspectral image, a data cube indexed by one energy and two spatial
coordinates.

One of the main concerns when performing EELS is that the energy-momentum
transferred during the inelastic scattering of the electron may cause
undesired effects in the sample, such as knock-on displacement, induced
heating, and radiolysis [5, 6]. Several approaches have been proposed to
diminish them, such as custom scan paths and fast scans combined with data
reconstruction algorithms [7, 8, 9, 10]. Although effective, these solutions
are limited by the frame-based nature of the acquisition systems, which have a
minimum acquisition time given by the readout time, typically of a few
milliseconds for charge-coupled device (CCD) cameras, for example.

Up until now, frame-based detectors have been the usual solution for EELS
acquisition. These count the number of electron hits in a given dwell time
indiscriminately and thus the temporal information is limited by the spectrum
acquisition time, as shown in Figure 1a. CCDs and complementary
metal–oxide–semiconductor (CMOS) are the most widespread frame-based detectors
for EELS [11, 12]. For both detectors, a scintillator and an array of optical
fibers are typically used to convert the incident electrons into photons.
These detectors have a variety of noise sources, such as dark and readout
noises, and can dramatically degrade the spectral resolution due to the
increased point-spread-function (PSF) imposed by the scintillator layer. A
second kind of electron detection uses hybrid pixel detectors (HPDs), in which
the sensor layer and the readout chip (also called application-specific
integrated circuit or ASIC) are manufactured independently from each other.
Multiple successive generations of ASICs led to the spread of HPDs in many
different research subjects, such as space dosimetry [13], synchrotron source
imaging [14, 15], X-Ray spectroscopies [16, 17] and electron microscopy,
including diffraction [18, 19], imaging [20, 21, 22, 23] and EELS [24, 25].
One of the most successful ASICs, the Medipix3, introduces several
improvements with respect to CCDs and CMOS for EELS acquisition. These include
the practically zero readout noise, the improved PSF due to the direct
electron detection and the readout time as low as $\sim$ 500 $\mu$s [26].
Despite their improved acquisition speed, the problems related to frame-based
acquisition persist because scanning pixel time in a STEM can go as low as
tens of nanoseconds. This is much faster than the readout time of any
commercially available frame-based detector.

A different concept of hyperspectral data acquisition for EELS can be defined
when electrons are individually counted and can be unequivocally placed in the
corresponding spectral and positional coordinates of the data cube. For
example, one can consider a fast rastering electron beam with 0.5 $\mu$s pixel
time. In such a time interval, for a probe with $\sim$ 50 pA only $\sim$ 150
electrons would hit the sample, most of them falling in the zero-loss peak
(ZLP). For a single-pixel acquisition, there would not be enough electrons to
produce a usable EELS spectrum. However, continuously scanning and adding the
electrons in an event-based fashion can lead to a meaningful reconstruction of
the data cube. We show such a scheme in Figure 1b. The $\Delta t$ shown is a
typical frame-based acquisition time ($\sim$ 1 ms). For the event-based
acquisition, the SU rasters a great number of pixels within the time interval
$\Delta t$ that would be needed to collect a spectrum in the frame-based
approach. Of course, contrary to the frame-based approach, the arrival time of
each of these hits is known with a precision much better than $\Delta t$.
Also, during $\Delta t$, one acquires electron hits from different points of
the data cube in space. One must therefore relate a given electron hit with
the corresponding probe position to construct a hyperspectral image. In this
case, hyperspectral images can be acquired with very fast scanning pixel dwell
time and thus synchronously with the normal ADF imaging without any
performance penalty.

Figure 1: Comparison between frame-based and event-based hyperspectral
acquisitions. (a) In the frame-based hyperspectral image reconstruction, the
entire spectral dimension is acquired for each electron probe position. The
minimum exposure time is given by the camera readout time, typically in the
millisecond range for CCDs. (b) The event-based reconstruction places each
electron in its corresponding data cube position when an electron hit is
detected. Because of this, the electron beam can be rastered as fast as the
time resolution of the event-based camera, typically in the nanosecond range.
In both cases, the cube color code represents a typical acquisition time of a
frame-based measurement ($\sim$ 1 ms). In such a time window, the scan unit
can raster a great number of pixels. Figure 2: The hyperspectral data
reconstruction process. (a) The scheme of the system used for data
acquisition. The scan unit inputs temporal supplementary events, while
individual electrons produce positional and temporal events. (b) We exemplify
how the temporal information of both electrons and supplementary events can be
used to arrange electrons in the reconstructed hyperspectral spatial data ($x$
and $y$). Detector-pixel address information ($\alpha$ and $\beta$) is used to
determine the spectral information of each spatial pixel.

In this work, we demonstrate the implementation of this concept for EELS,
similarly to what was recently demonstrated for event-driven 4D STEM
acquisition [27]. Although there is a mention to a event-based hyperspectral
image in the literature in the context of EELS-EDX coincidence experiments
[28], the aforementioned study does not discuss the methodology nor the
benefits of the time-resolved capability for time-dependent processes. We show
that probe position and electron hit can be related to the temporal dimension
by using an electron detector capable of outputting such information. We start
by explaining details of the event-based hyperspectral EELS implementation,
describing, in particular, the Timepix3, the direct electron detector used
throughout this paper, and the related features of the used readout board,
called SPIDR (Speedy Pixel Detector Readout), that allowed us to produce
supplementary events from the Scan Unit (SU) superimposed on the data flow of
the electron events. To illustrate the problem, we show an event-based
hyperspectral acquisition using 120 ns pixel time sampled over 512 x 512
pixels. The last part of the paper is dedicated to the application of this
system to follow the decomposition of calcite (CaCO3) into calcium oxide (CaO)
and gaseous carbon dioxide (CO2) under electron beam irradiation.

## Event-based hyperspectral EELS implementation

To implement the event-based hyperspectral EELS, we have used a Timepix3
(TPX3) detector. In its first version, Timepix was a simple modification of
Medipix2, allowing one to increment the pixel counter by clock ticks instead
of the number of events since a reference clock was distributed on each one of
its pixels. Timepix had thus the old functionality of counting hits but also
the option of outputting either time of arrival (ToA) or time over threshold
(ToT) values [29]. The former measures the time elapsed until a hit is
detected, while the latter measures the time the hit stays over the pixel
signal threshold. Its successor, the ASIC TPX3, was the first real data-driven
detector in the entire Medipix/Timepix family, as a pixel hit is responsible
for triggering data output from the chip. A voltage-controlled oscillator
running at 640 Mhz allows TPX3 to achieve a nominal temporal resolution of
1.5625 ns (called fine ToA) and, in contrast with the first Timepix
generation, can simultaneously provide ToA and ToT [30, 31]. When TPX3 is used
in EELS, therefore, we have access to each electron’s positional coordinates
(the dispersive and non-dispersive directions) and the temporal coordinates,
represented here by both ToA and ToT. To reconstruct the hyperspectral image,
one must find a way to correlate the temporal information of the electron
events with the electron probe position. One approach is to feed the SU
reference clock signal into TPX3, which would require flexible and
programmable SUs and TPX3 control boards. Our solution is to create
supplementary events in the TPX3 data flows, effectively having two distinct
kinds of events: one linked to individual electrons and another to reference
timestamps of the microscope probe position.

For the development of our application, we have used the TXP3 solution by
Amsterdam Scientific Instruments (ASI), called Cheetah, which includes the
SPIDR board [32] and the control software. Our detector consists of four
256x256 chips mounted linearly adjacent to each other to form a 256x1024-pixel
array. In the following, the dispersive direction of the detector is denoted
as $\alpha$ and the non-dispersive $\beta$. Also, the Cheetah provides us with
two supplementary input time-to-digital converter (TDC) lines that run the
same clock as the 40 Mhz reference clock and can reach a nominal temporal
resolution of $\sim$ 260 ps. The SPIDR can detect TTL-based rising and falling
edges in the TDC and includes them in the data flow in the same way it is done
for electron events. We have used a custom-made SU solution that is based on a
25 Mhz clock and can scan as fast as 40 ns per pixel [7]. To synchronize the
SU and the SPIDR clocks, the SU sends reference signals (what we call
supplementary events) to the Cheetah, as demonstrated in Figure 2a. They
contain only timestamps and can be represented by any input signal that can be
used to unequivocally determine the electron probe position $(x,~{}y)$.
Although theoretically one could use a single signal indicating the start of
the rastering, sending periodic reference signals allows to correct clock
drift, which is especially important for long ($>$10 s) acquisition times. In
our case, we have used the beginning of a new scan row ($y$ direction) as a
trigger falling edge, while the end of a line is represented by a rising edge.
The difference between a falling and a rising edge is the scanning flyback
time setting.

The complete hyperspectral reconstruction principle is shown in Figure 2b,
which depicts the timeline of the occurring events. For clarity, electron
events $e_{n}$ are further subdivided into $E_{n}=e_{n}(t)$ and
$\varepsilon_{n}=e_{n}(\alpha,\beta)$ to explicitly indicate what information
we have used in each step of the reconstruction. As the received supplementary
event S(t) relates to the beginning of a new scan row, the number of columns
($x$ direction) must be known by the software. This value is used as the
number of time bins between a supplementary falling event and a successive
rising event, as shown at the top in Figure 2b. As an example, we can see that
electrons $E_{1}$ and $E_{2}$ are in the same row because they are both after
$S_{1,fall}$ but are in different columns because they are in different time
bins within the scan row. It is important to note that electron placement in
the hyperspectral spatial pixel ($x$ and $y$) is only dependent on time. The
pixel address of the electron event, $\varepsilon_{n}$, is only used to form
the hyperspectral signal ($\alpha$ and $\beta$), as shown in Figure 2b at the
bottom left by $\varepsilon_{6}$. Additionally, the rising edge trigger input
by the SU indicates the end of a scan row, meaning the high digital signal
corresponds to the flyback of the electron probe; any electron event that
arrives during this time interval is rejected, as illustrated by $E_{5}$. As a
final remark, it is important to clarify that the time $t$ in $E_{n}=e_{n}(t)$
is simply the electron ToA corrected by the fine ToA, having a nominal
temporal resolution of 1.5625 ns. Note also that the multiple electron-hole
pairs created by a single impinging electron create multiple detector hits,
called clusters. To circumvent the problem of multiple event counting due to
clusters, a cluster-correction algorithm was implemented in our application.
It must use both the temporal and the spatial information of adjacent electron
hits to be effective and is explained in detail later in this work.

Figure 3: Energy-filtered hyperspectral image containing 512 x 512 pixels and
using 120 ns pixel time between 5 eV and 45 eV for a sample of silver nano-
cubes drop-casted over a thin amorphous carbon film. The ADF (top left) and
three images (1, 2, and 3, at the top) and the corresponding spectra acquired
inside the highlighted yellow square (8 x 8 pixels) taken after 64, 508, and
2415 complete ADF frames show the time evolution and the event-based nature of
hyperspectral data formation.

We have also developed a live acquisition program coded in Rust [33] capable
of translating the received events by the TPX3 to a variety of outputs,
including the hyperspectral image illustrated in Figure 2. The software can be
controlled in a user interface plugin [34] developed for the Nionswift
software [35], which is also used for data acquisition. Other software
features include the acquisition of single spectra, which uses the period of a
TTL signal in the TDC line to determine the spectrum dwell time. Both the
live-processing and the plugin are open-source and are available to the
community under MIT licensing. The processed data is transferred by
transmission control protocol (TCP) using a 10-Gbit optical fiber from the
dedicated processing computer to the client computer. For a single spectrum,
data is transferred in its entirety (1024-sized array for fully-binned
measurements and 1024x256-sized for image measurements) with configurable bit
depth to accommodate a high range of acquisition times. For the hyperspectral
image, one must note that for a 512 x 512 image with 120 ns pixel time, an
entire 512 x 512 x 1024 hyperspectrum is simultaneously reconstructed with the
ADF, although very sparse. The transfer rate would need to be $\sim$ 140
Gbit/s (using a 16-bit integer) which is much higher than the transfer limit
of the 10-Gbit Ethernet. In such cases, data can be transferred more compactly
by sending a list of indices to be incremented in the datacube. As an example,
for a hyperspectrum containing 64 x 64 spatial pixels, and considering the
1024 pixels in the detector row, these indices must be between 0 and 4194304.

Figure 3 shows an initial example of a live hyperspectral reconstruction.
Pixel dwell time was kept at 120 ns in a 512 x 512 spatial sampling with a
current at the sample of approximately 8 pA from a region of approximately 1.0
$\mu$m2. The flyback time is measured as $\sim$ 28.5 $\mu$s by the TDC and
thus a single frame takes approximately 46.1 ms to acquire. The sample
contains some silver nano-cubes drop-cast onto a thin film of amorphous
carbon. At the top, the ADF image obtained during data acquisition and three
snapshots for different accumulation times of the energy-filtered
hyperspectrum between 5 eV and 45 eV, comprising the strong carbon plasmon
resonance peaked at approximately 22 eV. At the bottom, we display the
spectrum for the 8 x 8 pixel cell highlighted by the yellow square. In the
first 2 s of acquisition, 43 complete ADF frames are accumulated and a minimal
contrast shows up in the energy-filtered image. After 16 s and 76 s of
acquisition (corresponding to, respectively, 347 and 1649 frames), the
contrast is greater and the plasmon resonance is much more distinguishable.

## Study of calcite decomposition

In order to demonstrate our event-based hyperspectral image, we have used a
calcite (CaCO3) sample and explored its well-known transformation to calcium
oxide (CaO) and carbon dioxide (CO2) under the electron beam irradiation
(CaCO3 $\xrightarrow{e^{-}}$ CaO + CO2) [36, 37, 38]. The experiment was
performed in a Vacuum Generators HB501 at 100 kV equipped with an LN2 cold
stage that stays at approximately 150 K. The acquired data had 4 $\mu$s pixel
time with the 32 nm x 32 nm region sampled by 32 x 32 pixels. The convergence
angle was 15 mrad and a collection aperture of $\sim$ 2 mrad was used to have
both an improved spectral resolution and to produce a non-saturated EELS
dataset. The electron spectrometer was set to a low dispersion of $\sim$ 0.445
eV/pixel to monitor simultaneously the low loss region, the carbon K edge, and
the calcium L2,3 edges. In these conditions, one ADF image, and therefore one
hyperspectral image, is completed every $\sim$ 5 ms. Such a rate is comparable
with that of a single energy-filtered transmission electron microscope (EFTEM)
image, although in the present case the whole spectral range is gathered. The
collected signal is extremely low at these rates, as the dwell time for the
acquisition of each pixel’s spectrum is $\sim 4~{}\mu s$, and some time-
binning is needed for interpreting the data. Therefore, the total of 93 s of
the acquisition was sliced into 232 hyperspectral images with intervals of 400
ms, which corresponds to roughly 80 complete ADF frames and an exposure time
per pixel of 320 $\mu$s. As we shall see, this temporal sampling is enough to
unveil the calcite decomposition dynamics in the low-loss energy range. Data
analysis in this work was done using the Hyperspy package [39].

Figure 4: Impact of the cluster-correction algorithm in the EELS data. (a) The
normalized frequency of the summed ToT before and after cluster correction.
(b) The electrons inter-arrival times for the uncorrected, cluster-corrected
and cluster+ToT-corrected data. Fitting was performed for the latter and
provided an expected number of occurrences of $\lambda$ $\sim$ 2072
electrons.ms-1, corresponding to a current in the detector of $i_{det}$ $\sim$
0.334 pA.

Before examining the data set, we used a custom-developed algorithm to
identify and treat clusters from our hyperspectral time slices. To do so, both
ToA and the pixel hit position are used: the set of pixels within a single
cluster is counted as a single event carrying the average ToA and pixel impact
position. A new cluster is created if the next electron event has a ToA
superior to the previous one by $>$ 200 ns or if the pixel distance is $>$ 2
pixels in any of the $\alpha$ or $\beta$ directions independently (see
Supplementary Material (SM) for further details on different parameters).
Figure 4 shows the impact of cluster treatment on our EELS hyperspectral data.
In Figure 4a, we have plotted the histogram of the ToT for all pixel hits
before the cluster correction (orange curve) and the histogram of the sum of
the ToT of all the pixel hits that belong to a single cluster (blue curve). A
Gaussian fit to the distinct peak shown in the cluster-corrected data gives us
an average value of $\sim$ 139.13 ns and an equivalent full-width-half-maximum
(fwhm) $\Delta$TToT = 22.65 ns, which is under the clock tick of 25 ns. In
such a case, ToT-based spectroscopy has a resolution of approximately 16.18
keV and hence is difficult in the typical EELS range ($<$ 1 keV). In Figure
4b, we have plotted the time difference between consecutive events, called
inter-arrival times (ITs), for the same electrons as in Figure 4a. A
consequence of the independence of the events in a Poisson process is that the
number of events as a function of the observed IT follows an exponential decay
$e^{-\lambda t}$, where $\lambda$ is the expected rate of occurrences in the
Poisson process. The uncorrected curve (light red) seems to be properly
following an exponential decay for ITs longer than 100 ns but has a steep
increase of approximately two orders of magnitude for ITs shorter than 50 ns.
Additionally, the uncorrected curve presents oscillations in the observed ITs,
which is also a consequence of the multiple detected hits per electron and the
inability to determine the proper effective electron hit time. After cluster-
correction (light blue curve), the curve approximates to an exponential
behavior for shorter times, despite a still visible deviation for ITs $<$ 25
ns. Additionally, we also show (light orange curve) the IT for the electrons
in which their cluster total ToT is between 60 and 220 (gray rectangle in
Figure 4a), which follows a much-closer exponential behavior for short ITs. As
it is discussed in the SM, identified clusters with small total ToT are
primarily formed in between Timepix3 chips and thus might be subjected to a
different cluster formation dynamics. Finally, the current in the detector
estimated by the number of hits after cluster + ToT correction is 0.322 pA.
The fitting result (dashed line) gives $\lambda$ $\sim$ 2072 electrons.ms-1,
which corresponds to a current of $\sim$ 0.334 pA and agrees within 96% with
the electron hit estimate. Note that the Poisson statistics of the electrons
are indicative of the non-saturated regime of electron detection.

Figure 5: Typical acquisition conditions. (a) ADF images at approximately 25 s
of acquisition time (left) and at the end of the acquisition after 93 s
(right). (b) Typical EELS spectrum for a single pixel in a single time slice,
showing a fwhm of 2 pixels. Figure 6: Hyperspectral EELS results for the
calcite decomposition in the low-loss energy range. (a) Two energy-filtered
snapshots centered at $E$ = 13 eV accumulated in the energy internal $\Delta
E$ for the time slices at $T_{1}$ = 30 s and $T_{2}$ = 45 s summed over the
time interval $\Delta T$ = 400 ms. The time evolution for two pixels (Pos1 and
Pos2) is also shown. (b) Similar to the snapshots in (a), but for a time
interval of 100 ms (top) and 1600 ms (bottom). Figure 7: Hyperspectral EELS
results for the calcite decomposition in the core-loss energy range for the
entire sample region. (a) Time evolution around the C-K edge at the left
while, at the right, we display around the calcium L2,3 edges. (b) The ratio
between C-K edge (286 eV - 305 eV) and the calcium-L2,3 (343.5 eV - 351.0 eV).
The diminishing proportion indicates that despite sample mass-loss, carbon
content is reducing with respect to calcium.

Figure 5a displays one snapshot of the ADF at $\sim$ 25 s of acquisition time
(left), which already shows a contrast due to the accumulated sample damage.
The ADF at the right shows a higher field-of-view image after the entire 93 s
of acquisition. Figure 5b shows a typical single-pixel spectrum in one time
slice (320 $\mu$s pixel exposure time), displaying a ZLP with a maximum number
of $\sim$ 60 electron hits and a fwhm of 2 pixels, a consequence of the
improved point-spread-function of direct electron detectors [24].

Figure 6a shows a few results from the time-resolved hyperspectrum after
running the cluster-correction algorithm in the data set. Two energy-filtered
images centered at the plasmon resonance feature at $\sim$ 13 eV, indicated as
$\Delta E$ and associated with the CaO formation [37, 38], are shown at the
left for two distinct times ($T_{1}$ and $T_{2}$) within the same time
interval $\Delta T$ = 400 ms and thus depicts the CaO formation dynamics
within $\pm$ 200 ms time resolution. The EELS spectra as a function of the
total elapsed time for the pixel Pos1 (yellow square) and Pos2 (green square)
are shown at the right. Note how Pos2 is farther from where CaO formation
starts and hence the transformation is triggered at a later time than at Pos1.
There is a clear transformation in the low-loss spectra, most notably around
the aforementioned resonance at $\Delta E$, successfully captured by the time-
binning chosen. In Figure 6b, we show a similar energy-filtered snapshot, but
with time intervals of 100 ms and 1600 ms, demonstrating that the time-binning
value can be arbitrarily picked as long as it is a multiple of a single scan
image.

In Figure 7a, we show similar spectra for the core-loss energy range around
the Carbon-K edge and the Calcium L2,3 edges for the entire sample region. In
Figure 7b, we display the sum of the normalized signal between 286 eV and 305
eV (comprising thus the C-K edge) divided by the signal between 343.5 eV and
351.0 eV (Ca L2,3). To have a better signal-to-noise ratio (SNR), time slices
were binned by a factor of 8 (and thus have a time resolution of $\sim$ 3.2
s). The smaller proportion of carbon with respect to calcium over time
suggests the calcite decomposition is happening and, consequently, carbon
content is reducing in the system.

To extract more spectral information from the calcite decomposition dynamics,
one could further increase the time interval of the hyperspectral slices,
sacrificing time resolution for more signal per spectrum. More interesting,
however, is to perform a low-rank approximation, such as singular value
thresholding (SVT), a.k.a. PCA (principal component analysis), which can
increase the signal-to-noise ratio [40, 41] without sacrificing time and
spatial resolution. Figure 8 shows the result of SVT of the dataset with 3
components for a single spatial position close to the yellow square (Pos1)
highlighted in Figure 6. The time evolution shows the progressive reduction of
the carbon content, followed by a more and more pronounced crystal field
splitting of the $t_{2g}$ and $e_{g}$ peaks in the Ca L2,3 edge due to the
undistorted octahedral symmetry and change in length of the Ca-O bonds in CaO
compared to CaCO3 [38]. The SVT was performed with the ZLP and the pixels
close to the chip edges masked. The raw spectra associated are also shown in
Figure 8 by the dashed superimposed curve for the same pixel as the SVT data,
and by the dotted curve for the spatially binned 32x32 spectrum, which
highlights the impressive potential of SVT denoising for such low-signal time-
resolved datasets. Finally, note that although the time slice interval has the
unbinned value of 400 ms, single-pixel exposure time is $\sim$ 320 $\mu$s.

Figure 8: Set of spectra for a single pixel close to Pos1 for four different
times after SVT denoising (solid curve), for the pixel raw data associated
(dashed curve), and for the 32x32 binned raw data (dotted curve). Carbon
content is progressively reduced, while the crystal field splitting,
associated with the Ca-O bonds, increases. Time slices are within the unbinned
time interval of 400 ms and exposure time, per pixel, is 320 $\mu$s.

## Conclusions and perspectives

In conclusion, we have presented the acquisition of a hyperspectrum with
scanning speed limited by the SU rastering time instead of the detection
system. We have used a commercial event-based TPX3 solution along with an also
commercially available custom-made scan engine [42] in which external events
from the SU add timestamps in the electron data flow that can be later used to
retrieve the electron probe position. For this reason, we refer to our
approach as event-based hyperspectral EELS. All the developed software is
available to the community, including the live data processing [33] and the
interface plugin [34], and thus any SU capable of outputting the scan clock
signal along with the Cheetah solution could be used to reproduce this work.
To demonstrate our system capabilities, we have given as an example the
decomposition of calcite into CaO and CO2 under electron beam irradiation.
After cluster correction and ToT correction, electron arrival times follow a
Poisson distribution, which shows both the well-known statistics of the
electron emission in a cold field emission gun (cFEG) and the non-saturated
regime of the data acquisition. In principle, hyperspectral images can be
acquired with pixel times as low as 1.5625 ns (nominal temporal resolution of
TPX3), although reaching this scan rate would need further TPX3 calibrations
[43, 44] that are irrelevant for our minimum rastering time of 40 ns. In TPX3,
data can be saturated by the pixel dead time, by the column readout scheme,
and by the detector maximum throughput. As the ZLP is focused in a single
detector column, applications in which a meaningful ZLP intensity is required
might be restricted to detector currents up to 1-2 pA, although tilting the
detector/electron beam or custom pixel-line masking might alleviate this
problem. The maximum detector throughput corresponds to currents up to 10-15
pA, which can also limit the detector applications. Improvements in the near
future for all these aspects are expected with the new Timepix4 detector [45].
Time-resolved data is shown for the CaO formation in the low-loss and the
core-loss energy range. For the latter, we have achieved a single-pixel
spectrum after performing signal decomposition in the hyperspectral slices. We
believe that event-based EELS will become increasingly available in the
microscopy community. They will effectively tackle several important problems
that require both nanometric spectral resolution and nanosecond time
resolution. These include optical microresonators [46, 47, 48] thanks to their
long-lived excitations, and accessing the chemistry of electron-irradiation
sensitive materials like graphene oxide [49]. Additionally, the setup
described in this work can be used to easily reconstruct photon-electron
coincidence hyperspectral images, recently demonstrated [50].

## Data availability

The raw data used in this paper was made available in Zenodo [51]. The live
processing software developed and the Nionswift plugin interface in this work
is also available under MIT license [33, 34].

## Acknowledgements

The present project has received funding from the European Union’s Horizon
2020 research and nnovation programme undergrant agreement No 823717 (ESTEEM3)
and 101017720 (EBEAM). We thank Marta de Frutos for discussions on EELS data
analysis. Amsterdam Scientific Instruments (ASI) is also acknowledged for many
fruitful technical discussions.

## References

  * [1] P. Batson, Simultaneous STEM imaging and electron energy-loss spectroscopy with atomic-column sensitivity, Nature 366 (6457) (1993) 727–728.  doi:10.1038/366727a0.
  * [2] N. Browning, M. Chisholm, S. Pennycook, Atomic-resolution chemical analysis using a scanning transmission electron microscope, Nature 366 (6451) (1993) 143–146.  doi:10.1038/366143a0.
  * [3] J. Nelayah, M. Kociak, O. Stéphan, F. J. García de Abajo, M. Tencé, L. Henrard, D. Taverna, I. Pastoriza-Santos, L. M. Liz-Marzán, C. Colliex, Mapping surface plasmons on a single metallic nanoparticle, Nature Physics 3 (5) (2007) 348–353.  doi:10.1038/nphys575.
  * [4] O. L. Krivanek, M. F. Chisholm, V. Nicolosi, T. J. Pennycook, G. J. Corbin, N. Dellby, M. F. Murfitt, C. S. Own, Z. S. Szilagyi, M. P. Oxley, et al., Atom-by-atom structural and chemical analysis by annular dark-field electron microscopy, Nature 464 (7288) (2010) 571–574.  doi:10.1038/nature08879.
  * [5] R. F. Egerton, Electron energy-loss spectroscopy in the electron microscope, Springer Science & Business Media, 2011.  doi:10.1007/978-1-4419-9583-4.
  * [6] S. J. Pennycook, The impact of STEM aberration correction on materials science, Ultramicroscopy 180 (2017) 22–33.  doi:10.1016/j.ultramic.2017.03.020.
  * [7] A. Zobelli, S. Y. Woo, A. Tararan, L. H. Tizei, N. Brun, X. Li, O. Stéphan, M. Kociak, M. Tencé, Spatial and spectral dynamics in STEM hyperspectral imaging using random scan patterns, Ultramicroscopy 212 (2020) 112912\.  doi:10.1016/j.ultramic.2019.112912.
  * [8] A. Stevens, L. Luzi, H. Yang, L. Kovarik, B. Mehdi, A. Liyu, M. Gehm, N. Browning, A sub-sampled approach to extremely low-dose STEM, Applied Physics Letters 112 (4) (2018) 043104.  doi:10.1063/1.5016192.
  * [9] P. Trampert, F. Bourghorbel, P. Potocek, M. Peemen, C. Schlinkmann, T. Dahmen, P. Slusallek, How should a fixed budget of dwell time be spent in scanning electron microscopy to optimize image quality?, Ultramicroscopy 191 (2018) 11–17.  doi:10.1016/j.ultramic.2018.03.007.
  * [10] X. Li, O. Dyck, S. V. Kalinin, S. Jesse, Compressed sensing of scanning transmission electron microscopy (STEM) with nonrectangular scans, Microscopy and Microanalysis 24 (6) (2018) 623–633.  doi:10.1017/S143192761801543X.
  * [11] M. Strauss, I. Naday, I. Sherman, N. Zaluzec, Ccd-based parallel detection system for electron energy-loss spectroscopy and imaging, Ultramicroscopy 22 (1-4) (1987) 117–123.  doi:10.1016/0304-3991(87)90055-6.
  * [12] A. Faruqi, R. Henderson, M. Pryddetch, P. Allport, A. Evans, Direct single electron detection with a cmos detector for electron microscopy, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 546 (1-2) (2005) 170–175.  doi:10.1016/j.nima.2005.03.023.
  * [13] N. Stoffle, L. Pinsky, M. Kroupa, S. Hoang, J. Idarraga, C. Amberboy, R. Rios, J. Hauss, J. Keller, A. Bahadori, et al., Timepix-based radiation environment monitor measurements aboard the international space station, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 782 (2015) 143–148.  doi:10.1016/j.nima.2015.02.016.
  * [14] C. Ponchut, J. Clément, J.-M. Rigal, E. Papillon, J. Vallerga, D. LaMarra, B. Mikulec, Photon-counting x-ray imaging at kilohertz frame rates, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 576 (1) (2007) 109–112.  doi:10.1016/j.nima.2007.01.131.
  * [15] D. Pennicard, S. Smoljanin, B. Struth, H. Hirsemann, A. Fauler, M. Fiederle, O. Tolbanov, A. Zarubin, A. Tyazhev, G. Shelkov, et al., The lambda photon-counting pixel detector and high-z sensor development, Journal of Instrumentation 9 (12) (2014) C12026.  doi:10.1088/1748-0221/9/12/C12026.
  * [16] P. Russo, A. Lauria, G. Mettivier, M. Montesi, M. Marotta, L. Aloj, S. Lastoria, 18f-fdg positron autoradiography with a particle counting silicon pixel detector, Physics in Medicine & Biology 53 (21) (2008) 6227.  doi:10.1088/0031-9155/53/21/022.
  * [17] J. Jakubek, Energy-sensitive x-ray radiography and charge sharing effect in pixelated detector, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 607 (1) (2009) 192–195.  doi:10.1016/j.nima.2009.03.148.
  * [18] I. Nederlof, E. van Genderen, Y.-W. Li, J. P. Abrahams, A Medipix quantum area detector allows rotation electron diffraction data collection from submicrometre three-dimensional protein crystals, Acta Crystallographica Section D: Biological Crystallography 69 (7) (2013) 1223–1230.  doi:10.1107/S0907444913009700.
  * [19] E. Van Genderen, M. Clabbers, P. P. Das, A. Stewart, I. Nederlof, K. Barentsen, Q. Portillo, N. Pannu, S. Nicolopoulos, T. Gruene, et al., Ab initio structure determination of nanocrystals of organic pharmaceutical compounds by electron diffraction at room temperature using a Timepix quantum area direct electron detector, Acta Crystallographica Section A: Foundations and Advances 72 (2) (2016) 236–242.  doi:10.1107/S2053273315022500.
  * [20] G. McMullan, D. Cattermole, S. Chen, R. Henderson, X. Llopart, C. Summerfield, L. Tlustos, A. Faruqi, Electron imaging with Medipix2 hybrid pixel detector, Ultramicroscopy 107 (4-5) (2007) 401–413.  doi:10.1016/j.ultramic.2006.10.005.
  * [21] R. van Gastel, I. Sikharulidze, S. Schramm, J. Abrahams, B. Poelsema, R. Tromp, S. Van Der Molen, Medipix 2 detector applied to low energy electron microscopy, Ultramicroscopy 110 (1) (2009) 33–35.  doi:10.1016/j.ultramic.2009.09.002.
  * [22] M. Krajnak, D. McGrouther, D. Maneuski, V. O’Shea, S. McVitie, Pixelated detectors and improved efficiency for magnetic imaging in STEM differential phase contrast, Ultramicroscopy 165 (2016) 42–50.  doi:10.1016/j.ultramic.2016.03.006.
  * [23] J. P. van Schayck, E. van Genderen, E. Maddox, L. Roussel, H. Boulanger, E. Fröjdh, J.-P. Abrahams, P. J. Peters, R. B. Ravelli, Sub-pixel electron detection using a convolutional neural network, Ultramicroscopy 218 (2020) 113091.  doi:10.1016/j.ultramic.2020.113091.
  * [24] J. L. Hart, A. C. Lang, A. C. Leff, P. Longo, C. Trevor, R. D. Twesten, M. L. Taheri, Direct detection electron energy-loss spectroscopy: a method to push the limits of resolution and sensitivity, Scientific reports 7 (1) (2017) 1–14.  doi:10.1038/s41598-017-07709-4.
  * [25] B. H. Goodge, D. J. Baek, L. F. Kourkoutis, Atomic-resolution elemental mapping at cryogenic temperatures enabled by direct electron detection, arXiv preprint arXiv:2007.09747doi:10.48550/arXiv.2007.09747.
  * [26] R. Ballabriga, M. Campbell, E. Heijne, X. Llopart, L. Tlustos, W. Wong, Medipix3: A 64 k pixel detector readout chip working in single photon counting mode with improved spectrometric performance, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 633 (2011) S15–S18.  doi:10.1016/j.nima.2010.06.108.
  * [27] D. Jannis, C. Hofer, C. Gao, X. Xie, A. Béché, T. J. Pennycook, J. Verbeeck, Event driven 4D STEM acquisition with a Timepix3 detector: microsecond dwell time and faster scans for high precision and low dose applications, Ultramicroscopy 233 (2022) 113423.  doi:10.1016/j.ultramic.2021.113423.
  * [28] D. Jannis, K. Müller-Caspary, A. Béché, J. Verbeeck, Coincidence detection of eels and edx spectral events in the electron microscope, Applied Sciences 11 (19) (2021) 9058.  doi:10.3390/app11199058.
  * [29] R. Ballabriga, M. Campbell, X. Llopart, Asic developments for radiation imaging applications: The Medipix and Timepix family, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 878 (2018) 10–23.  doi:10.1016/j.nima.2017.07.029.
  * [30] X. Llopart, R. Ballabriga, M. Campbell, L. Tlustos, W. Wong, Timepix, a 65k programmable pixel readout chip for arrival time, energy and/or photon counting measurements, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 581 (1-2) (2007) 485–494.  doi:10.1016/j.nima.2007.08.079.
  * [31] T. Poikela, J. Plosila, T. Westerlund, M. Campbell, M. De Gaspari, X. Llopart, V. Gromov, R. Kluit, M. Van Beuzekom, F. Zappon, et al., Timepix3: a 65k channel hybrid pixel readout chip with simultaneous toa/tot and sparse readout, Journal of instrumentation 9 (05) (2014) C05013.  doi:10.1088/1748-0221/9/05/C05013.
  * [32] B. van Der Heijden, J. Visser, M. van Beuzekom, H. Boterenbrood, S. Kulis, B. Munneke, F. Schreuder, Spidr, a general-purpose readout system for pixel asics, Journal of instrumentation 12 (02) (2017) C02040.  doi:10.1088/1748-0221/12/02/C02040.
  * [33] Y. Auad, M. Kociak, L. H. G. Tizei, J.-D. Blazit, M. Walls, O. Stéphan, F. De la Peña, M. Tencé, Timestem/tp3_tools: Release v1.0.0 (Mar. 2022).  doi:10.5281/zenodo.6346261.
URL https://doi.org/10.5281/zenodo.6346261

  * [34] Y. Auad, Orsaydev/nslumiere: v5.24.5 release (Apr. 2022).  doi:10.5281/zenodo.6407648.
URL https://doi.org/10.5281/zenodo.6407648

  * [35] C. Meyer, N. Dellby, J. A. Hachtel, T. Lovejoy, A. Mittelberger, O. Krivanek, Nion swift: Open source image processing software for instrument control, data acquisition, organization, visualization, and analysis using python., Microscopy and Microanalysis 25 (S2) (2019) 122–123.  doi:10.1017/S143192761900134X.
  * [36] M. Tencé, M. G. Walls, C. Jeanguillaume, C. Colliex, X. Thomas, O. Jbara, J. Cazaux, EELS study of beam-induced decomposition of calcite in the STEM (09 1989).
  * [37] M. G. Walls, M. Tencé, EELS study of beam-induced decomposition of calcite in the STEM (09 1989).
  * [38] U. Golla-Schindler, G. Benner, A. Orchowski, U. Kaiser, In situ observation of electron beam-induced phase transformation of caco3 to cao via elnes at low electron beam energies, Microscopy and microanalysis 20 (3) (2014) 715–722.  doi:10.1017/S1431927614000464.
  * [39] F. de la Peña, E. Prestat, V. T. Fauske, P. Burdet, T. Furnival, P. Jokubauskas, M. Nord, T. Ostasevicius, J. Lähnemann, K. E. MacArthur, D. N. Johnstone, M. Sarahan, J. Taillon, T. Aarholt, pquinn dls, V. Migunov, A. Eljarrat, J. Caron, S. Mazzucco, B. Martineau, S. Somnath, T. Poon, T. Slater, C. Francis, M. Walls, N. Cautaerts, N. Tappy, F. Winkler, G. Donval, hyperspy/hyperspy: Release v1.6.2 (Apr. 2021).  doi:10.5281/zenodo.4683076.
URL https://doi.org/10.5281/zenodo.4683076

  * [40] R. Arenal, F. De la Pena, O. Stephan, M. Walls, M. Tence, A. Loiseau, C. Colliex, Extending the analysis of EELS spectrum-imaging data, from elemental to bond mapping in complex nanostructures, Ultramicroscopy 109 (1) (2008) 32–38.  doi:10.1016/j.ultramic.2008.07.005.
  * [41] F. de la Peña, M.-H. Berger, J.-F. Hochepied, F. Dynys, O. Stephan, M. Walls, Mapping titanium and tin oxide phases using EELS: An application of independent component analysis, Ultramicroscopy 111 (2) (2011) 169–176.  doi:10.1016/j.ultramic.2010.10.001.
  * [42] Attolight, Scanning Unit Liskamm (2022).
URL https://attolight.com/

  * [43] B. Bergmann, M. Pichotka, S. Pospisil, J. Vycpalek, P. Burian, P. Broulim, J. Jakubek, 3D track reconstruction capability of a silicon hybrid active pixel detector, The European Physical Journal C 77 (6) (2017) 1–9.  doi:10.1140/epjc/s10052-017-4993-4.
  * [44] F. Pitters, N. A. Tehrani, D. Dannheim, A. Fiergolski, D. Hynds, W. Klempt, X. Llopart, M. Munker, A. Nürnberg, S. Spannagel, et al., Time resolution studies of Timepix3 assemblies with thin silicon pixel sensors, Journal of Instrumentation 14 (05) (2019) P05022.  doi:10.1088/1748-0221/14/05/P05022.
  * [45] M. Campbell, J. Alozy, R. Ballabriga, E. Frojdh, E. Heijne, X. Llopart, T. Poikela, L. Tlustos, P. Valerio, W. Wong, Towards a new generation of pixel detector readout chips, Journal of Instrumentation 11 (01) (2016) C01007.  doi:10.1088/1748-0221/11/01/C01007.
  * [46] Y. Auad, C. Hamon, M. Tencé, H. Lourenço-Martins, V. Mkhitaryan, O. Stéphan, F. J. García de Abajo, L. H. Tizei, M. Kociak, Unveiling the coupling of single metallic nanoparticles to whispering-gallery microcavities, Nano letters 22 (1) (2022) 319–327.  doi:10.1021/acs.nanolett.1c03826.
  * [47] J.-W. Henke, A. S. Raja, A. Feist, G. Huang, G. Arend, Y. Yang, F. J. Kappert, R. N. Wang, M. Möller, J. Pan, et al., Integrated photonics enables continuous-beam electron phase modulation, Nature 600 (7890) (2021) 653–658.  doi:10.1038/s41586-021-04197-5.
  * [48] N. Müller, V. Hock, H. Koch, N. Bach, C. Rathje, S. Schäfer, Broadband coupling of fast electrons to high-q whispering-gallery mode resonators, ACS Photonics 8 (6) (2021) 1569–1575.  doi:10.1021/acsphotonics.1c00456.
  * [49] A. Tararan, A. Zobelli, A. M. Benito, W. K. Maser, O. Stéphan, Revisiting graphene oxide chemistry via spatially-resolved electron energy loss spectroscopy, Chemistry of Materials 28 (11) (2016) 3741–3748.  doi:10.1021/acs.chemmater.6b00590.
  * [50] N. Varkentina, Y. Auad, S. Y. Woo, A. Zobelli, J.-D. Blazit, X. Li, M. Tencé, K. Watanabe, T. Taniguchi, O. Stéphan, et al., Cathodoluminescence excitation spectroscopy: nanoscale imaging of excitation pathways, arXiv preprint arXiv:2202.12520doi:10.48550/arXiv.2202.12520.
  * [51] Y. Auad, M. Walls, J.-D. Blazit, O. Stéphan, L. H. G. Tizei, M. Kociak, F. De la Peña, M. Tencé, Event-based hyperspectral EELS: towards nanosecond temporal resolution (Oct. 2021).  doi:10.5281/zenodo.5552559.
URL https://doi.org/10.5281/zenodo.5552559

Supplementary Material for Event-based hyperspectral EELS: towards nanosecond
temporal resolution

## Clock drift between the SU and the TPX3 readout board

To understand how often the TPX3 and the SU clocks must be corrected, we have
analyzed how many clock ticks, in units of the fine TDC bin of $\sim$ 260 ps,
have been counted between successive scan rows concerning the main
hyperspectral data of the manuscript text (Figure 6). For the more than 590000
scan rows analyzed, 76.7% of them have the same number of clock ticks between
successive lines, which is also the reference value for placing the electrons,
as discussed in Figure 2. 18.2% of the scan rows are shifted by one TDC clock
tick. The other 5.1% has a maximum shift of 2 clock ticks. The average clock
drift is $\sim$ 0.23 ticks per every 601500 ticks of the whole scan line, or 1
cycle every 2615217 ticks. In the present case, this corresponds to $\sim$ 60
ps per line and hence an average drift, per frame, of $\sim$ 1.9 ns, much
smaller than the pixel dwell time of 4 $\mu$s.

For the carbon membrane, considering the same logic applies, the drift per
line would be $\sim$ 34 ps, or $\sim$ 17.4 ns per frame. This value is almost
8 times smaller than the pixel dwell time of 120 ns, meaning that, in the
present experimental conditions, clock drift correction can be done either by
each new scan row or each new can frame.

Figure S1: Histogram representing the number of clock ticks measured by the
TDC in the TPX3 between successive scan rows. The average drift between our SU
and the TXP3 clock is 1 cycle ($\sim$ 260 ps) every 2615217 clock ticks. The
clocks can be synchronized with every scan row or every complete frame.

## EELS spectra dependence on the total cluster ToT

For the same data studied in Figure 4, we have plotted the dependency of the
summed ToT on the detector hit position in the dispersive direction in Figure
S2, intending to clarify the origin of the Poisson distribution after
filtering data by the summed ToT. The histogram in Figure S2a clearly shows a
central ToT value around $\sim$ 139.12 ns (intense horizontal line), which is
associated with the 100 keV electrons. A Gaussian fit provides a fwhm of
$\sim$ 22.65 ns which is below the unit clock tick of 25 ns. The histogram of
the chip 1 alone provides a better contrast to see the high number of clusters
with $\Sigma$ ToT $<$ 60 ns around the chip junctions (close to pixels 256 and
512), Tis region, additionally, is also known to have hot pixels with high
counting rates even in the absence of the electron beam. In figure S2b we have
plotted the accumulated EELS spectrum for the lower (blue) and upper (orange)
sides of the aforementioned histogram, which displays a disproportionate
number of counts in the chip boundary, in the blue curve. Finally, we show in
Figure S2c the relation between the summed ToT and the cluster size, which has
its maximum of around 139.12 ns for a cluster size of 4 electrons. Note also
the high number of clusters with a unit cluster size (individual electrons)
for lower ToTs, which can be caused by the physical boundary condition on-chip
junctions.

Figure S2: Relation of the summed ToT with the electron hits in the dispersive
direction. (a) For the entire detector (chip 0 - 3) but excluding zero loss
for a better contrast, and for the chip 1, in which the low sum ToT can be
more easily identified within the chip borders. (b) The accumulated resultant
spectra for the two regions identified as $\Sigma$ ToT $>$ 60 ns and $<$ 60
ns. For the low ToT, the hit count between chips is orders of magnitude
greater than neighbor pixels. (c) The relation between the summed ToT and the
cluster size, displaying an average of 2.92 electrons/cluster.

## Cluster-detection algorithm results for different parameters

As briefly discussed in the main text, cluster detection is performed by
sorting the pixel hits by ToA and comparing them neighbor by neighbor: if the
ToA increases by more than $\Delta$ToA or if the pixel spatial position
increases by more than either $\Delta\alpha$ or $\Delta\beta$, a new cluster
is formed. This procedure is performed for hits that are not yet within a
cluster until convergence is achieved. Figure S3a shows the same plot as in
main text (Figure 4) for different $\Delta$ToA values and for the uncorrected
data set using $\Delta\alpha$ = $\Delta\beta$ = 2. As the pixel dead time is
$\sim$ 475 ns, there is no risk of same-pixel cluster identification as long
as $\Delta$ToA is smaller than this value. The typical cluster formation
interval, however, is smaller than 475 ns and one must be primarily careful
not to underestimate $\Delta$ToA. This is undoubtedly the case for 25 ns, 50
ns, and, to a lesser extent, 100 ns. $\Delta$ToA of 200 ns and 500 ns provide
almost identical data. In Figure S3b, we have varied $\Delta\alpha$ and
$\Delta\beta$ equally within the range $[0,4]$ for $\Delta$ToA = $200$ ns. For
$\Delta\alpha$ = $\Delta\beta$ = 0, the result is identical to that for the
uncorrected data, which is obvious considering any electron detected within
$\Delta$ToA = 200 ns will be at a different pixel due to the pixel dead time.
Data does converge for $\Delta\alpha$ = $\Delta\beta$ $>=$ 2.

Note that there is no conflict in choosing $\Delta\alpha=\Delta\beta=2$ and
the cluster size shown in Figure S2c. Indeed, one can have clusters of 5-10
electrons as long as the pixel separation between consecutive electrons in the
ToA-sorted list is $<=2$. For example, consider the following pixel address
electron events list, in which their ToA is less than 200 ns between each
other: (128, 128), (129, 128), (130, 128), (132, 130), (132, 132). There is a
maximum separation of 2 pixels between consecutive electron events in each
address direction and thus they belong to the same cluster. In this case, the
cluster size is 5.

Figure S3: Results of the cluster-detection algorithm for different
identification parameters. (a) Variation of $\Delta$ToA using $\Delta\alpha$ =
$\Delta\beta$ = 2. Note how 25 ns and 50 ns underestimate cluster formation
time. $\Delta$ToA $>=$ 200 ns is enough for the algorithm convergence. (b)
Variations of $\Delta\alpha$ = $\Delta\beta$ using $\Delta$ToA = 200 ns.
Convergence is achieved for values $>=$ 2, meaning that we must have at least
3 pixels of distance (in each $\alpha$ and $\beta$ independently) in order to
produce a new cluster.