Matrix
The matrix was a realm used by a species of non-corporeal lifeforms to trap the consciousness of corporeal lifeforms for their nourishment. 

These lifeforms entered the cerebral cortex of a person who was at their most vulnerable, in a state near death, and blocked attempts of resuscitation. The alien entity needed the person to enter their matrix voluntarily, so they caused hallucinations of loved ones for the victim in an attempt to convince them to enter the matrix, claiming it to be the afterlife, a "place of wonder" that could assume any desired form for them. 

In 2373, one of these aliens attempted to entice Captain Kathryn Janeway into the matrix, posing as her deceased . She saw through it's ruse and refused to enter. The alien dislodged from Janeway's brain. 

Later on, Janeway and Chakotay speculated that these aliens might explain all near-death experiences, though Janeway hoped the species was only native to the Delta Quadrant. ()

External link
 
Regions