Updated roiFromPatch to use INRIA SPAMS code.