get_id_by_mask takes integer threshold