Branch pruning. A. DIC image of a moving Dictyostelium cell in which the skeleton (B) shows three distinct major branches. Near the boundary, these branches may bifurcate and form smaller branches shorter than the length threshold pthreshold (insets). If the branch is independent; that is, it does not share a root with any other outer branch (middle insert, green branch), we remove it from the skeleton. Otherwise, if the branch shares a root with another branch (blue branches in all three insets), we either combine the two branches (if they are roughly the same length, i.e., the length of the longer branch divided by the shorter one is less than the ratio threshold r, three pairs of blue branches in three insets) or remove the shorter branch (when they are of significantly different lengths, i.e., the length ratio is no less than r, not shown). C. Skeleton after branch pruning. D. The real protrusion or retraction usually occurs when the branch terminal is close to the boundary (red). If the boundary is locally rounded (blue), the branch will be far away and it is unlikely that a pseudopodial activity happens there.