Quantifying the Performance of a Hybrid Pixel Detector with GaAs:Cr Sensor for Transmission Electron Microscopy

Hybrid pixel detectors (HPDs) have been shown to be highly effective for diffraction-based and time-resolved studies in transmission electron microscopy, but their performance is limited by the fact that high-energy electrons scatter over long distances in their thick Si sensors. An advantage of HPDs compared to monolithic active pixel sensors (MAPS) is that their sensor does not need to be fabricated from Si. We have compared the performance of the Medipix3 HPD with a Si sensor and with a GaAs:Cr sensor using primary electrons in the energy range of 60 - 300keV. We describe the measurement and calculation of the detectors' modulation transfer function (MTF) and detective quantum efficiency (DQE), which show that the performance of the GaAs:Cr device is markedly superior to that of the Si device for high-energy electrons.


Introduction
The development of direct electron detectors (DEDs) over the past twenty years has opened up new experimental possibilities in electron microscopy, leading to significant advances in various fields [1,2]. Key to this success is increased sensitivity to incident electrons, which facilitates electron counting, compared to indirect scintillator-coupled detectors. This is invaluable when electron dose to the sample is low (≤ 10 e/Å 2 ) and also highly advantageous when performing quantitative analysis [3,4,5]. DEDs can be broadly divided into two categories: hybrid pixel detectors (HPDs) and monolithic active pixel sensors (MAPS). The latter have had great impact, substantially improving the resolution limit of cryogenic electron microscopy (cryoEM) at higher (≥ 200kV) accelerating voltages [6,7].
However, the former are more suitable for a wider range of applications, particularly those requiring high frame-rates, a linear response to high electron flux and radiation hardness. HPDs consist of an application specific integrated circuit (ASIC), which contains the signal-processing and readout electronics, bumpbonded to a thick (≥ 300 µm) sensor that protects the ASIC from the incident electrons, making them highly radiation resilient. On-pixel signal processing circuitry makes them capable of high (typically kHz) frame-rates and electron counting at MHz rates [8,9]. This makes them highly effective sensors for capturing fast (1ms) dynamics in a conventional transmission electron microscope (TEM) [10], and they show the potential to record processes at timescales of ≤ 1 µs [11,12]. Their ability to maintain a linear response even when subjected to high (≥ 1000 e/pixel/s) electron flux means they are suitable for use in a variety of diffractionbased experiments [9]. They have been successfully used for micro-electron diffraction (microED) in structural biology [13] and 4D scanning transmission elec-tron microscopy (4D-STEM), in both convergent and nano beam electron diffraction modes [14,15,16] in materials science. Beyond this, they have facilitated the application of 4D-STEM to biological samples [17,18] and are promising for use in electron energy-loss spectroscopy [19].
Neither type of DED is capable of maximum performance across the full range of incident electron energies available on current generation TEM instruments (60 -300keV). MAPS devices consist of a thin Si sensor, ≤ 50 µm in thickness, and minimal on-pixel electronics, which means they have small, usually <15 µm in pitch, pixels [20]. High-energy (≥ 200keV) electrons are transmitted through their thin sensors with minimal backscatter and there is little lateral spread in the signal produced by the small amount of energy that they deposit in the sensor [21,22]. These factors mean they offer excellent imaging performance for high-energy electrons, making them the detector of choice for highenergy cryoEM. At lower (≤120keV) electron energies, their performance deteriorates due to increased lateral scatter in and backscatter from the sensor, making them less suitable for low-energy cryoEM [23,24] and studies of materials sensitive to sputtering damage [25,26]. Furthermore, the simplicity of the on-pixel electronics limits frame rates and, as they count electrons by identifying pixel clusters in sparsely populated frames, their count rates. Current monolithic devices used in electron microscopy typically have sub-kHz frame rates, although the recently developed 4D Camera has a maximum frame rate of of 87kHz [27]. This has the drawback of producing large volumes of empty data that are computationally expensive to manage and process, whereas newer HPDs are able to operate in a data-driven mode whereby only those pixels that record a hit are read out, reducing the size of the datasets that are produced [28]. The maximum electron fluence to which monolithic device can be exposed is also limited by the fragility of their on-pixel electronics [3,29,30].
HPDs, such as Medipix3 [31], have been shown to match and even surpass the performance of an ideal detector when used with low-energy electrons [32]. However, for sensors sufficiently thick to protect the ASIC, high-energy electrons travel long distances and are counted by multiple pixels, causing a degradation in performance [13,33]. The lateral scattering and penetration depth of an incident electron is inversely proportional to the average atomic number (Z) of the sensor. Unlike monolithic devices, HPDs can have sensors made of materials other than Si (Z = 14). HPDs with high-Z sensors should be capable of improved imaging performance for incident electrons across a wider range of energies, as the spatial distribution of the signal produced by high-energy electrons would be more localised [34]. This would increase the versatility of HPDs and, combined with their advantages relative to MAPS detectors, they would have the potential to be "universal" detectors for transmission electron microscopy, suitable for almost all applications at all accelerating voltages.
Increasing the Z of the sensor may also have a negative impact on performance, through decreased efficiency due to increased backscatter [35]. In this article, we investigate the extent to which the performance of HPDs can be improved by using a high-Z, specifically a GaAs:Cr (average Z = 32), sensor. We begin by describing in detail procedures suitable for performing measurements of the modulation transfer function (MTF) and detective quantum efficiency (DQE) of HPDs, for the purpose of characterising their imaging performance. We then compare the imaging performance of 500 µm thick GaAs:Cr and Si sensors bonded to Medipix3 ASICs for electrons at energies of 60 -300keV. Finally, we offer a comparison of their performance under uniform illumination and discuss some of the challenges associated with the use of high-Z sensors for imaging applications.

Detector Structure
The Medipix3RX ASIC (henceforth referred to as Medipix3) consists of an array of 256 × 256 55 µm pitch pixels [31]. The signal-processing circuitry present on each pixel has an analogue front-end and a digital backend. In the analogue section, the charge induced in a pixel due to an incident electron is amplified and converted into a shaped voltage pulse. When the detector is operating in single-pixel mode (SPM), this is registered as a hit if it surpasses a user set threshold, and one of the Linear Feedback Shift Registers in the digital back-end is incremented. During readout of a frame, the register acts as a shift register to readout the number of hits it has recorded during data acquisition. Used with the Merlin readout system [36], the detector is capable of frame greater than 1 kHz depending on counter bit-depth, with on-pixel count rates being determined by the ASIC settings [8]. The digital back-end contains two registers and up to two thresholds, TH0 and TH1 can be set. Alternatively, a single threshold can be used, with the two registers working in tandem such that while one is acting as a counter the other is operating as a shift register, permitting continuous acquisition of data with no dead time.
The detector's other main mode of operation, is a charge summing mode (CSM), where neighbouring pix-els pool their individual signal-processing circuitry and attempt to allocate incident electrons to a single pixel. Each pixel compares the voltage pulse produced in its analogue front end to TH0 but also sends copies of this pulse to summing nodes that are effectively located at its corners. At each node, the voltage pulses produced by the four pixels that share a corner are summed. If the summed voltage pulses surpass TH1, then the counter of the pixel identified has having the largest share of the deposited energy is incremented. The pixel which registers the most energy is identified as the pixel where the voltage pulse drops below TH0 last, as the time the voltage pulse is above TH0 is proportional to the energy deposited on the pixel.
The vast majority of room temperature semiconductor sensor materials are binary or ternary compounds, such as GaAs:Cr, CdTe and CdZnTe. The growth and fabrication of sensors from these materials is challenging and the presence of crystal defects and impurities can be common. These issues can lead to challenges such as incomplete charge collection, polarisation due to the build-up of trapped charge, high leakage currents, electric field instabilities and limitations in the sensor volumes that can be produced [37,38,39]. In recent years, however, technologies for manufacturing high-Z sensors that can operate at room temperature and for bonding these to ASICs have matured. The GaAs:Cr material that we have characterised represents a significant step forward compared to earlier forms of semiinsulating GaAs that have been investigated for use in imaging detectors [40,41]. It has been used with a variety of ASICs, including the Medipix3 ASIC, for X-ray imaging [42,43,44] and has been shown to be sufficiently robust for high-flux X-ray imaging [45].
In the case of the GaAs:Cr device that we have characterised, the sensor was bonded to the ASIC using a cold-weld indium bump-bonding process [46], and had a Ni front-side contact. Due to the electron mobilitylifetime product of GaAs:Cr being better than the hole mobility-lifetime product [43], the ASIC was set to collect electrons, and an applied negative bias of 300V was sufficient to to ensure complete collection of the electrons without any being lost due to trapping [42]. The Si detector consisted of high resistivity n-type Si with p+ on n implants that was bump-bonded using a standard solder bump-bonding process with an Al frontside contact. The Si sensor was operated with an applied positive bias of 110V, with the ASIC set to collect holes. Both devices were cooled passively, and their typical operational temperatures were approximately 28 • C.

Characterisation of Detector Performance
The performance of an imaging detector can be characterised through the measurement of independent and dependent parameters. Independent, directly measurable quantities include the MTF, which quantifies the ability of a detector to transfer contrast in an image as a function of spatial frequency, ω. This is the Fourier space representation of a detector's point spread function (PSF), which describes the detector's average response to an idealised input signal with the form of a δ-function. The noise power spectrum (NPS) is another independent parameter that measures how a detector transfers the noise present in the image incident upon it. Dependant on both of these quantities, the detector's DQE describes the extent to which that detector reproduces the signal-to-noise ratio (SNR) of features in the images it records as a function of their spatial frequency.
For pixelated, digital detectors, it is necessary to distinguish between the presampling and digital forms of these measures of detector performance. The presampling versions describe the detector's response without the effects of discrete sampling by pixels. In HPDs, they describe how noise and signal are affected by the interactions of the primary electron with the sensor due to the scatter of the primary electron itself, the production of any secondary X-rays or electrons, and by the lateral spread of signal-carriers produced by the primary electron and any secondary radiation as they travel to the pixel electrodes. The presampling forms also account for integration over the effective pixel area. In an ideal detector that counts all incident electrons only in the entry pixel, the effective pixel area is equivalent to the physical pixel area. However, it can be smaller than the physical pixel if electrons are not counted when they enter the sensor in certain regions of a pixel (e.g. the corner or edge) or greater than the physical pixel if multiple pixels count an incident electron. The ratio of the effective pixel area to the physical pixel area is the detector's fill factor.
The digital MTF, NPS and DQE are their respective presampling form evaluated at the centre of each pixel [47]. The finite size of the pixels means that aliasing of the digital MTF and NPS is possible, due to undersampling, causing them to be overestimated at high ω [48]. Various approaches have been used to determine the MTF and DQE of imaging detectors for use in electron microscopy [33,35,49], in part because it is necessary to treat different types of pixelated detectors in different ways. In the interests of ensuring our results can be readily compared with those characterising other imaging detector types, and with a view to clarifying what constitutes best practice in performing these measurements for HPDs in electron microscopy, we outline our approach for calculating the MTF, NPS and DQE and the justifications for it.
The presampling MTF can be measured directly if the experimental method used oversamples the input signal that approximates a δ-function incident on the detector. We have used the well-established knife-edge method [49], informed by the approaches other authors have used when applying the technique to HPDs [13,33]. In our measurements, we used a thick Al knife-edge positioned directly in front of the detector to minimise both geometric blurring and, as HPDs are sensitive to X-rays, the quantity of detectable X-rays produced by interactions of incident electrons with the edge. The knife-edge was set at an angle relative to the pixel columns such that the transition from the obscured portion of the pixel columns to the illuminated could be oversampled. A region of the knife-edge without defects 16 pixels wide was identified, and for each column of pixels perpendicular to the edge in this region, the knife-edge location was identified with sub-pixel accuracy via interpolation as the position at which the intensity is half the column's maximum value. Pixel values were then rearranged in order of their distance from the position of the knifeedge to give a single, oversampled edge-spread function (ESF). The ESF can be differentiated directly to find the detector's line-spread function (LSF), which is equivalent to the PSF in one dimension, or it can be fitted with a function to minimise the effects of noise in the measurement. We have found that a single error function, as defined in equation 1, provided a good fit to the ESF. The MTF was then calculated as the modulus of the Fourier transform of the LSF that is calculated from differentiating ESF f it .
In equation 1, µ is the mean position of the function, which is set to 0, σ is the width of the error function and A is a normalisation factor. Some studies include a term to correct for the effects of integrating over the physical pixel area or apply a correction directly to the MTF [49], but this has been shown to have a minimal effect on the final MTF [35] and was found to yield no significant improvement in the fit of our ESF.
It is not possible to oversample the noise profile of the detector and identify the aliased contributions from above the detector's Nyquist frequency (ω N ), which is its maximum sampling frequency and equal to 1/(2 × pixel pitch). Consequently, the presampling NPS cannot be recovered. A correction for aliasing has been proposed for CCD cameras [49]. Undersampling and aliasing are inevitable for scintillator-coupled CCD cameras as electrons can be registered by multiple pixels in spite of the CCD pixel fill factor being < 1 [50], but this is not true for all pixelated detectors. The effective pixel area of HPDs can be larger than the physical pixel as incident electrons can be counted by multiple pixels, and they can therefore have an effective fill factor > 1. This has the effect of an anti-aliasing filter [35]. When using a high threshold, such that each incident electron is counted by at most one pixel, the NPS should be independent of spatial frequency and it is not necessary to account for aliasing. We have therefore not attempted to apply any correction for aliasing when calculating the NPS.
Equation 2 provides a practical definition of the digital NPS of an imaging detector used in our calculations [47]. N x N y are the number of pixels in the detector's x and y-axis respectively, while x 0 and y 0 are the pixel pitch in x and y respectively. The value represented by ∆d n x ,n y is the difference between the number of counts registered by a pixel with coordinates (x, y) given a mean dose per pixel n and the expectation value of the number of counts recorded by the pixel. This was measured by recording a series of flat field exposures, calculating their mean image and subtracting this from each frame in the series. The Fourier transform of each image was then calculated, and these were averaged to find the expectation value of the Fourier transform of ∆d n x ,n y . The 1D digital NPS was then found by taking the radial average.
The digital DQE is defined by equation 3, where d n is the mean number of counts recorded per pixel and n is the mean number of electrons per pixel in the flat field images used to calculate the NPS. To find n, the beam current I is measured and a series of images with a frame time t are recorded, with the entirety of the beam incident on the detector. The detector gain factor, g, is calculated using equation 4, where d n m is the mean number of counts recorded by the m-th pixel and N the total number of pixels. The value of n for the flat field exposures used to determine the NPS was then found by calculating d n for these images using the fact that n = d n /g.
A difficulty encountered in calculating the NPS in this way is that the low-frequency NPS tends to be incorrectly estimated [35]. The standard solution to this is to normalise the NPS by NPS(0) and calculate DQE(0) separately, using this as a scaling factor. This is formalised in equation 5, where NNPS is the normalised NPS. DQE(0) is calculated using equation 6, where NPP is the noise-per-pixel, the corrected value of NPS(0). In principal, NPS(0) should be the variance, σ 2 d n , of ∆d n x ,n y . However, as electrons scatter over multiple pixels, there are correlations in the number of counts recorded by each pixel and the variance is not an accurate measurement of NPS(0). To find the NPP, the images of ∆d n x ,n y were binned by progressively larger factors, b and the variance of the images, normalised by the square of the binning factor was evaluated. As b increases, σ 2 d n /b 2 reaches a plateau as the correlations between neighbouring pixels are discounted, which is taken to be the NPP.
Measurements using electrons with energies in the range of 60 -200keV for both Si and GaAs:Cr detectors were performed by mounting the detectors on an FEI Tecnai T-20 TEM using the 35mm port above the viewing screen. The beam current for these measurements was recorded using a Faraday cup mounted at the end of the chassis containing the detector, which was connected to a Keithly 485 Picoammeter. To acquire 300keV electron data, the GaAs:Cr detector was mounted in the Gatan camera block on a FEI Titan 80 -300 (S)TEM. For this set of measurements, the beam current was calculated using the number of counts registered by a Gatan Ultrascan located in the same plane as the Medipix3 device and the manufacturer-provided conversion factor. When acquiring flat field, knife-edge and gain images, 128 frames at each threshold were recorded, with the frame time varied to maximise the number of counts for a particular beam current without saturating the on-pixel counters. It should be noted that the DQE can be sensitive to electron flux and dose. If the flux is too high then the detector is unable to count all incident electrons, which causes a suppression of the NPS at low spatial frequencies [7], but if the value of n is too low then the NPS will be dominated by shot noise in the incident number of electrons [22]. In our measurements we have taken care to use beam currents that were sufficiently low so as to minimise undercounting of incident electrons while also ensuring that the value of n is statistically significant.
The detector thresholds, TH0 and TH1 when operating in SPM and CSM respectively, were calibrated using fluorescence X-rays from a series of targets. This provides an absolute energy calibration, as low-energy photons typically deposit their energy in a single interaction, rather than scattering over multiple pixels as is the case for high-energy electrons. Consequently, the disparity between the maximum amount of energy deposited in a pixel by incident electrons and the initial energy of incident electrons is apparent. As the energy of the incident electrons increases, the maximum amount of energy deposited on a single pixel as a fraction of the primary electron energy decreases, due to increased scatter. This effect is more pronounced when in SPM, as in CSM the energy deposited over 2 × 2 pixel blocks by incident electrons is summed. A result of this is that the maximum threshold at which it was possible to fit the knife-edge data with equation 1 is lower than the counting threshold that corresponds to the primary electron energy, substantially so for electrons with energies ≥ 120keV. For example, for the 300keV electron data acquired with a GasAs:Cr device, the maximum amount of energy deposited on a single pixel when the detector was working in SPM was 160keV, and the highest threshold at which it was possible to fit equation 1 was lower than this (131.3keV), due to insufficient counts being recorded at thresholds close to 160keV.

MTF and DQE Measurements
Figures 1 and 2 show MTFs and DQEs obtained using the lowest threshold above both detectors' noise levels; a threshold equal to half the primary electron energy and the highest threshold common to both devices at which the knife-edge data could be fit with equation 1 for 60keV and 80keV electrons respectively. The MTFs of the Si device in figure 1(a) are slightly superior to those of the GaAs:Cr device in 1(c) for a given threshold, with the greatest difference being 0.07 at ω N for the intermediate threshold MTF. In figure 1(b), the Si DQEs are significantly higher than their GaAs:Cr counterparts in 1(d), with the largest difference being 0.34 between the low threshold DQEs at low ω. Comparing the MTFs of the Si detector for 80keV electrons in figure 2(a) with those of the GaAs:Cr detector in 2(c), the performance of the latter is marginally better, with the greatest difference being that the low threshold GaAs:Cr MTF is 0.05 higher than the Si MTF at ω N . However, the DQEs of the Si detector seen in figure 2(b) are again significantly higher than those of the GaAs:Cr detector in 2(d), with the greatest difference between the GaAs:Cr and Si DQEs at low and intermediate thresholds being at least 0.26. An ideal detector counts all incident electrons only in the entry pixel, and such a detector would have a constant NPS, unitary gain and, if it had square pixels, a PSF with the form of a top-hat function, a constant NPS and unitary gain. These factors give rise to an ideal MTF that is a sinc function equal to 0.64 at ω N and, per equation 3, an ideal DQE that is the square of the ideal MTF, with a value of 0.41 at ω N [51]. These are plotted in figures 1 and 2 for comparison with the experimental results. A notable feature of the DQE results for the Si detector in figures 1(b) and 2(b) is that, when using a low threshold, the detector is able to surpass the ideal DQE of a pixelated detector. At 60keV, its best DQE is at least 0.1 less than the theoretical maximum when ω ≤ 0.1ω N , but it surpasses the theoretical maximum at high ω, while at 80keV the low threshold DQE of Si detector surpasses the ideal at intermediate values of ω. This can be attributed to the fact that, while both the MTF and NPS are suppressed at high spatial frequencies when an electron is counted by multiple pixels, the NPS is suppressed to a greater extent relative to the MTF, inflating the DQE at high spatial frequencies so that it exceeds the predicted DQE of an ideal detector [35].
In figure 3 MTF(ω N ) as a function of threshold for both detectors when operating in SPM and CSM for 60keV and 80keV electrons is plotted. For both detectors in SPM, the value of MTF(ω N ) increases approximately linearly with the counting threshold. This is consistent with the expectation that the effective pixel area decreases with increasing counting threshold [32,33]. At low thresholds, the effective pixel size is larger than the physical pixel pitch and a pixel can count an incident electron even if the electron is not incident on that pixel, causing a reduction in the MTF. The higher the counting threshold, the more energy an electron must deposit in a pixel to be counted by that pixel, decreasing the effective pixel size. Consequently, the value of MTF(ω N ) can exceed the theoretical maximum of 0.64 for an ideal detector at high thresholds, as the effective pixel size can be smaller than the physical pixel pitch of the detector.
The 60keV results for the two devices operating in SPM in figure 3(a) confirm that the the Si device consistently outperforms the GaAs:Cr device across all counting thresholds, with there being an almost constant offset between the two curves. However, the difference is small, with a maximum value of 0.08 when the GaAs:Cr and Si detector thresholds are both 28.5keV. At 80keV, the GaAs:Cr marginally outperforms the Si device at low and high counting thresholds, with the MTF(ω N ) values of the two devices overlapping at intermediate thresholds in figure 3(a). The maximum difference in MTF(ω N ) for 80keV electrons is also 0.08, when the GaAs:Cr and Si device thresholds are 58.1keV and 57.5keV.
When operating in CSM, the performance of two devices is very different, with MTF(ω N ) being independent of counting threshold in figure 3(b). This follows from the fact that, when the devices are operating in CSM, whether or not an electron is counted depends on the sum of the charge induced in neighbouring pixels. For low-energy electrons, which typically deposit all their energy across one of the 2 × 2 pixel blocks that the CSM algorithm operates across, this will be consistently above threshold until the threshold is equal to the energy of the incident electron. The extent to which MTF(ω N deviates from the ideal value of 0.64 is indicative of how successful the CSM algorithm is at identifying the pixel of entry. When operating in CSM, MTF(ω N ) for the Si detector with 60keV electrons is similar to that of an ideal detector, ranging between 0.61 and 0.64. The response of the Si detector is poorer for 80keV electrons, ranging between 0.53 and 0.56, but this is still better than the performance of the GaAs:Cr device used in CSM, for which MTF(ω N ) fluctuates around 0.50 for 60keV electrons and around 0.55 for 80keV electrons.  The DQE(0) and DQE(ω N ) results for the two detectors in both modes of operation for 60keV and 80keV electrons are shown in figures 4 and 5. These results make apparent the difference in performance between the two detectors when using electrons at these energies. When the detectors operate in SPM, DQE(0) decreases gradually with increasing threshold up to approximately half the primary electron energy, but at thresholds above this, DQE(0) decreases rapidly as the counting threshold is increased. DQE(ω N ) follows a similar trend, although the initial decrease with regard to threshold is greater for the Si DQE(ω N ). For both detectors operating in CSM, DQE(ω N ) is approximately constant for both 60keV and 80keV electrons, with minimal negative dependence on threshold seen in figure 5(b). The CSM DQE(0) in figure 4(b) exhibits a greater dependence on threshold, decreasing as the threshold increases for both devices and at both electron energies. In the case of the GaAs:Cr device, it is possible to discern a similar trend to that seen in the SPM results in figure 5(a).
The negative dependence of the DQE on counting threshold seen in the SPM results arises from a similar reason as the positive dependence of MTF(ω N ) on counting threshold. As the effective pixel size decreases with increasing threshold, so too does the likelihood of electrons not being registered by the detector, reducing the efficiency of the detector. In theory, the value of DQE(0) should be constant for all counting thresholds up to half the primary electron energy, as it is only when the threshold is equal to half the primary electron energy that the effective pixel size should be less than the physical pixel size, leading to electrons not being counted. In practice, as the electrons scatter through the sensor depositing their energy in multiple pixels, some electrons will not be registered at lower thresholds as they fail to deposit enough energy in any single pixel to be counted.
The relative constancy of DQE(0) and DQE(ω N ) as a function of threshold for the CSM results can be attributed to the same factors as the constancy of MTF(ω N ), namely that the signal recorded by neighbouring pixels is summed together. Nevertheless, there is still a gradual decrease in the value of DQE(0) with increasing counting threshold. This is most probably due to a small percentage of electrons that deposit their energy over an extended number of pixels greater than the 2 × 2 blocks of pixels that the CSM algorithm works across being discounted, as no single block of pixels has the full energy of the electron deposited in it.
At increasing electron energy, the benefits of the GaAs:Cr sensor become apparent. Figure 6 shows the MTFs and DQEs for the Si and GaAs:Cr devices in SPM at 120keV using the lowest and highest thresholds common to both detectors for which the knife-edge could be fit and the threshold closest to half the primary electron energy. Both the MTFs and the DQEs of the GaAs:Cr device are superior to those of the Si detector. At each threshold shown in figures 6(a) and (c) the MTF of the GaAs:Cr device is at least 0.21 higher than the MTF of the Si device at ω N . The DQE of the GaAs:Cr  Figure 7 shows the MTFs and DQEs of the two detectors operating in SPM for 200keV electrons using the lowest threshold above the noise level of both detectors; the highest threshold common to both devices at which the knife-edge data could be fit and the threshold equal to half the highest threshold used for both devices. The different choice in thresholds shown in figure 7 compared to figures 1, 2 and 6 is due to the increased disparity between the maximum amount of energy deposited on a pixel and the primary electron energy when using higher-energy electrons discussed in section 3. The MTF of the GaAs:Cr device is at least 0.25 greater than that of the Si detector at ω N for all thresholds shown in figures 7(a) and (c). At the low and intermediate thresholds the GaAs:Cr DQE is 0.52 and 0.21 higher than the Si DQE at ω N , while at the high threshold the difference in DQE is marginal. Overall, the difference in performance between the GaAs:Cr and Si detectors is greater at 200keV than it is at lower electron energies for which the performance of the Si detector is comparable to or greater than that of the GaAs:Cr detector.
In figures 6(d) and 7(d), the low threshold GaAs:Cr DQE surpasses the DQE of an ideal detector at high ω.  This is similar to the behaviour of the Si detector operating in SPM with 60keV and 80keV electrons in figures 1(b) and 2(b) and is caused by the same factors. While the extent to which the DQE of the Si detector for 60 and 80keV electrons surpasses the theoretical maximum is marginal, the DQE of the GaAs:Cr detector for 200keV electrons at high ω is significantly greater than that predicted for an ideal detector. The greatest extent to which the low threshold DQE of the GaAs:Cr detector exceeds the DQE of an ideal detector is by 0.19 at a spatial frequency of 0.86ω N . At ω N , the low threshold DQE is equal to 0.52, which agrees closely with the maximum improvement in DQE that can be obtained due to the NPS being suppressed to a greater extent than the MTF [35].
However, the performance of the GaAs:Cr detector Similarly, when the devices operate in CSM, MTF(ω N ) for the GaAs:Cr at 200keV is consistently better than MTF(ω N ) for the GaAs:Cr detector at 300keV and for the Si detector at 200keV. In figure 9(b), the low threshold value of MTF(ω N ) for the Si detector for 200keV electrons is 0.01, while for the GaAs:Cr detector for 300keV electrons MTF(ω N ) is 0.03 at the lowest threshold used. The low threshold MTF(ω N ) for the GaAs:Cr detector for 200keV electrons is 0.43, and a difference between the detector's response in SPM and CSM is that MTF(ω N ) decreases with increasing threshold, reaching a minimum value of 0.35 at a threshold of 175.1keV. For 200keV electrons with the Si detector operating in CSM, MTF(ω N ) decreases to a minimum of 0.00 at a threshold of 109.3kV before increasing at thresholds above 130keV to a maximum of 0.06 at a threshold of 179.1keV. Likewise, MTF(ω N ) for the GaAs:Cr detector for 300keV electrons decreases to a minimum of 0.01 at a threshold of 163.5keV before increasing to a maximum of 0.1 at a threshold of 279.7keV.
The various different trends in MTF(ω N ) as a func- Cr respectively and the tendency of electrons to deposit more energy towards the end of their trajectory in the sensor rather than at the beginning [52,53]. Increasing the counting threshold does not initially improve the MTF (which is also apparent in figures 7(a) and 8(a)), as using a high threshold is more likely to count the electron in a pixel at the end of the electron's trajectory rather than the entry pixel. However, at very high thresholds, work with the Eiger detector [13] suggests that the only electrons counted are the small fraction of electrons that deposit most of their energy close to their entry point, causing an improvement in MTF.
Although 200keV electrons have a sufficiently reduced range in GaAs:Cr such that in SPM using a high threshold successfully identifies the entry pixel of those electrons that are counted, they are still able to deposit their energy over multiple 2 × 2 pixel blocks. Consequently, when the GaAs:Cr sensor operates in CSM, multiple pixels register 200keV electrons when using a low threshold. As the counting threshold increases, hits associated with the pixel block that has the most energy deposited on it continue to be counted, but this block does not necessarily contain the entry pixel. Increasing the counting threshold therefore suppresses hits associated with the block containing the entry pixel, which causes the decrease in MTF(ω N ) with increasing threshold seen in figure 9. This also explains the initial decrease seen in the 300keV GaAs:Cr CSM MTF(ω N ) and 200keV Si CSM MTF(ω N ). The increase in MTF(ω N ) at high threshold for both 300keV electrons and the GaAs:Cr detector and 200keV electrons and the Si detector in CSM occurs for the same factors as the improvement in their SPM counterparts at high threshold. In figure 10, the trends in DQE(0) as a function of threshold for both devices are consistent with the interpretation of the MTF(ω N ) data above. Operating in SPM, the 200keV DQE(0) for the Si and GaAs:Cr detectors and the 300keV DQE(0) for the GaAs:Cr detector in figure 10(a) exhibit a similar trend as to that seen for the low-energy SPM results in figure 4(a). The principle difference between the results in figures 4(a) and 10(a) is that in the latter the threshold at which there is a change in gradient in the dependence of DQE(0) The difference seen in the rate at which DQE(0) decreases with increasing threshold for the two detectors for 200keV electrons can be attributed to the spread of the signal produced by 200keV electrons being greater in the Si detector than it is in the GaAs:Cr detector. Consequently, more electrons deposit enough energy on a single pixel in the GaAs:Cr sensor to be counted for a given threshold than they do in the Si detector. That the high threshold value of DQE(0) for 300keV electrons in the GaAs:Cr sensor is greater than the high threshold DQE(0) for 200keV electrons in either device is due to both the reduced spread in signal in the GaAs:Cr sensor and the fact that the net energy that can be deposited by a 300keV electron is greater than that deposited by a 200keV electron.
When the detectors operate in CSM, there is a no-table difference between the dependence of DQE(0) on threshold at high electron energies compared with at low electron energies. For the CSM DQE(0) in figure 10(b), there is a marked increase in the rate at which the value of DQE(0) decreases at high thresholds relative to the rate at which it decreases at low threshold. This is similar to the dependence of DQE(0) on threshold when the detectors operate in SPM, rather than the gradual decrease with increasing threshold seen at 60 and 80keV ( figure 4(b)), where any change in gradient is slight and difficult to discern. The difference between the lowenergy and high-energy trends can be explained by the same factors that explain the dependence of MTF(ω N ) on threshold in figure 9(b). At low thresholds, the number of counts decreases gradually with respect to threshold, as the incident electrons deposit their energy over multiple CSM pixel blocks and, in each block, the reconstructed charge needs to be above threshold for it to be counted. Above a certain counting threshold, electrons are only counted in a single pixel block and as the counting threshold increases the greater the energy deposited in that block must be for the electron to be counted. This is analogous to the detector behaviour in SPM, but with the added complication of how the electron energy is deposited over blocks of neighbouring pixels rather than in single pixels. The thresholds at which the gradient of DQE(0) as a function of counting threshold changes for 200keV electrons and the Si detector and 300keV electrons and the GaAs:Cr detector are also the thresholds above which the corresponding MTF(ω N ) begin to rapidly increase with respect to threshold, corroborating the interpretation of the high threshold improvement in MTF in figure 9(b). DQE(ω N ) as a function of counting threshold for the two detectors operating in SPM and CSM for highenergy electrons is shown in figure 11. Consistent with the results in figures 9 and 10, the 200keV DQE(ω N ) of the GaAs:Cr detector is significantly better the 300keV DQE(ω N ) of the GaAs:Cr detector and the Si detector 200keV DQE(ω N ) in both modes of operation. In SPM, the maximum GaAs:Cr DQE(ω N ) for 200keV electrons is 0.52 at a threshold of 12.7keV. This decreases with threshold to a minimum value of 0.05 at a threshold of 116.5keV. The value of DQE(ω N ) at 200keV for Si is 0.00 at low threshold, increasing to 0.01 at thresholds greater than 106.9keV. The trend seen in the 300keV GaAs:Cr SPM DQE(ω N ) is noteworthy. At a threshold of 12.7keV it is equal to 0.02 and with increasing threshold decreases to a minimum of 0.00 at a threshold of 79.4keV before increasing to 0.02 again at 131.3keV. This behaviour reflects the fact that increasing the counting threshold initially does little to improve the MTF but does increase undercounting of incident electrons, but at very high thresholds the improvement in MTF at high ω outweights the adverse impact of undercounting electrons on the DQE. The CSM DQE(ω N ) in figure 11(b) confirms the failure of the CSM algorithm to enhance detector performance for high-energy electrons in both sensors. At low thresholds, the CSM DQE(ω N ) of the GaAs:Cr detector is lower than the low threshold SPM DQE(ω N ), with a maximum value of 0.11 at a threshold of 22.8keV. This decreases to 0.04 at a threshold of 179.4keV. The Si detector CSM DQE(ω N ) for 200keV electrons never exceeds 0.00 for all thresholds, and this is also true of DQE(ω N ) for the GaAs:Cr detector in CSM for 300keV electrons.

The Influence of Defects on Sensor Performance
A difficulty in the fabrication of compound semiconductors are the defects that develop as part of the growth process [54,55]. Figure 12 shows normalised flat field exposures of Si and GaAs:Cr devices. The Si sensor is homogeneous whereas the GaAs:Cr sensor displays a high number of features that range from small bubblelike structures to lines that extend across the full sensor. Examples of some of the structures that can be observed in the GaAs:Cr sensor are shown in figures 12(d) and (f). These features are indicative of defects in the sensor which result in non-uniformities in the electric field across the sensor and consequently the pixel matrix, causing distortions in both the shape and the size of the pixels. Areas of increased intensity indicate larger pixels, which count a disproportionate number of electrons while darker regions indicate pixels that are smaller and that have lost hits to neighbouring pixels. An example of a cluster of pixels that are larger than expected and therefore overcount is seen in figure 12(e). It should be noted that pixels that were identified as noisy due to damage, failure in the manufacture process etc. were masked prior to the image being acquired, so this is not the cause of the bright pixels such as those seen in figure 12(e). Histograms of the intensities in the normalised flat field images in figure 12(c) clearly show the broader range of intensities present in the GaAs:Cr flat field image compared with flat field image recorded by a Si device. The standard deviation of the range of intensities present in the GaAs:Cr flat field image is almost four times that of the flat field image recorded by the Si sensor in spite of the latter having a greater number of dead pixels. The variation in intensity in the Si flat field image is due to the slight variation in the threshold across the pixel matrix.
A standard procedure to correct for variation in intensity across a pixelated detector due to e.g. variation in the counting threshold across the pixel matrix is to apply a flat field, or gain, correction. In figures 13(a) and (b), images of a standard calibration sample recorded by a GaAs:Cr detector operating in SPM with and without a flat field correction are shown. The effect of applying a flat field correction can be seen from the line profiles taken across the normalised images with and without the correction in figure 13(d) as well as histograms of the images in figure 13(c). Comparing the line profiles extracted from the corrected and uncorrected images there is an improvement in the contrast present in the corrected image. In the case of the corrected image, the periodicity of the cross grating is apparent and can be readily measured as having a mean value of 43 pixels. This is not the case for the line profile extracted from the uncorrected image, where the additional variation in intensity makes the period of the cross grating difficult to discern. The mean value of both line profiles is 1.0, but while the standard deviation of the corrected image line profile is 0.09, that of the uncorrected image line profile is 0.14, an increase of more than 50%. This reflects the effectiveness in the flat field correction at reducing noise due to the sensor defects. Similarly, the range of intensities present in the corrected image is reduced, with the standard deviation of the range of intensities in the corrected image being less than half that of the uncorrected image.
However, examination of two of the regions highlighted in figures 12(d) and (e), show that the distortions present in the uncorrected image can still be seen in the corrected image. Increasing the counting threshold increased the visibility of the defects, which may be due to a reduction in blurring due to the improved detector PSF at higher counting thresholds. Overall, although applying a flat field correction compensates for the variation in intensity due to the pixel size no longer being constant across the sensor, it does not correct for the geometric distortions due to variations in shape of the pixels caused by skewness of the sensor's electric field. Consequently, artefacts are introduced and features in the images recorded by the GaAs:Cr device are distorted.

Conclusions
Our results confirm that high-Z sensors improve the performance of HPDs for high-energy electrons. When operating in SPM and using a high threshold, the GaAs:Cr Medipix3 device that we have characterised is able to match and surpass the performance of an ideal detector in terms of its MTF for electrons with energies in the range of 60 -200keV. Using a high threshold has a negative effect on the device DQE, however, and by using a low threshold the GaAs:Cr SPM DQE for 200keV electrons is able to significantly exceed that of an ideal detector at high values of ω, with its performance at ω N surpassing the theoretical limit by the maximum extent possible. This compares favourably with that the DQE of the Falcon 3 MAPS detector when using 200keV electrons [22], though it should be noted that ω N for the monolithic device is higher than that of the Medipix3 due to its smaller pixels.
Although the GaAs:Cr device outperforms the Si device for high-energy electrons, for electron energies below 120keV, its performance is poorer both in terms of MTF and DQE than the Si detector. The lower DQE can be attributed to increased backscatter, while the poorer MTF may be due to the distortions in the shape and size of the pixels dominating at low energies when the effective pixel size is very close to the physical pixel size even when using a low threshold. Nevertheless, the difference in performance between Si and GaAs:Cr devices at low electron energies is modest, particularly comparing their MTFs when operating in SPM. Except for the most demanding of experimental conditions, there is likely to be minimal drawback in using the GaAs:Cr in experiments where it is necessary to use electrons with energies down to 60keV. Our results also suggest that at lower energies there is the potential for a serious degradation in performance. As such, there is unlikely to be any advantage in the use of high-Z sensors for scanning electron microscopy or for use in TEM imaging using electrons with energies lower than 60keV. However, it may be possible to improve the efficiency of the GaAs:Cr device at low energies if the frontside contact were made of a lower-Z material than Ni, such as Al, but this would require advances in device manufacture.
At the high-energy range considered in this work, the performance of the GaAs:Cr shows a significant performance loss for 300keV electrons. This motivates the investigation of other sensor materials with even higher values of Z, such as CdTe and CZT (average Z = 50), though it is worth noting that using such materials will likely lead to further degradation in performance at low electron energies. No single imaging detector will perform ideally across all the electron energies typically used in transmission electron microscopy, but on the basis of our results, HPDs with GaAs:Cr sensors may offer the best performance over the widest range of accelerating voltages presently used in TEM. Although the performance of the GaAs:Cr sensor at 300keV is poor, it is similar to that of the Si detector at 200keV, and we note that Medipix3 devices with Si sensors, as well as similar HPDs with Si sensors are routinely used at 200keV and 300keV in a number of applications [15,18]. It is therefore likely that GaAs:Cr sensors can be used with 300keV electrons, offering improved MTF and DQE compared to a Si device used at 200keV and 300keV.
To summarise how HPDs with high-Z sensors can be best utilised, it is helpful to discuss the optimal detector settings. It has been argued that for counting HPDs the optimum threshold is equal to half the primary electron energy so as to obtain the maximum en-hancement of the MTF while negating the effects that using a high threshold has on the DQE. However, we argue that the choice of threshold should depend upon the constraints imposed by individual experiments. In situations where spatial resolution is of paramount importance and where there are no dose constraints then a high threshold that optimises the MTF can be used. For example, a threshold of 101.7keV makes the GaAs:Cr detector an ideal detector in terms of its MTF operating in SPM for 200keV electrons, and the best MTF is obtained when using a threshold of 117.4keV. The value of MTF(ω N ) for these thresholds are 2.5 and 3.1 times that obtained with the lowest threshold (12.7keV) used. However, many of the experiments that DEDs enable are ones where dose is a constraint making detector efficiency key. In such cases the corresponding decrease in DQE(ω N ) to 19.7% and 9.3% of its maximum value when these thresholds are used is likely to be unacceptable, particularly when information at high ω is important.
One class of experiments where high-Z sensors are likely to be particularly useful are time-resolved experiments. By reducing the lateral spread in the signal produced by the primary electrons, the temporal resolution of HPDs should be also be improved at high energies, as the scattering of incident electrons over multiple pixels means they can be counted in multiple frames when using short frames times [12]. Other experimental modes that would benefit from the use of HPDs with high-Z sensors include 4D-STEM modes that depend on precise measurement of the deflection of disks in the diffraction pattern due to either transmitted or Bragg-diffracted electrons. Precise measurements of such deflections can be achieved by template-matching [16,56], and, in principal, this kind of analysis and the automation thereof would benefit from an improved detector PSF. An enhanced PSF would also be beneficial for diffraction-based experiments where it is desirable to maximise the scattering angle subtended by the detector, and hence sampling of reciprocal space, by using a short camera-length while still clearly distinguishing between closely spaced diffraction spots or disks.
In addition to these experimental modalities, there is scope for HPDs with high-Z sensors for applications requiring high spatial resolution and large fields-of-view if the entry point of incident electrons can be localised in a way that does not have a detrimental effect on DQE, particularly if this can be done to sub-pixel accuracy. With the exception of the Si detector for 60keV electrons, CSM fails to consistently identify the entry pixel for both devices, though there are cases for which using CSM could be regarded as advantageous. For instance, when using 200keV electrons, the low threshold GaAs:Cr CSM MTF(ω N ) is 0.43. The threshold at which the SPM MTF(ω N ) is equal to this is 62.7keV, at which DQE(0) is 0.68 and DQE(ω N ) is 0.18, while the low threshold CSM DQE(0) and DQE(ω N ) are 0.91 and 0.11. Using CSM is therefore able to provide a comparable MTF and high-frequency DQE while enhancing the low-frequency DQE compared with using SPM. Nevertheless, our results confirm the need for more sophisticated approaches to localise the entry point of the electron tailored to electrons with energies typically used in TEM. The ability of DEDs to distinguish between detector noise and incident electrons has enabled the identification of the entry point of the electron to sub-pixel accuracy with monolithic devices [22,35], and research into how to achieve superresolution with other types of DEDs is an active field [52,53]. Recent work with a Timepix3 detector with Si sensor has confirmed that it is possible to significantly enhance the MTF of HPDs for 200keV and 300keV electrons by identifying the entry pixel using a convolutional neural network [57]. However, it is not clear whether reducing the scatter of incident electrons in the sensor by using high-Z sensors will facilitate localisation of the entry point to sub-pixel accuracy, or if the loss of information about the electron trajectory will make this task more difficult.
Our work clarifies the advantages of a GaAs:Cr sensor compared to traditional Si sensors and also highlights the effects of the distortions that defects in the GaAs:Cr sensor introduce into the images recorded. Similar defects have been observed in other high-Z sensor materials, such as CdTe and CZT [58,59,60]. To maximise the potential benefits of high-Z sensors these defects must be addressed, either by correcting these by post-processing or by further fabrication development. Given the technical challenges improving the manufacture high-Z semiconductors suitable for radiation detection present, the former is a more viable solution in the short to mid-term.