Scientists have found a way to trick the brain into thinking that it's sensing something that it isn't.

Using flashes of light to control neurons, researchers believe they can "copy and paste" real brain activity, paving the way for a future in which we can edit memories, delete pain or insert a non-existent image.

The technology is called a holographic brain modulator, and it uses holographic projections to activate or suppress individual neurons. The end goal is to control thousands of neurons at once in patterns that are based on real brain activity to replicate sensation.

The vision is a system that can constantly monitor brain activity and decide, based on context, which neurons to excite and suppress. Of course one might jump to thoughts of memory removal in Eternal Sunshine of the Spotless Mind, but the possibilities are much greater.

Imagine, for instance, a vision system for the blind consisting of a camera that could convert the images seen by its lens into the brain activity associated with seeing those images. Or a prosthetic limb that could convey a sense of touch.

"This has great potential for neural prostheses, since it has the precision needed for the brain to interpret the pattern of activation. If you can read and write the language of the brain, you can speak to it in its own language and it can interpret the message much better," said Alan Mardinly, molecular and cell biologist at UC Berkeley, and co-lead author on a new paper.

"This is one of the first steps in a long road to develop a technology that could be a virtual brain implant with additional senses or enhanced senses."

The holographic brain modulator is still in its early stages, but it shows promise, having been tested on laboratory mice.

A tiny three-dimensional section of the mouse brain with 2,000 to 3,000 neurons was the target. Each of those neurons was supplemented, via a virus that delivers DNA to the cell, with a protein that activates the neuron when it's hit with a flash of light.

Through a window in the mouse's skull that allows light to reach the brain, the researchers shone pulses of light - up to 300 times a second - each activating up to 50 neurons at once.

The big challenge was targeting individual cells. The team used computer generated holography, which bends and focuses light to create a 3D pattern. This was then projected onto the brain tissue on the surface of the somatosensory cortex in the mice - specifically, the touch, vision and motor centres.

"The major advance is the ability to control neurons precisely in space and time," said co-lead author Nicolas Pégard.

"In other words, to shoot the very specific sets of neurons you want to activate and do it at the characteristic scale and the speed at which they normally work."

The mice were walking on treadmills with their heads immobilised so that the targeting system would work, so no behavioural changes were observed. However, the brain activity of the mice, monitored in real time, was the same as if it was responding to a real sensory stimulus, the researchers said.

Of course, there's still a lot of work to be done. The technology only works on a very small part of the brain currently, and the equipment to do so is huge. The technology can be scaled up to target more of the brain's outer layer, the team noted, and eventually the size of the equipment will be able to be miniaturised to fit into a backpack.

The next steps, however, are about improving the research. This means training the mice so that the researchers can detect changes in their behaviour after brain modulation.

It also means recording real patterns of brain activity in the cortex so that they can then play them back using the holographic brain modulator to see if they elicit the same response.

The team's research has been published in the journal Nature.