else:
mask = parents_of > 0
ccenters = centrosome.cpmorphology.centers_of_labels(children.segmented).transpose()
ccenters = ccenters[mask, :]
parents_of_masked = parents_of[mask] - 1
pperim = centrosome.outline.outline(parents.segmented)
// Get a list of all points on the perimeter
perim_loc = numpy.argwhere(pperim != 0)
// Get the label // for each point
perim_idx = pperim[perim_loc[:, 0], perim_loc[:, 1]]
// Sort the points by label //
idx = numpy.lexsort((perim_loc[:, 1], perim_loc[:, 0], perim_idx))
perim_loc = perim_loc[idx, :]
perim_idx = perim_idx[idx]
// Get counts and indexes to each run of perimeter points
counts = centrosome.cpmorphology.fixup_scipy_ndimage_result(
scipy.ndimage.sum(
numpy.ones(len(perim_idx)),
perim_idx,