You may have never seen a zebrafish in person. But take a look at the zebrafish in the short video above and you’ll get to see something previously unknown to science: a visual representation of a thought moving through a living creature’s brain.

A group of scientists from Japan’s National Institute of Genetics announced the mind-boggling achievement in a paper published today in Current Biology. By inserting a gene into a zebrafish larvae—often used in research because its entire body is transparent—and using probe that detects florescence, they were able to capture the fish’s mental reaction to a swimming paramecium in real time.

The key to the technology is a special gene known as GCaMP that reacts to the presence of calcium ions by increasing in florescence. Since neuron activity in the brain involves rapid increases in concentrations of calcium ions, insertion of the gene causes the particular areas in a zebrafish’s brain that are activated to glow brightly. By using a probe sensitive to florescence, the scientists were able to monitor the locations of the fish’s brain that were activated ay any given moment—and thus, capture the fish’s thought as it “swam” around the brain.

The particular thought captured in the video above occurred after a paramecium (a single-celled organism that the fish considers a food source) was released into the fish’s environment. The scientists know that the thought is the fish’s direct response to the moving paramecium because, as an initial part of the experiment, they identified the particular neurons in the fish’s brain that respond to movement and direction.

They mapped out the individual neurons responsible for this task by inducing the fish to visually follow a dot move across a screen and tracking which neurons were activated. Later, when they did the same for the fish as it watched the swimming paramecium, the same areas of the brain lit up, and the activity moved across these areas in the same way predicted by the mental maps as a result of the paramecium’s directional movement. For example, when the paramecium moved from right to left, the neuron activity moved from left to right, because of the way the brain’s visual map is reversed when compared to the field of vision.

This isn’t the first time that GCaMP has been inserted into a zebrafish for imaging purposes, but it is the first time that the images have been captured as a real-time video, rather than a static image after the fact. The researchers accomplished this by developing an improved version of GCaMP that is more sensitive to changes in calcium ion concentration and gives off greater levels of florescence.

The accomplishment is obviously a marvel in itself, but the scientists involved see it leading to a range of practical applications. If, for example, scientists had the ability to quickly map the parts of the brain affected by a chemical under consideration as a drug, new and effective psychiatric medications could be more easily developed.

They also envision it opening the door to a variety of even more amazing—and perhaps a bit troubling (who, after all, really wants their mind read?)—thought-detecting applications. “In the future, we can interpret an animal’s behavior, including learning and memory, fear, joy, or anger, based on the activity of particular combinations of neurons,” said Koichi Kawakami, one of the paper’s co-authors.

It’s clearly some time away, but this research shows that the concept of reading an animal’s thoughts by analyzing its mental activity might move beyond science fiction to enter the realm of real world science applications.