A method for determining a position of interaction of a photon in an individual detector diode of a photon-counting edge-on x-ray detector, wherein the detector diode extends in the depth direction of the photon-counting edge-on x-ray detector, assuming x-rays enter through the edge, and has a thickness, in a direction substantially perpendicular to the depth direction, corresponding to a width of the diode, wherein the method comprises the step of determining the position of interaction in the line of the thickness of the detector diode by identifying in which one of atleast two different sub-regions located in different width sections between an anode and a cathode of the diode the photon interaction occurred based on pulse characteristics of a pulse generated at the cathode side or anode side of the individual detector diode in response to the photon interaction, wherein the step of determining the position of interaction in the detector diode comprises: performing signal processing of the pulse by applying at least one matched filter adapted for a specific pulse type corresponding to a specific position or sub-region of photon interaction in the detector diode to produce a filtered output signal of the matched filter, and identifying whether the pulse matches the pulse type based on the filtered output signal of the matched filter to decide whether the position of interaction corresponds to the specific position or sub-region of the specific pulse type for which the matched filter is adapted, whereby the position of interaction is estimated from the pulse characteristics of the pulse generated at the cathode side or anode side of the detector diode, without combining pulses from both sides. determining the position of interaction in the line of the thickness of the detector diode by identifying in which one of atleast two different sub-regions located in different width sections between an anode and a cathode of the diode the photon interaction occurred based on pulse characteristics of a pulse generated at the cathode side or anode side of the individual detector diode in response to the photon interaction, wherein the step of determining the position of interaction in the detector diode comprises: performing signal processing of the pulse by applying at least one matched filter adapted for a specific pulse type corresponding to a specific position or sub-region of photon interaction in the detector diode to produce a filtered output signal of the matched filter, and identifying whether the pulse matches the pulse type based on the filtered output signal of the matched filter to decide whether the position of interaction corresponds to the specific position or sub-region of the specific pulse type for which the matched filter is adapted, whereby the position of interaction is estimated from the pulse characteristics of the pulse generated at the cathode side or anode side of the detector diode, without combining pulses from both sides. performing signal processing of the pulse by applying at least one matched filter adapted for a specific pulse type corresponding to a specific position or sub-region of photon interaction in the detector diode to produce a filtered output signal of the matched filter, and identifying whether the pulse matches the pulse type based on the filtered output signal of the matched filter to decide whether the position of interaction corresponds to the specific position or sub-region of the specific pulse type for which the matched filter is adapted, whereby the position of interaction is estimated from the pulse characteristics of the pulse generated at the cathode side or anode side of the detector diode, without combining pulses from both sides.