function [I,J,NumInsideNodes] = LocalEnumeration(InsideOldMask,NumNodes,NatNeighborPairs)

NumInsideNodes = nnz(InsideOldMask); 
tmp = zeros(1, NumNodes);
tmp(InsideOldMask) = 1:NumInsideNodes;
I = tmp(NatNeighborPairs(:,1));
J = tmp(NatNeighborPairs(:,2));

end
