SAMtoCollapsedSAM added