Not gonna pretend I have the solution, but it sounds like most of the groundwork for that has been laid out in medical imagery already. CT scans, combined into volumes, identifying structures..
Steps 3 and 4 seem like a largely solved problem using blob detection in computer vision libraries. The last step is in plated via detection. If no microvias are present this seems pretty easy: just look for circles. If microvias are present then you need to check for plating at each layer for each hole below a certain size. That seems difficult if the sanding process does not result in very clean features.
1. align the image stack. not trivial, but a common task.
2. take several cross-sections, in both dimensions, and have a human draw a line along a specific layer line
3. linearly interpolate these lines into a surface.
4. for each pixel in each output layer, set the value to layers[l + offset][x][y], where the offset was calculated in step 3.