Contour Organisation with the EM Algorithm