Return max distance_transform

1 view (last 30 days)
Anass
Anass on 23 Mar 2018
Answered: Anass on 27 Mar 2018
Hi, We know that a distance_transform function computes the distance from non-zero (i.e. non-background) points to the nearest zero (i.e. background) point. In my particular context, my aim is to compute the distance from a non-zero point to the farthest zero point. How can I do this with matlab for 3D images ?
I searched for a specific flag but it seems that it doesn't exist since a distance transform returns always the smallest distance.
Can anyone propose a trick to solve this issue ?

Answers (2)

Image Analyst
Image Analyst on 23 Mar 2018
Post your image so we can see what pixels you want to know the distance from what other pixels. At this point about all I can say is to invert your binary image before calling bwdist().

Anass
Anass on 27 Mar 2018
Please find attached figure1 which shows the 3D image I'm working on, and figure 2 to illustrate what is my aim.
Inverting the image will not solve the problem since my aim is to get the distance from the center of the branch to the farthest zero voxel located outside (as illustrated in figure 2).
<<
>>

Community Treasure Hunt

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

Start Hunting!