imellipse, impoly, etc. to create mask, keeping the border.

조회 수: 5 (최근 30일)
Fer
Fer 2015년 7월 7일
댓글: Fer 2015년 7월 7일
Hello, I am using imellipse, imfreehand, impoly and imrect to create a mask after selecting an area of an image. This works well and I have no problem with this. What I would like to do now is that when drawing the shape, e.g. an ellipse, not only will I use it to create the mask and further actions, but the border of the ellipse drawn will still show, the outline of the selection.

채택된 답변

Image Analyst
Image Analyst 2015년 7월 7일
After you call the function, you have to get the x,y coordinates, and then call hold on and plot()
hold on;
plot(x,y, 'b-');
See attached demo.
  댓글 수: 1
Fer
Fer 2015년 7월 7일
Thanks a lot, as usual your answer was very helpful!
This is what the code ended up looking like, in case anybody has a similar question:
axialROI=imellipse;
axialROImask=createMask(axialROI, handles.currentAxialDisplay);
roiboundaries=bwboundaries(axialROImask);
xy=roiboundaries{1};
x=xy(:,2);
y=xy(:,1);
hold on;
plot(x,y, 'g--');

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by