필터 지우기
필터 지우기

'drawcircle' and 'roi.cricle' do not respect preset Radius

조회 수: 4 (최근 30일)
Tamara del Águila
Tamara del Águila 2021년 4월 8일
답변: Matt J 2021년 4월 8일
I am trying to make a circular roi with a specified R,but allowing to set the center and the position. I first thought of doing it with 'ginput' and later drawing the circle, but since I need to allow for interactive reposition, I switched to 'roi' creation (image.roi.circle).
However, for some reason, something happens with the Radius and it's never set as defined, or it allows interactive setting of the radius... I tried both with 'drawcircle' and 'draw' (predefining the roi), but none works for me as I want to. This is the code for 'drawcircle':
figure
imagesc(background);
drawncircle = drawcircle('InteractionsAllowed', 'translate','Radius',6, 'LineWidth',1.5);
Warning: The ROI was not fully defined. 'Radius' will be ignored and interactive placement will begin.
> In drawcircle (line 187)
And here the code for roi definition + draw():
figure
imagesc(background);
drawnroi = images.roi.Circle('InteractionsAllowed', 'translate','Radius',6, 'LineWidth',1.5);
draw(drawnroi);
In both cases, the first time I run it, it yields the warning, sets the Radius to the minimum, and the field 'Radius' of the roi is set to zero. However, if I run it again once the object has been created, what it does is to interactively allow the radius definition. (while in the permisions I only allow for moving it!).
Does anyone know what am I doing wrong or how can I get what I need? (thanks in advance)

답변 (1개)

Matt J
Matt J 2021년 4월 8일
I think you need to specify the center coordinate as well.

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by