A method of inspecting a sample by means of a system that comprises: - an arrangement adapted to make particles traverse the sample to be inspected, - a detector comprising: - a sensor layer having a surface exposed to receive the particles that have traversed the sample, whereby the particles hit the surface of the sensor layer one-by-one, and whereby a particle moves along an erratic track through the sensor layer losing its energy along the erratic track thereby generating electron-hole pairs within the sensor layer; and - an array of respective sensor circuits (301, 304; 302, 305; 303, 306) adapted to provide respective detection outputs indicative of electron-hole pairs generated at respective locations within the sensor layer, the method comprising: - an incident particle localization step in which respective detection outputs that the detector provides in response to an incident particle are processed so as to obtain a location identifier indicating where the incident particle has hit the surface of the sensor layer; and - an image forming step in which an image is generated on the basis of respective location identifiers that have been obtained in response to respective incident particles within an interval of time, wherein the incident particle localization step comprises: - a cluster identification step in which a cluster of respective locations within the sensor layer where electron-hole pairs have been generated is identified on the basis of the respective detection outputs; and - a location identification step in which a location where the particle has hit the surface of the sensor layer is determined on the basis of an evaluation of a set of respective detection outputs that are indicative of electron-hole pairs generated at the respective locations in the cluster, the evaluation being made with regard to pre-established respective associations between, on the one hand, respective locations where incident particles have hit the surface of the sensor layer and, on the other hand, respective sets of respective detection outputs indicative of electron-hole pairs generated at respective locations in respective clusters of locations. - an arrangement adapted to make particles traverse the sample to be inspected, - a detector comprising: - a sensor layer having a surface exposed to receive the particles that have traversed the sample, whereby the particles hit the surface of the sensor layer one-by-one, and whereby a particle moves along an erratic track through the sensor layer losing its energy along the erratic track thereby generating electron-hole pairs within the sensor layer; and - an array of respective sensor circuits (301, 304; 302, 305; 303, 306) adapted to provide respective detection outputs indicative of electron-hole pairs generated at respective locations within the sensor layer, - a sensor layer having a surface exposed to receive the particles that have traversed the sample, whereby the particles hit the surface of the sensor layer one-by-one, and whereby a particle moves along an erratic track through the sensor layer losing its energy along the erratic track thereby generating electron-hole pairs within the sensor layer; and - an array of respective sensor circuits (301, 304; 302, 305; 303, 306) adapted to provide respective detection outputs indicative of electron-hole pairs generated at respective locations within the sensor layer, - an incident particle localization step in which respective detection outputs that the detector provides in response to an incident particle are processed so as to obtain a location identifier indicating where the incident particle has hit the surface of the sensor layer; and - an image forming step in which an image is generated on the basis of respective location identifiers that have been obtained in response to respective incident particles within an interval of time, - a cluster identification step in which a cluster of respective locations within the sensor layer where electron-hole pairs have been generated is identified on the basis of the respective detection outputs; and - a location identification step in which a location where the particle has hit the surface of the sensor layer is determined on the basis of an evaluation of a set of respective detection outputs that are indicative of electron-hole pairs generated at the respective locations in the cluster, the evaluation being made with regard to pre-established respective associations between, on the one hand, respective locations where incident particles have hit the surface of the sensor layer and, on the other hand, respective sets of respective detection outputs indicative of electron-hole pairs generated at respective locations in respective clusters of locations.