Patent Description:
X-ray fluorescence (XRF) is the emission of characteristic fluorescent X-rays from a material that has been excited by, for example, exposure to high-energy X-rays or gamma rays. An electron on an inner orbital of an atom may be ejected, leaving a vacancy on the inner orbital, if the atom is exposed to X-rays or gamma rays with photon energy greater than the ionization potential of the electron. When an electron on an outer orbital of the atom relaxes to fill the vacancy on the inner orbital, an X-ray (fluorescent X-ray or secondary X-ray) is emitted. The emitted X-ray has a photon energy equal the energy difference between the outer orbital and inner orbital electrons.

For a given atom, the number of possible relaxations is limited. As shown in <FIG>, when an electron on the L orbital relaxes to fill a vacancy on the K orbital (L→K), the fluorescent X-ray is called Kα. The fluorescent X-ray from M→K relaxation is called Kβ. As shown in <FIG>, the fluorescent X-ray from M→L relaxation is called Lα, and so on.

Analyzing the fluorescent X-ray spectrum can identify the elements in a sample because each element has orbitals of characteristic energy. The fluorescent X-ray can be analyzed either by sorting the energies of the photons (energy-dispersive analysis) or by separating the wavelengths of the fluorescent X-ray (wavelength-dispersive analysis). The intensity of each characteristic energy peak is directly related to the amount of each element in the sample.

Proportional counters or various types of solid-state detectors (PIN diode, Si(Li), Ge(Li), Silicon Drift Detector SDD) may be used in energy dispersive analysis. These detectors are based on the same principle: an incoming X-ray photon ionizes a large number of detector atoms with the amount of charge carriers produced being proportional to the energy of the incoming X-ray photon. The charge carriers are collected and counted to determine the energy of the incoming X-ray photon and the process repeats itself for the next incoming X-ray photon. After detection of many X-ray photons, a spectrum may be compiled by counting the number of X-ray photons as a function of their energy. The speed of these detectors is limited because the charge carriers generated by one incoming X-ray photon must be collected before the next incoming X-ray hits the detector.

Wavelength dispersive analysis typically uses a photomultiplier. The X-ray photons of a single wavelength are selected from the incoming X-ray a monochromator and are passed into the photomultiplier. The photomultiplier counts individual X-ray photons as they pass through. The counter is a chamber containing a gas that is ionizable by X-ray photons. A central electrode is charged at (typically) +<NUM> V with respect to the conducting chamber walls, and each X-ray photon triggers a pulse-like cascade of current across this field. The signal is amplified and transformed into an accumulating digital count. These counts are used to determine the intensity of the X-ray at the single wavelength selected.

<CIT> discloses a method and system for operating a radiation detector comprising an array of detector elements as a single large area radiation detector. Each detector element generates an output indicative of an electrical pulse amplitude when exposed to a radiation event. Each output signal indicative of an electrical pulse amplitude from each detector element is computationally processed to generate a single summing histogram representative of the sum of the output signals received from all detector elements being combined. The document <CIT> discloses a radiographic imaging apparatus including a radiographic source configured to emit radiographic rays in a discontinuous eigen energy spectrum, a radiographic detector configured to receive the radiographic rays, convert the received radiographic rays into electrical signals, and count the number of photons having energy that exceeds a threshold energy, and a controller configured to adjust the threshold energy by comparing an energy spectrum of the detected radiographic rays with the eigen energy spectrum of the emitted radiographic rays from the radiographic source.

According to a first aspect of the present invention, there is provided a detector, comprising: a plurality of pixels, each pixel configured to count numbers of X-ray photons incident thereon whose energy falls in a plurality of bins of different energy ranges respectively, within a period of time; and wherein the detector is configured to sum the numbers counted by all the pixels from the bins of the same energy range; and wherein the detector further comprises:an X-ray absorption layer comprising an electric contact; a first voltage comparator configured to compare a voltage of the electric contact to a first threshold; a second voltage comparator configured to compare the voltage to a second threshold; a controller; a plurality of counters each associated with a bin and configured to register a number of X-ray photons absorbed by one of the pixels wherein the energy of the X-ray photons falls in the bin; wherein the controller is configured to start a time delay from a time at which the first voltage comparator determines that an absolute value of the voltage equals or exceeds an absolute value of the first threshold; wherein the controller is configured to determine whether an energy of an X-ray photon falls into the bin; and wherein the controller is configured to cause the number registered by the counter associated with the bin to increase by one.

According to an embodiment, the detector is further configured to compile the added numbers as a spectrum of the X-ray photons incident on the detector.

According to an embodiment, the plurality of pixels area arranged in an array.

According to an embodiment, the pixels are configured to count the numbers of X-ray photons within a same period of time.

According to an embodiment, each of the pixels comprises an analog-to-digital converter (ADC) configured to digitize an analog signal representing the energy of an incident X-ray photon into a digital signal.

According to an embodiment, the pixels are configured to operate in parallel.

According to an embodiment, each of the pixels is configured to measure its dark current.

According to an embodiment, each of the pixels is configured to measure its dark current before or concurrently with each X-ray photon incident thereon.

According to an embodiment, each of the pixels is configured to deduct a contribution of the dark current from the energy of an X-ray photon incident thereon.

According to an embodiment, each of the pixels is configured to measure its dark current by measuring a time it takes for a voltage to increase by a threshold.

According to an embodiment, the ADC is a successive-approximation-register (SAR) ADC.

According to an embodiment, the detector further comprises a capacitor module electrically connected to the electric contact, wherein the capacitor module is configured to collect charge carriers from the electric contact.

According to an embodiment, the controller is configured to activate the second voltage comparator at a beginning or expiration of the time delay.

According to an embodiment, the controller is configured to connect the electric contact to an electrical ground.

According to an embodiment, a rate of change of the voltage is substantially zero at expiration of the time delay.

According to an embodiment, the X-ray absorption layer comprises a diode.

The detector of claim <NUM>, wherein the X-ray absorption layer comprises silicon, germanium, GaAs, CdTe, CdZnTe, or a combination thereof.

According to an embodiment, the apparatus does not comprise a scintillator.

According to a second aspect of the present invention, there is provided a method for measuring an energy spectrum of X-ray, comprising: exposing a detector with a plurality of pixels to X-ray; determining a number of X-ray photons for each pixel for one of a plurality of bins of different energy ranges respectively, wherein energy of the X-ray photon falls in the one bin; summing the numbers counted by all the pixels from the bins of a same energy range; wherein the step of determining further comprises: comparing, with a first voltage comparator, a voltage of an electric contact of an X-ray absorption layer of the detector to a first threshold; comparing, with a second voltage comparator, the voltage to a second threshold; registering, with a plurality of counters each associated with a bin, a number of X-ray photons absorbed by one of the pixels wherein the energy of the X-ray photons falls in the bin; starting, with a controller, a time delay from a time at which the first voltage comparator determines that an absolute value of the voltage equals or exceeds an absolute value of the first threshold; determining, with the controller, whether an energy of an X-ray photon falls into the bin; and causing, with the controller, the number registered by the counter associated with the bin to increase by one.

According to an embodiment, determining the number comprises subtracting a contribution of dark current in the each pixel.

According to an embodiment, determining the number comprises analog-to-digital conversion.

<FIG> schematically shows a detector <NUM> suitable for XRF, according to an embodiment. The detector has an array of pixels <NUM>. The array may be a rectangular array, a honeycomb array, a hexagonal array or any other suitable array. Each pixel <NUM> is configured to detect an X-ray photon incident thereon and measure the energy of the X-ray photon. For example, each pixel <NUM> is configured to count numbers of X-ray photons incident thereon whose energy falls in a plurality of bins, within a period of time. All the pixels <NUM> may be configured to count the numbers of X-ray photons incident thereon within a plurality of bins of energy within the same period of time. Each pixel <NUM> may have its own analog-to-digital converter (ADC) configured to digitize an analog signal representing the energy of an incident X-ray photon into a digital signal. For XRF applications, an ADC with a <NUM>-bit resolution or higher is useful. Each pixel <NUM> may be configured to measure its dark current, such as before or concurrently with each X-ray photon incident thereon. Each pixel <NUM> may be configured to deduct the contribution of the dark current from the energy of the X-ray photon incident thereon. The pixels <NUM> may be configured to operate in parallel. For example, when one pixel <NUM> measures an incident X-ray photon, another pixel <NUM> may be waiting for an X-ray photon to arrive. The pixels <NUM> may not have to be individually addressable.

The detector <NUM> may have at least <NUM>, <NUM>, <NUM>, or more pixels <NUM>. The detector <NUM> may be configured to add the numbers of X-ray photons for the bins of the same energy range counted by all the pixels <NUM>. For example, the detector <NUM> may add the numbers the pixels <NUM> stored in a bin for energy from <NUM> KeV to <NUM> KeV, add the numbers the pixels <NUM> stored in a bin for energy from <NUM> KeV to <NUM> KeV, and so on. The detector <NUM> may compile the added numbers for the bins as a spectrum of the X-ray photons incident on the detector <NUM>.

<FIG> schematically shows a block diagram for the detector <NUM>, according to an embodiment. Each pixel <NUM> may measure the energy <NUM> of an X-ray photon incident thereon. The energy <NUM> of the X-ray photon is digitized (e.g., by an ADC) in step <NUM> into one of a plurality of bins 153A, 153C, 153C. The bins 153A, 153C, 153C. each have a corresponding counter 154A, 154B and 154C, respectively. When the energy <NUM> is allocated into a bin, the number stored in the corresponding counter increases by one. The detector <NUM> may added the numbers stored in all the counters corresponding to bins for the same energy range in the pixels <NUM>. For example, the numbers stored in all the counters 154C in all pixels <NUM> may be added and stored in a global counter 100C for the same energy range. The numbers stored in all the global counters may be compiled into an energy spectrum of the X-ray incident on the detector <NUM>.

<FIG> schematically shows a cross-sectional view of the detector <NUM>, according to an embodiment. The detector <NUM> includes an X-ray absorption layer <NUM> and may include an electronics layer <NUM> (e.g., an ASIC) for processing or analyzing electrical signals incident X-ray generates in the X-ray absorption layer <NUM>. In an embodiment, the detector <NUM> does not comprise a scintillator. The X-ray absorption layer <NUM> may include a semiconductor material such as, silicon, germanium, GaAs, CdTe, CdZnTe, or a combination thereof. The semiconductor may have a high mass attenuation coefficient for the X-ray energy of interest.

As shown in a detailed cross-sectional view of the detector <NUM> in <FIG>, according to an embodiment, the X-ray absorption layer <NUM> may include one or more diodes (e.g., p-i-n or p-n) formed by a first doped region <NUM>, one or more discrete regions <NUM> of a second doped region <NUM>. The second doped region <NUM> may be separated from the first doped region <NUM> by an optional the intrinsic region <NUM>. The discrete portions <NUM> are separated from one another by the first doped region <NUM> or the intrinsic region <NUM>. The first doped region <NUM> and the second doped region <NUM> have opposite types of doping (e.g., region <NUM> is p-type and region <NUM> is n-type, or region <NUM> is n-type and region <NUM> is p-type). In the example in <FIG>, each of the discrete regions <NUM> of the second doped region <NUM> forms a diode with the first doped region <NUM> and the optional intrinsic region <NUM>. Namely, in the example in <FIG>, the X-ray absorption layer <NUM> has a plurality of diodes having the first doped region <NUM> as a shared electrode. The first doped region <NUM> may also have discrete portions.

When an X-ray photon hits the X-ray absorption layer <NUM> including diodes, the X-ray photon may be absorbed and generate one or more charge carriers by a number of mechanisms. An X-ray photon may generate <NUM> to <NUM> charge carriers. The charge carriers may drift to the electrodes of one of the diodes under an electric field. The field may be an external electric field. The electrical contact 119B may include discrete portions each of which is in electrical contact with the discrete regions <NUM>. In an embodiment, the charge carriers may drift in directions such that the charge carriers generated by a single X-ray photon are not substantially shared by two different discrete regions <NUM> ("not substantially shared" here means less than <NUM>%, less than <NUM>%, less than <NUM>%, or less than <NUM>% of these charge carriers flow to a different one of the discrete regions <NUM> than the rest of the charge carriers). Charge carriers generated by an X-ray photon incident around the footprint of one of these discrete regions <NUM> are not substantially shared with another of these discrete regions <NUM>. A pixel <NUM> associated with a discrete region <NUM> may be an area around the discrete region <NUM> in which substantially all (more than98%, more than <NUM>%, more than <NUM>%, or more than <NUM>% of) charge carriers generated by an X-ray photon incident therein flow to the discrete region <NUM>. Namely, less than <NUM>%, less than <NUM>%, less than <NUM>%, or less than <NUM>% of these charge carriers flow beyond the pixel.

As shown in an alternative detailed cross-sectional view of the detector <NUM> in <FIG>, according to an embodiment, the X-ray absorption layer <NUM> may include a resistor of a semiconductor material such as, silicon, germanium, GaAs, CdTe, CdZnTe, or a combination thereof, but does not include a diode. The semiconductor may have a high mass attenuation coefficient for the X-ray energy of interest.

When an X-ray photon hits the X-ray absorption layer <NUM> including a resistor but not diodes, it may be absorbed and generate one or more charge carriers by a number of mechanisms. An X-ray photon may generate <NUM> to <NUM> charge carriers. The charge carriers may drift to the electrical contacts 119A and 119B under an electric field. The field may be an external electric field. The electrical contact 119B includes discrete portions. In an embodiment, the charge carriers may drift in directions such that the charge carriers generated by a single X-ray photon are not substantially shared by two different discrete portionsof the electrical contact 119B ("not substantially shared" here means less than <NUM>%, less than <NUM>%, less than <NUM>%, or less than <NUM>% of these charge carriers flow to a different one of the discrete portions than the rest of the charge carriers). Charge carriers generated by an X-ray photon incident around the footprint of one of these discrete portions of the electrical contact 119B are not substantially shared with another of these discrete portions of the electrical contact 119B. A pixel <NUM> associated with a discrete portion of the electrical contact 119B may be an area around the discrete portion in which substantially all (more than98%, more than <NUM>%, more than <NUM>% or more than <NUM>% of) charge carriers generated by an X-ray photon incident therein flow to the discrete portion of the electrical contact 119B. Namely, less than <NUM>%, less than <NUM>%, less than <NUM>%, or less than <NUM>% of these charge carriers flow beyond the pixel associated with the one discrete portion of the electrical contact 119B.

The electronics layer <NUM> may include an electronic system <NUM> suitable for processing or interpreting signals generated by X-ray photons incident on the X-ray absorption layer <NUM>. The electronic system <NUM> may include an analog circuitry such as a filter network, amplifiers, integrators, and comparators, or a digital circuitry such as a microprocessors, and memory. The electronic system <NUM> may include components shared by the pixels or components dedicated to a single pixel. For example, the electronic system <NUM> may include an amplifier dedicated to each pixel and a microprocessor shared among all the pixels. The electronic system <NUM> may be electrically connected to the pixels by vias <NUM>. Space among the vias may be filled with a filler material <NUM>, which may increase the mechanical stability of the connection of the electronics layer <NUM> to the X-ray absorption layer <NUM>. Other bonding techniques are possible to connect the electronic system <NUM> to the pixels without using vias.

<FIG> and <FIG> each show a component diagram of the electronic system <NUM>, according to an embodiment. The electronic system <NUM> includes a first voltage comparator <NUM>, a second voltage comparator <NUM>, a plurality of counters <NUM> (including counters 320A, 320B, 320C, 320D. ), and a controller <NUM>, and may include a switch <NUM> and an ADC <NUM>.

The first voltage comparator <NUM> is configured to compare the voltage of a discrete portion of the electric contact 119B to a first threshold. The first voltage comparator <NUM> may be configured to monitor the voltage directly, or calculate the voltage by integrating an electric current flowing through the diode or electrical contact over a period of time. The first voltage comparator <NUM> may be controllably activated or deactivated by the controller <NUM>. The first voltage comparator <NUM> may be a continuous comparator. Namely, the first voltage comparator <NUM> may be configured to be activated continuously, and monitor the voltage continuously. The first voltage comparator <NUM> configured as a continuous comparator reduces the chance that the system <NUM> misses signals generated by an incident X-ray photon. The first voltage comparator <NUM> configured as a continuous comparator is especially suitable when the incident X-ray intensity is relatively high. The first voltage comparator <NUM> may be a clocked comparator, which has the benefit of lower power consumption. The first voltage comparator <NUM> configured as a clocked comparator may cause the system <NUM> to miss signals generated by some incident X-ray photons. When the incident X-ray intensity is low, the chance of missing an incident X-ray photon is low because the time interval between two successive photons is relatively long. Therefore, the first voltage comparator <NUM> configured as a clocked comparator is especially suitable when the incident X-ray intensity is relatively low. The first threshold may be <NUM>-<NUM>%, <NUM>-<NUM>%, <NUM>%-<NUM>%, <NUM>-<NUM>%, <NUM>-<NUM>% or <NUM>-<NUM>% of the maximum voltage one incident X-ray photon may generate on the electric contact 119B. The maximum voltage may depend on the energy of the incident X-ray photon (i.e., the wavelength of the incident X-ray), the material of the X-ray absorption layer <NUM>, and other factors. For example, the first threshold may be <NUM> mV, <NUM> mV, <NUM> mV, or <NUM> mV.

The second voltage comparator <NUM> is configured to compare the voltage to a second threshold. The second voltage comparator <NUM> may be configured to monitor the voltage directly, or calculate the voltage by integrating an electric current flowing through the diode or the electrical contact over a period of time. The second voltage comparator <NUM> may be a continuous comparator. The second voltage comparator <NUM> may be controllably activate or deactivated by the controller <NUM>. When the second voltage comparator <NUM> is deactivated, the power consumption of the second voltage comparator <NUM> may be less than <NUM>%, less than <NUM>%, less than <NUM>% or less than <NUM>% of the power consumption when the second voltage comparator <NUM> is activated. The absolute value of the second threshold is greater than the absolute value of the first threshold. As used herein, the term "absolute value" or "modulus" |x| of a real number x is the non-negative value of x without regard to its sign. Namely, <MAT>. The second threshold may be <NUM>%-<NUM>% of the first threshold. For example, the second threshold may be <NUM> mV, <NUM> mV, <NUM> mV, <NUM> mV or <NUM> mV. The second voltage comparator <NUM> and the first voltage comparator <NUM> may be the same component. Namely, the system <NUM> may have one voltage comparator that can compare a voltage with two different thresholds at different times.

The first voltage comparator <NUM> or the second voltage comparator <NUM> may include one or more op-amps or any other suitable circuitry. The first voltage comparator <NUM> or the second voltage comparator <NUM> may have a high speed to allow the system <NUM> to operate under a high flux of incident X-ray. However, having a high speed is often at the cost of power consumption.

The counters <NUM> may be a software component (e.g., numbers stored in a computer memory) or a hardware component (e.g., <NUM> IC and <NUM> IC). Each counter <NUM> is associated with a bin for an energy range. For example, counter 320A may be associated with a bin for <NUM>-<NUM> KeV, counter 320B may be associated with a bin for <NUM>-<NUM> KeV,counter 320C may be associated with a bin for <NUM>-<NUM> KeV,counter 320D may be associated with a bin for <NUM>-<NUM> KeV. When the energy of an incident X-ray photons is determined by the ADC <NUM> to be in the bin a counter <NUM> is associated with, the number registered in the counter <NUM> is increased by one.

The controller <NUM> may be a hardware component such as a microcontroller and a microprocessor. The controller <NUM> is configured to start a time delay from a time at which the first voltage comparator <NUM> determines that the absolute value of the voltage equals or exceeds the absolute value of the first threshold (e.g., the absolute value of the voltage increases from below the absolute value of the first threshold to a value equal to or above the absolute value of the first threshold). The absolute value is used here because the voltage may be negative or positive, depending on whether the voltage of the cathode or the anode of the diode or which electrical contact is used. The controller <NUM> may be configured to keep deactivated the second voltage comparator <NUM>, the counter <NUM> and any other circuits the operation of the first voltage comparator <NUM> does not require, before the time at which the first voltage comparator <NUM> determines that the absolute value of the voltage equals or exceeds the absolute value of the first threshold. The time delay may expire after the voltage becomes stable, i.e., the rate of change of the voltage is substantially zero. The phase "the rate of change is substantially zero" means that temporal change is less than <NUM>%/ns. The phase "the rate of change is substantially non-zero" means that temporal change of the voltage is at least <NUM>%/ns.

The controller <NUM> may be configured to activate the second voltage comparator during (including the beginning and the expiration) the time delay. In an embodiment, the controller <NUM> is configured to activate the second voltage comparator at the beginning of the time delay. The term "activate" means causing the component to enter an operational state (e.g., by sending a signal such as a voltage pulse or a logic level, by providing power, etc.). The term "deactivate" means causing the component to enter a non-operational state (e.g., by sending a signal such as a voltage pulse or a logic level, by cut off power, etc.). The operational state may have higher power consumption (e.g., <NUM> times higher, <NUM> times higher, <NUM> times higher) than the non-operational state. The controller <NUM> itself may be deactivated until the output of the first voltage comparator <NUM> activates the controller <NUM> when the absolute value of the voltage equals or exceeds the absolute value of the first threshold.

The controller <NUM> may be configured to cause the number registered by one of the counters <NUM> to increase by one, if, during the time delay, the second voltage comparator <NUM> determines that the absolute value of the voltage equals or exceeds the absolute value of the second threshold, and the energy of the X-ray photon falls in the bin associated with the counter <NUM>.

The controller <NUM> may be configured to cause the ADC <NUM> to digitize the voltage upon expiration of the time delay and determine based on the voltage which bin the energy of the X-ray photon falls in.

The controller <NUM> may be configured to connect the electric contact 119B to an electrical ground, so as to reset the voltage and discharge any charge carriers accumulated on the electric contact 119B. In an embodiment, the electric contact 119Bis connected to an electrical ground after the expiration of the time delay. In an embodiment, the electric contact 119Bis connected to an electrical ground for a finite reset time period. The controller <NUM> may connect the electric contact 119Bto the electrical ground by controlling the switch <NUM>. The switch may be a transistor such as a field-effect transistor (FET).

In an embodiment, the system <NUM> has no analog filter network (e.g., a RC network). In an embodiment, the system <NUM> has no analog circuitry.

The ADC <NUM> may feed the voltage it measures to the controller <NUM> as an analog or digital signal. The ADC may be a successive-approximation-register (SAR) ADC (also called successive approximation ADC). An SAR ADCdigitizes an analog signal via a binary search through all possible quantization levels before finally converging upon a digital output for the analog signal. An SAR ADCmay have four main subcircuits: a sample and hold circuit to acquire the input voltage (Vin), an internal digital-analog converter (DAC) configured to supply an analog voltage comparator with an analog voltage equal to the digital code output of the successive approximation register (SAR), the analog voltage comparator that compares Vin to the output of the internal DAC and outputs the result of the comparison to the SAR, the SAR configured to supply an approximate digital code of Vin to the internal DAC. The SAR may be initialized so that the most significant bit (MSB) is equal to a digital <NUM>. This code is fed into the internal DAC, which then supplies the analog equivalent of this digital code (Vref/<NUM>) into the comparator for comparison with Vin. If this analog voltage exceeds Vin the comparator causes the SAR to reset this bit; otherwise, the bit is left a <NUM>. Then the next bit of the SAR is set to <NUM> and the same test is done, continuing this binary search until every bit in the SAR has been tested. The resulting code is the digital approximation of Vinand is finally output by the SAR at the end of the digitization.

The system <NUM> may include a capacitor module 309electrically connected to the electric contact 119B, wherein the capacitor module is configured to collect charge carriers from the electric contact 119B. The capacitor module caninclude a capacitor in the feedback path of an amplifier. The amplifier configured as such is called a capacitive transimpedance amplifier (CTIA). CTIA has high dynamic range by keeping the amplifier from saturating and improves the signal-to-noise ratio by limiting the bandwidth in the signal path. Charge carriers from the electrode accumulate on the capacitor over a period of time ("integration period") (e.g., as shown in <FIG>, between tS to t<NUM>). After the integration period has expired, the capacitor voltage is sampled by the ADC <NUM> and then reset by a reset switch. The capacitor module 309can include a capacitor directly connected to the electric contact 119B.

<FIG> schematically shows a temporal change of the electric current flowing through the electric contact 119B (upper curve) caused by charge carriers generated by an X-ray photon incident on the pixel <NUM> associated with the electric contact 119B, and a corresponding temporal change of the voltage of the electric contact 119B (lower curve). The voltage may be an integral of the electric current with respect to time. At time t<NUM>, the X-ray photon hits the diode or the resistor, charge carriers start being generated in the pixel <NUM>, electric current starts to flow through the electric contact 119B, and the absolute value of the voltage of theelectric contact 119Bstarts to increase. At time t<NUM>, the first voltage comparator <NUM> determines that the absolute value of the voltage equals or exceeds the absolute value of the first threshold V1, and the controller <NUM> starts the time delay TD1 and the controller <NUM> may deactivate the first voltage comparator <NUM> at the beginning of TD1. If the controller <NUM> is deactivated before t<NUM>, the controller <NUM> is activated at t<NUM>. During TD1, the controller <NUM> activates the second voltage comparator <NUM>. The term "during" a time delay as used here means the beginning and the expiration (i.e., the end) and any time in between. For example, the controller <NUM> may activate the second voltage comparator <NUM> at the expiration of TD1. If during TD1, the second voltage comparator <NUM> determines that the absolute value of the voltage equals or exceeds the absolute value of the second threshold at time t<NUM>, the controller <NUM> waits for stabilization of the voltage to stabilize. The voltage stabilizes at time te, when all charge carriersgenerated by the X-ray photon drift out of the X-ray absorption layer <NUM>. At time ts, the time delay TD1 expires. At or after time te, the controller <NUM> causesthe ADC <NUM> to digitize the voltage and determines which bin the energy of the X-ray photons falls in. The controller <NUM> then causes the number registered by the counter <NUM> corresponding to the bin to increase by one. In the example of <FIG>, time ts is after time te; namely TD1 expires after all charge carriersgenerated by the X-ray photon drift out of the X-ray absorption layer <NUM>. If time te cannot be easily measured, TD1 can be empirically chosen to allow sufficient time to collect essentially all charge carriers generated by an X-ray photon but not too long to risk have another incident X-ray photon. Namely, TD1 can be empirically chosen so that time ts is empirically after time te. Time ts is not necessarily after time te because the controller <NUM> may disregard TD1 once V2 is reached and wait for time te. The rate of change of the difference between the voltage and the contribution to the voltage by the dark current is thus substantially zero at te. The controller <NUM> may be configured to deactivate the second voltage comparator <NUM> at expiration of TD1 or at t<NUM>, or any time in between.

The voltage at time teis proportional to the amount of charge carriers generated by the X-ray photon, which relates to the energy of the X-ray photon. The controller <NUM> may be configured to determine the bin the energy of the X-ray photon falls in, based on the output ofthe ADC <NUM>.

After TD1 expires or digitization by the ADC <NUM>, whichever later, the controller <NUM> connects the electric contact 119Bto an electric ground for a reset period RST to allow charge carriers accumulated on the electric contact 119Bto flow to the ground and reset the voltage. After RST, the system <NUM> is ready to detect another incident X-ray photon. Implicitly, the rate of incident X-ray photons the system <NUM> can handle in the example of <FIG> is limited by <NUM>/(TD1+RST). If the first voltage comparator <NUM> has been deactivated, the controller <NUM> can activate it at any time before RST expires. If the controller <NUM> has been deactivated, it may be activated before RST expires.

Because the detector <NUM> has many pixels <NUM> that may operate in parallel, the detector can handle much higher rate of incident X-ray photons. This is because the rate of incidence on a particular pixel <NUM> is <NUM>/N of the rate of incidence on the entire array of pixels, where N is the number of pixels.

<FIG> shows an example flow chart for step <NUM> in <FIG>, according to an embodiment. In step <NUM>, compare, e.g., using the first voltage comparator <NUM>, a voltage of an electric contact 119B of a diode or a resistor exposed to X-ray photons (e.g., fluorescent X-ray), to the first threshold. In step <NUM>, determine, e.g., with the controller <NUM>, whether the absolute value of the voltage equals or exceeds the absolute value of the first threshold V1. If the absolute value of the voltage does not equal or exceed the absolute value of the first threshold, the method goes back to step <NUM>. If the absolute value of the voltage equals or exceeds the absolute value of the first threshold, continue to step <NUM>. In step <NUM>, measure T=(t<NUM>-t<NUM>). In step <NUM>, start, e.g., using the controller <NUM>, the time delay TD1. In step <NUM>, compare, e.g., using the second voltage comparator <NUM>, the voltage to the second threshold. In step <NUM>, determine, e.g., using the controller <NUM>, whether the absolute value of the voltage equals or exceeds the absolute value of the second threshold V2. If the absolute value of the voltage does not equal or exceed the absolute value of the second threshold, the method goes to step <NUM>. In step <NUM>, measure the contribution of the dark current to the voltage using T. In an example,determine whether T is greater than the largest T previously measured (Tmax). Tmax=<NUM> if T is not previously measured. If T is greater than Tmax, replace Tmax with T (i.e., T becomes the new Tmax). The contribution of the dark current to the voltage is at a rate of V1/Tmax. If the dark current is measured as in this example, the contribution of the dark current in step <NUM> is ((tm-tr)·V1/Tmax), where tr is the end of the last reset period. (tm-tr), like any time intervals in this disclosure, can be measured by counting pulses (e.g., counting clock cycles or clock pulses). Tmax may be reset to zero before each measurement with the detector <NUM>. T may be measured by counting the number of pulses between t<NUM> and t<NUM>, as schematically shown in <FIG> and <FIG>. Another way to measure the contribution of the dark current to the voltage using T includes extracting a parameter of the distribution of T (e.g., the expected value of T (Texpected)) and estimate the rate of the contribution of the dark current to the voltage as V1/Texpected. In step <NUM>, reset the voltage to an electrical ground, e.g., by connecting the electric contact 119B to an electrical ground. If the absolute value of the voltage equals or exceeds the absolute value of the second threshold, continue to step <NUM>. In step <NUM>, measure the voltage after it stabilizes, at time tm, and subtract an contribution from a dark current to the measured voltage. Time tm can be any time after TD1 expires and before RST. The result is provided to ADC in step <NUM> in <FIG> The time when the reset period ends (e.g., the time when the electric contact 119B is disconnected from the electrical ground) is tr.

<FIG> schematically shows a temporal change of the voltage of the electric contact 119B caused by the dark current, according to an embodiment. After RST, the voltage increase due to the dark current. The higher the dark current, the less time it takes for the voltage to reach V1 (namely shorter T). Therefore, T is a measure of the dark current. The dark current is unlikely large enough to cause the voltage to reach V2 during TD1 but current caused by an incident X-ray photon is probably large enough to do so. This difference may be used to identify the effect of the dark current. The flow in <FIG> may be carried out in each pixel <NUM> as the pixel <NUM> measures a series of incident X-ray photons, which will allow capturing the changes of the dark current (e.g., caused by changing environment such as temperature).

Claim 1:
A detector (<NUM>), comprising:
a plurality of pixels (<NUM>), each pixel configured to count numbers of X-ray photons incident thereon whose energy falls in a plurality of bins of different energy ranges respectively, within a period of time;
wherein the detector is configured to sum the numbers counted by all the pixels from the bins of the same energy range; and wherein the detector further comprises:
an X-ray absorption layer (<NUM>) comprising an electric contact (119B);
a first voltage comparator (<NUM>) configured to compare a voltage of the electric contact to a first threshold;
a second voltage comparator (<NUM>) configured to compare the voltage to a second threshold;
a controller (<NUM>);
a plurality of counters (<NUM>) each associated with a bin and configured to register a number of X-ray photons absorbed by one of the pixels wherein the energy of the X-ray photons falls in the bin;
wherein the controller is configured to start a time delay from a time at which the first voltage comparator determines that an absolute value of the voltage equals or exceeds an absolute value of the first threshold;
wherein the controller is configured to determine whether an energy of an X-ray photon falls into the bin; and
wherein the controller is configured to cause the number registered by the counter associated with the bin to increase by one.