A medical imaging device, a system, and a method for generating a motion-compensated image are provided. A corresponding method as well as a computer readable storage medium having stored thereon a corresponding computer program are also provided. Image data is captured and acquired while a deformable robotic instrument is in contact with a subject to be imaged. A data processor is configured to compensate for a motion of the subject by processing the image data in dependence on time-resolved motion and/or geometry data of the robotic instrument, and/or by generating a control signal for controlling the robotic instrument to counteract the motion of the subject.