A likelihood approach to shape analysis