Brain scan patients could be diagnosed faster and avoid repeat appointments thanks to software developed by Scottish astronomers.

Magnetic Resonance Imaging (MRI) scanning can record images of parts of the body from several angles and is used to examine organs or tissue.

But patients having scans may have to lie still for 30 minutes or more while the scanner records successive layered images of their body. And if a patient moves, the images become distorted.

Now astronomers and clinicians at Edinburgh University have adapted an algorithm designed to process data from studies of distant galaxies for use in MRI scanning.

The astronomy algorithm corrects any distorted images, making it especially suited for use with children or the seriously ill, and could avoid patients having to undergo repeat scans to get accurate results.

Prof Alan Heavens from the university's department of theoretical astrophysics, said: 'We estimate that in two or three years this technology, derived from pure astronomy research, will be bringing benefits to patients.'