The present invention relates to a method and device for preventing metal artifacts computer tomography scans made during biopsy taking, when a metal needle is present in the field of view of a scan. The direction of the metal needle and the direction of the electro-magnetic field are determined in advance. For the determination of the electro-magnetic field a position of a source of the electro-magnetic field a position of a detector are considered. The user may be warned, when the determined direction of the electro-magnetic field and of the direction of the metallic needle correspond to each other.