The electron injector includes a needle insertion mechanism.This mechanism moves the needle from the first position above the surface of the patient's skin to the insertion direction, and the needle moves to the second position in which the needle pierces the patient's skin.The electron injector is mechanically coupled to the needle and includes a member moving when the needle moves.The electron injector includes a photodetector.The photodetector includes a substantially flat detection surface, detects the movement of the member based on the change of the image of the above described member reflected on the detection surface, and outputs a signal based on the change in the image.Further, the processor determines the position of the needle based on the output signal.When the needle moves, the image of the above described member changes.