Effacer les filtres
Effacer les filtres

How can i edit the points of a saved ROI?

8 vues (au cours des 30 derniers jours)
Leontios Hadjileontiadis
Leontios Hadjileontiadis le 21 Mar 2014
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 commentaire
William Thielicke
William Thielicke le 30 Nov 2023
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!!

Connectez-vous pour commenter.

Réponses (1)

William Thielicke
William Thielicke le 30 Nov 2023
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);

Community Treasure Hunt

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

Start Hunting!

Translated by