Clear Filters
Clear Filters

imellipse not working for updated images

1 view (last 30 days)
Suki Sandhu
Suki Sandhu on 26 Jan 2017
Edited: Suki Sandhu on 26 Jan 2017
I have a piece of code that is like this:
h = imellipse(gca);
bwCurr = createMask(h);
and from there taking the mask I decide if a line falls under the mask and change the color of it and shown here: http://imgur.com/a/5oYFj
It works well for the first image, however, when I move onto any of the next images in the stack, this function does not work and throws the following error:
{
Error in CAS_v2>figure1_WindowKeyPressFcn (line 623) h = imellipse(gca); Error in gui_mainfcn (line 95) feval(varargin{:});
Error in CAS_v2 (line 42) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)CAS_v2('figure1_WindowKeyPressFcn',hObject,eventdata,guidata(hObject))
Error in iptaddcallback/callbackProcessor (line 147) fun(varargin{:});
Error while evaluating Figure WindowKeyPressFcnluating Figure WindowKeyPressFcn
}
The next image is brought up by:
handles.imageAxesFigure=imshow(imadjust(handles.imgStack(:,:,handles.sliceNum),handles.CT_Adjusted_Range));
where the sliceNum indicates what slice to get.
Oddly enough, the roipoly() function works for all the slices - however it is just too slow and involves too many clicks. I am not sure what to do to get it to work for all the slices? Any help/advice/alternative solutions would be very much appreciated. Thanks in advance.
  1 Comment
Suki Sandhu
Suki Sandhu on 26 Jan 2017
Edited: Suki Sandhu on 26 Jan 2017
hmm weird, so I found out about cla('reset') which did the trick for imrect(gca), but for some reason imellipse(gca) still doesnt work. I am completely fine with this though since its just as good. I'd love to know any reasoning behind why this might be just for knowledge purposes, otherwise this question got its answer. :)

Sign in to comment.

Answers (0)

Categories

Find more on Display Image 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!