the grain growth model is based on the Voronoi Implicit Interface Method
(https://doi.org/10.1016/j.jcp.2012.04.004). The last step in this
algorithm is the assignment of the new phase/material ID to the voxels
in the 'thick boundary' which is done with distance_transform_edt from
ndimage. This problem can have multiple solution and can lead to the
translation of grains.
In the original publication, the position of the boundary is calculated
with subvoxel resolution by solving the eikonal equation. The following
python packages might help:
https://pypi.org/project/eikonalfmhttps://pypi.org/project/scikit-fmmhttps://github.com/malcolmw/pykonal