The invention relates to a medical imaging device (1), a system (1, 6), and a method for generating a motion-compensated image (13). The invention further relates to a corresponding method as well as a computer readable storage medium (8) having stored thereon a corresponding computer program. According to the present invention image data is captured and acquired while a deformable robotic instrument (6) is in contact with a subject (4, 5) to be imaged. A data processing means (7) is configured for compensating for a motion of the subject (4, 5) by processing the image data in dependence on time-resolved motion and/or geometry data of the robotic instrument (6), and/or by generating a control signal for controlling the robotic instrument (6) to counteract the motion of the subject (4, 5).