Image copyright Wyss Center Image caption Kerstin Wirth was one of the people to take part in the trial

Patients with absolutely no control over their body have finally been able to communicate, say scientists.

A brain-computer interface was used to read the thoughts of patients to answer basic yes-or-no questions.

One man was able to repeatedly refuse permission for his daughter to get married.

The study on four patients in Germany- published in PLOS Biology - also showed they were happy despite the effects of being "locked-in".

The patients all had advanced forms of amyotrophic lateral sclerosis, in which the brain loses the ability to control muscles.

It eventually traps people in their own body - they are able to think, but incapable of moving or talking.

When they become "locked in", it can still be possible to develop ways of communication using eye movements.

But all the patients in the study were "completely locked in" and could not even move their eyes.

Trapped inside your own body: A doctor’s account

Brain signals

The activity of brain cells can change oxygen levels in the blood, which in turn changes the colour of the blood.

And scientists were able to peer inside the brain using light to detect the blood's colour, through a technique called near-infrared spectroscopy.

They then asked the patients yes-or-no questions such as: "Your husband's name is Joachim?" to train a computer to interpret the brain signals.

The system achieved an accuracy of about 75%.

It means questions need to be asked repeatedly in order to be certain of a patient's answer.

Prof Ujwal Chaudhary, from the Wyss Center in Switzerland where the work was pioneered, told BBC News: "It makes a great difference to their quality of life.

"Imagine if you had no means of communicating and then you could say yes or no - it makes a huge impact."

Insight

Patients who have recovered from locked-in syndrome say being able to communicate makes a huge difference.

Kate Allatt, became locked in for five months when she had a stroke at the age of 39.

Unlike the patients in this study, she became able to communicate when her friends asked her to blink once for yes or twice for no.

She told the BBC: "It was phenomenal, that moment if you could wrap every single Christmas, every single birthday, every single child you've ever held in your arms for the first time - that was how exciting it was."

In one case a daughter wanted the blessing of her completely locked-in father before marrying her boyfriend.

But eight times out of 10 the answer came back no.

"We don't know why he said no," said Prof Chaudhary.

"But they got married… nothing can come between love."

The form of communication is being used for more practical day-to-day means such as finding out if patients are in pain or want a family visit.

Prof John Donoghue, the director of the Wyss Center, told the BBC: "If a person who is totally locked-in is able to communicate, you're freeing the mind to interact with the world around them.

"That is remarkable."

Follow James on Twitter.