Cryptorchidism is usually diagnosed during a physical examination shortly after birth. If the testicles are not palpable, imaging studies such as ultrasound or MRI may be used to locate the undescended testicle. In some cases, exploratory surgery may be necessary.