generate mask from selection group