These are piezoelectric crystals. Their use is based on one insight — sound is a physical wave which can deform a crystal — and it's how we measure the changing size of organs while they're still being used.
It works like this: Two crystals are embedded in a material, and both are attached to wires. One wire runs an electric current through its crystal and causes the crystal to deform. This causes a sound wave, which travels through the material until it hits the second crystal. This crystal deforms, causing an electric current to flow through its wire. The activity in this wire lets an observer know that the sound wave has traveled from one crystal to the other. If that person knows the speed of sound in the material, they know exactly how far apart the crystals are.
You might say that, having placed the crystals, the observer should already know how far apart they are, but sometimes the medium that the crystals are embedded in moves. That medium could, for example, be a human heart. It could be a muscle expanding and contracting as a person runs. It could be a stomach stretching to accommodate food, or rumbling around during the process of digestion. The technique has come to be called sonomicrometry. The measurements it makes can be very precise. Nearly any study of the exact size of still-living organs as they go about their functions probably uses these crystals. Piezoelectricity, and a lot of smarts, lets us measure a moving body.
Image: Sonometrics Corporation.