add labelmap and groupindices