Automated Diagnosis and Treatment Planning for Craniofacial Pain