Diagnosis and treatment of endometriosis