Counting Number of Voxels between 2 points without drawing lines
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/589437/image.png)
Hi All,
I have curve volumes and I know the coordinates of each and every voxels including the endpoints. I have many curve volumes like this and, I would like to know the straight distance of endpoints(A-B) by VOXELS. I calculated the distance using Pythagoras therom using the X,Y, Z coordinates.But I would like to know the straight distance by voxels WITHOUT drawing a line between those two points. I have lots of volumes like this and I cannot draw lines between those openning points hence it takes high computational power. Appreciate your comments.
0 Kommentare
Akzeptierte Antwort
Matt J
am 20 Apr. 2021
Bearbeitet: Matt J
am 20 Apr. 2021
Assuming you have a binarized image and the curve is the only object in that image,
[I,J]=find( bwmorph(yourImage,'endpoints'));
distance=norm([I(1), J(1)] - [I(2),J(2)]),
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!