C++ Implementation of the EM/MPM segmentation method.