I have a three-dimensional binary image of a collection of discrete, individual voxels ("seeds") contained in a connected 3-dimensional surface ("skin"). (Like a small fruit, with a surface delineated by a one-pixel boundary, that contains seeds.)
The binary matrix was derived from a three-dimensional intensity image of the same size (grayscale). (It's easy to label the surface voxels "2", the seed voxels "1", and the background "0" using MATLAB's label function).
In MATLAB, How do I compute the shortest geometric distance between each individual "seed" and the surface? In the (crude) 2-dimensional diagram in the link below, each desired distance is represented by the magnitudes of the red lines (in number of voxels).