Anatomy scan!

How is the cervix measured during the 20 week scan?? Is it by ultrasound or a different way?