Intelligent magnetic manipulation for gastrointestinal ultrasound