@azonenberg So, focus stacking, but using image metadata instead of relying on visual detection of sharpness? No idea how to do that, I think you would need a 3D model of the subject to generate the mask.
@azonenberg That seems like an active research topic. I hope you'll find something usable.
@miermont Mathematica can do it https://www.wolfram.com/language/12/image-computation-for-microscopy/3d-reconstruction-via-focus-stacking.html?product=mathematica
Whether there's anything f/oss for Linux that can do the same is another question.
@miermont Yeah its not at all an urgent need but I'll keep an eye open.
Basically I'm already used to navigating samples in 3D by focusing to figure out which features are above/below others intuitively. Seems like something you could do computationally to 3D pinpoint specific features, I just don't know how to do it.