Template Matching in medical imaging