Three-dimensional lattice matching of epitaxially embedded nanoparticles