Recognition of patterns in medical or anatomical images