How can i edit the points of a saved ROI?
4 次查看(过去 30 天)
显示 更早的评论
Hello, when i use the roipoly i have all the interactive facilities in the selection of the ROI points and i can edit the curve until i select CreateMask. Then I save the points of the ROI but i cannot have the same functionality if i just redraw the points in a new figure. I wonder if i could re-activate again the interactive facilities of roipoly but on the drawn ROI in a new figure, so i could make some corrections if needed. Thanks!
1 个评论
William Thielicke
2023-11-30
I have the same question. A least I think so.
I display an image, then create a ROI using
figure
imshow(imread('baby.jpg'))
roi = images.roi.AssistedFreehand(Color="y");
draw(roi)
Then, I am drawing a little bit, and when I am lucky with the result, I close the figure. Now I would like to open the same (or maybe even another) image, display the ROI from above, and maybe edit it a bit.
But I do not know how to display an existing ROI (namely the variable "roi" from the iamge above in the newly opened image.
I think converting the ROI to a mask or something and then converting it back to a ROI is not a nice solution.
Thanks for your input!!
回答(1 个)
William Thielicke
2023-11-30
I think I found the solution:
figure
imshow(imread('baby.jpg'))
roi = images.roi.AssistedFreehand(Color="y");
draw(roi)
Then, before closing the figure:
Old_position=roi.Position;
Old_waypoints=roi.Waypoints;
Then the figure can be closed. Open a new figure and display an image
close all
clear roi
figure
imshow(imread('baby.jpg'))
And then let Matlab redraw the ROI from step 1
drawfreehand('Position', Old_position,'Waypoints',Old_waypoints);
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!