Doctors at Boston Children’s Hospital turned to a 3D printer to create the first exact replica of an infant brain. The replica of 18-month-old Gabriel Mandeville’s brain was used to practice a hemispherectomy, a rare surgery required to stop the onset of violent epileptic seizures.

According to iflscience, at only five-months-old, Gabriel began experiencing seizures that increased in severity over time, wreaking havoc on his brain.

The Verge describes Gabriel’s seizures as “mind erasers” due to their tendency to induce memory loss, which had the potential to cause Gabriel to no longer recognize his parents.

When medication failed to keep the seizures at bay, Gabriel’s doctors decided on a hemispherectomy, which is a rare and difficult procedure that involves separating healthy brain from the seizure-inducing section. The procedure is so complex, it was decided that a practice run was necessary.

Using a Simulator Program, the 3D printer created an exact replica of Gabrielle’s brain out of malleable, color-coded, soft plastic. Dr. Peter Weinstock, director of the Simulator Program, says that “surgical preparation via simulation allows surgeons to hit the ground a lot faster…We can’t be prepared for every possibility, but we can chop off a large number of complications.”

After practicing with the model brain, doctors spent 10 hours administering the hemispherectomy on Gabriel and everything “went according to plan.” Gabriel is now seizure-free.

For more information on Gabriel, the hemespherectomy process, and the 3D printing technology, watch the video below.