A medical imaging system comprises an image data acquisition module to acquire imaging data and a motion detection module to acquire motion information. A reconstruction module reconstructs image datasets from the imaging data and with use of the motion information to correct for motion. The motion detection module is provided with a shape-sensing photonic fibre system to provide a photonic output representative of the spatial shape of the photonic fibre and an arithmetic unit to compute the motion information on the basis of the photonic output.