Thread Subject: using roipoly with a given figure

Subject: using roipoly with a given figure

From: andieh F.

Date: 31 Aug, 2010 13:21:07

Message: 1 of 5

Hi there!

I created a GUI with matlab and want to select a roi in an image. there are several figures in my GUI displaying different images.

to select a roi, i use roipoly(image). but this just works, when i click the image right before i start roipoly. this is really anoying! is there no chance to give roipoly a handle to use, like i do with line or imshow?

when i try to select the current figure with figure(handles.imgOrg), i just get this strange error:
??? Error using ==> figure
Requested figure handle in use by another object

as i said before, roipoly works fine when clicking on the imgOrg figure before.

thank you so far for your help.
andieh

Subject: using roipoly with a given figure

From: ImageAnalyst

Date: 31 Aug, 2010 13:58:47

Message: 2 of 5

andieh
Use the axes() command/function to switch focus to the axes you want
the user to draw into, for example

axes(handles.axesImage1);
[binaryImage x y] = roipolyold();

Subject: using roipoly with a given figure

From: andieh F.

Date: 31 Aug, 2010 14:13:08

Message: 3 of 5

hi!

thank you for your help.
simply use of axis(handles.imgOrg) followed by roipoly(Image) change nothing. removing Image as argument for roiploy i get:
??? Error using ==> roipolyold>parse_inputs at 225
The current figure must contain an image to use ROIPOLY.

hmm, really strange!

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <19e76757-333f-46d6-bcfb-dbc385996c77@v41g2000yqv.googlegroups.com>...
> andieh
> Use the axes() command/function to switch focus to the axes you want
> the user to draw into, for example
>
> axes(handles.axesImage1);
> [binaryImage x y] = roipolyold();

Subject: using roipoly with a given figure

From: Image Analyst

Date: 31 Aug, 2010 15:31:22

Message: 4 of 5

Not really that strange. How can you get coordinates for a polygon when the axes has no coordinate system to begin with? What would be the coordinate of the, say, middle of the box? You need to put an image into the axes first. To do this you can use imshow() to stuff an image into the axes. Only then can you use roipoly.

Subject: using roipoly with a given figure

From: andieh F.

Date: 31 Aug, 2010 16:15:21

Message: 5 of 5

There is an image loaded to that axis. But my problem was:
i used axIs instead of axEs. Hmm damn spelling.

my fault, thank you very much!

"Image Analyst" <imageanalyst@mailinator.com> wrote in message <i5j789$e2v$1@fred.mathworks.com>...
> Not really that strange. How can you get coordinates for a polygon when the axes has no coordinate system to begin with? What would be the coordinate of the, say, middle of the box? You need to put an image into the axes first. To do this you can use imshow() to stuff an image into the axes. Only then can you use roipoly.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
roipoly andieh F. 31 Aug, 2010 09:24:09
figure andieh F. 31 Aug, 2010 09:24:09
in use by anoth... andieh F. 31 Aug, 2010 09:24:09
rssFeed for this Thread

Contact us at files@mathworks.com