added getPairwisePotentials.m to generate pairwise potential fields.