Using impoly in matlab GUI

1 view (last 30 days)
rukhmini
rukhmini on 10 May 2014
Commented: rukhmini on 10 May 2014
I am using impoly function in MATLAB GUI for a stack of DICOM images to delineate ROI. Firstly, using ROIPOLY I am getting the x,y co-ordinates.The (x,y) co-ordinates are given as input to the impoly function i.e., I am just copying the position in the next slice of image of the stack.The function is giving the points on the image but it is not editable.I am not able to drag the points and modify the ROI. While I am doing the same operation for a single image it is working . Can anyone explain this behavior, and how can i get rid of it?

Answers (1)

Image Analyst
Image Analyst on 10 May 2014
I don't understand. Explain exactly where it is working (draggable points) and where it is not. You say it's working for a single image but not for a DICOM image? When you load an image from a DICOM stack into an axes, is it not a single image at that point? Maybe try calling "cla reset" before calling imshow() and see it that fixes it.
  1 Comment
rukhmini
rukhmini on 10 May 2014
Actually I want to design a tool for ground truth preparation. I am loading stack of DICOM images containing more than 100 images. I am loading one image at a time into an axes. So, when I am selecting any ROI from any slice, it should be copied in next slice. Also it should be editable. So, I have tried with the following code and its working.
I = imread('cameraman.tif'); imshow(I);
r = [50; 100; 50; 50];%Coordinates of ROI
c = [50; 100; 100; 50];
initPosition = [r,c];
h = impoly(gca, initPosition);
position = wait(h);
"But when I am using similar code in GUI, ROI using stored coordinates is appearing in next image. But, it was not editable."
position = [xi(1:end)',yi(1:end)'];% xi, yi are Stored coordinates
h = impoly(gca,position);
xy_position = wait(h);% new coordinates after editing

Sign in to comment.

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!