Theoretical Background
The algorithm behind Estimate Grain Diameters works as follows: At the start, each voxel gets assigned a Grain Diameter of 0 voxels. Then, spheres are successively fitted into the geometry, starting at the largest possible sphere.
In the figure below, the process of estimating the grain size is illustrated on an example structure. On the left, the original structure (the gray grains are analyzed) is shown. In the next step (middle), an EDT is calculated to find the maximal fitting sphere at every point. On the right, the resulting size distribution file of Estimate Grain Diameters is displayed.
If a sphere fits inside a grain and a voxel has still a diameter of 0 assigned to it yet, the diameter of the fitting sphere is assigned to all voxels contained in the sphere.
If a voxel is contained in multiple spheres, there are two options:
This algorithm ensures that non-spherical grains get assigned the diameter of the largest inscribed sphere.