should remap_labels method be static too?
could you please add a link to lmap (I mean const std::map<int, int>& lmap )