Doctor 'used ultrasound as sex aid'