find nerest point B(x,y,z) on the outersurface of the head to A (x,y,z)

hi experts , i have a questions i asked before but still cant solve it and hope you can help me.
i succesfuly formed a 3d image of a head from a bunch of 2d slices. i have a point say A(x,y,z). this point could be within the head or outside the head surface in the zeros area. i wish to find the nearest point say(B(x,y,z))to A(x,y,z) on the surface of the brain.

Answers (1)

Can't you just have 3 for loops and get every distance and check? Otherwise you can try to set that point and set all the points in the head, and then call bwdist(), then scan that distance transform, but that might take more time than just doing it yourself directly with the Pythagorean theorem.

8 Comments

thanks image analyst but please more clues ,it is really important for me. do you mean i should scan the head surface and get all the head surface voxel's coordinates(x,y,z) and then compute their distances to A, so i can find the shorter distance? no better way?
If you want to know with absolute certainty which voxel is closest, then you have to compute the distance of that point to every voxel. If the surface is pretty smooth, then you could subsample the volume to do a fast first pass, then look at the closest voxel in the subsampled version and do a more precise pass where you check every voxel in the neighborhood surrounding the closest voxel to "home in on it." This would increase the speed and efficiency.
hi image analysit ,thanks again , i understand wt you said. one more step, what is the best way to get only the surface voxels coordinates from the image?
Don't worry about that - just check against them all. If you were to make another operation to try to figure out which were "surface" voxels, then that would take at least as much time as inspecting them all without finding surface voxels. What would it gain you, time-wise? Nothing.
i am lost again in ur last reply. if i didnt get the surface voxel coordinates how can i get their distnce to the point A. if i used all image voxels i will not know the distance to surface ones. plz expalain more.
Don't you have some binary image (mask) that says which pixels are part of your object, and which are background? For example all voxels brighter than a value of 1500 or something?
i dont have binary image but i think i can do it using your previouse help.but then the pixels that are part of the object will be both surface and within object voxels right? not only surface.
Well threshold it or something. If you want to know how close some arbitrary point is to the surface, you obviously have to know what pixels are part of your object and what pixels are part of the background, or air.

This question is closed.

Asked:

on 13 Apr 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!