필터 지우기
필터 지우기

find diameter based on the centreline and edge

조회 수: 3 (최근 30일)
NaviD
NaviD 2023년 10월 23일
댓글: Image Analyst 2024년 2월 28일
Hi,
I need to find the diameter of the artery model by knowing the centreline and the edges of the artery as:
The black area shows the artery and the white line shows its centreline. I need to calculate the diameter of model at different locations.
Any helps on how to approach it is appreciated.
Thanks
Navid

채택된 답변

Image Analyst
Image Analyst 2023년 10월 23일
Compute the Euclidean Distance Transform using bwdist and the skeleton using bwskel then multiply those two images together. Full demo attached.
  댓글 수: 10
NaviD
NaviD 2024년 2월 28일
이동: Image Analyst 2024년 2월 28일
Thanks both. The width issue has been resolved. Just followed the steps @DGM suggested.
Regarding the length: yes, Iam trying to use the Pythagorean theorem. The issue that I have, when there is a curve/twist in the model, the length calcualted using the code I shared previously, gave me incorrect results. I tried to sort them both in x and y directions, but doesn't help.
These two are how they look like when I sort them out in vertical and horizontal directions. None of them give the correct length, as a portion of path is not sorted.
Any thought on how to solve this issue?
Thanks
Navid
Image Analyst
Image Analyst 2024년 2월 28일
I don't know why the skeleton should give a "solid" patch. Be aware that bwboundaries is meant to give the perimeter of the blob and I'm not sure what the coordinates would be in the degenerate case of a single pixel wide line - not sure if the coordinates are doubled as it traces around the line. You have to make sure that the boundary starts at the ENDPOINT of the skeleton. bwboundaries starts at the left most point of the blob which quite likely is not the same location at the endpoint. You might have to use bwtraceboundary where you can tell it where to start tracing at and use bwmorph to find the endpoints of the skeleton and start there.
But again, you're only giving small snippets of code. I have neither the Crystal Ball Toolbox nor the Mind Reading Toolbox.
If you have any more questions, then attach your image and code to process it in with the paperclip icon after you read this:
Or:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by