how to calculate the diameter of a vessel

hello everyone
I really need help as soon as possible
I want a solution to calculate the diameter of each white line in the image(Vessel Diameter Measurement)

1 Kommentar

John D'Errico
John D'Errico am 17 Apr. 2014
Compute the radius. Multiply by 2.
Really, we are not here to do your homework as soon as possible. IF you could not start it in a timely way, then why should we rush?
Make an effort, as that is the way to learn. Or don't make an effort. In that case, learn to say the phrase "Do ya want fries with that order?"

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Image Analyst
Image Analyst am 17 Apr. 2014
Bearbeitet: Image Analyst am 7 Mai 2020

3 Stimmen

It's pretty easy - maybe 3 lines of code. First call bwdist to get the distance from the white pixels to the nearest black pixel. Then call bwmorph to skeletonize that so you get the distances along the centerlines. That's the radius so multiply by two to get the diameter. It will be an image looking like a skeleton and to find the diameter you simply look at the value of the pixel at the location you want the diameter of. Basically it's this (untested):
edtImage = 2 * bwdist(~binaryImage);
skeletonImage = bwmorph(binaryImage, 'skel', inf);
diameterImage = edtImage .* double(skeletonImage);
Can't get much simpler, though you may want to add a utility where you let the user call ginput() to report back the diameter at the closest pixel to where they clicked. It's pretty easy, though clever and not obvious (until you know about it), so most novices might embark on some complicated looping process to get cross sections (what a nightmare that would be).

8 Kommentare

Image Analyst
Image Analyst am 18 Apr. 2014
bil - are you still around? Did it work?
bil bbil
bil bbil am 20 Apr. 2014
Sorry for the delay,,I followed the example in medical-image-processing,,I had it calculated the bifurcation points
Lulu Firdaus
Lulu Firdaus am 7 Mai 2020
i got this error.
Try
diameterImage = edtImage .* double(skeletonImage);
in addition for anyone who cant see the diameter result, try adding this at the end of your code:
mesh(diameterImage);
so you will get 3D graph, with X and Y as the skeleton's pixel location and Z as the vessel's diameter
Lulu Firdaus
Lulu Firdaus am 8 Mai 2020
it worked, thank you!
Hasnain Iftikhar
Hasnain Iftikhar am 23 Jan. 2022
did you extract thin vessels?

Melden Sie sich an, um zu kommentieren.

Nitin
Nitin am 17 Apr. 2014

1 Stimme

I would start by first experimenting with regionprops function in matlab

Kategorien

Mehr zu Just for fun finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by