Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Help with MATLAB GUI/selecting points

Subject: Help with MATLAB GUI/selecting points

From: Blackadder Ray

Date: 14 Dec, 2008 02:47:01

Message: 1 of 6

Hi all,

Here's a problem I'm having trouble figuring out:

I display a high-resolution image using imscrollpanel. For instance, consider the MATLAB example:
        hFig = figure('Toolbar','none','Menubar','none');
        hIm = imshow('saturn.png');
        hSP = imscrollpanel(hFig,hIm);
        set(hSP,'Units','normalized','Position',[0 .1 1 .9])
 
        % Add a magnification box and an overview tool
        hMagBox = immagbox(hFig,hIm);
        pos = get(hMagBox,'Position');
        set(hMagBox,'Position',[0 0 pos(3) pos(4)])
        imoverview(hIm)

I now need to select points in the displayed image - but using getpts or ginput doesn't work, because it's selecting points from the entire figure, and not just the scrollable area of the image, which is what I'm looking for. Does anyone have an idea of how to get around this?

Thanks.

Subject: Help with MATLAB GUI/selecting points

From: Blackadder Ray

Date: 14 Dec, 2008 02:58:03

Message: 2 of 6

As a quick follow up - I know this can be done, because 'cpselect' does exactly this. However, I can't directly use cpselect, due to the data I'm working with.

Subject: Help with MATLAB GUI/selecting points

From: Dave Brackett

Date: 14 Dec, 2008 21:11:01

Message: 3 of 6

"Blackadder Ray" <blackadder.ray@gmail.com> wrote in message <gi1snq$p50$1@fred.mathworks.com>...
> As a quick follow up - I know this can be done, because 'cpselect' does exactly this. However, I can't directly use cpselect, due to the data I'm working with.

what about creating a transparent axes over the top of the imscrollpanel axes which is the same size and then using ginput on the overlayed axes? you would then need to interpret the coordinate points and refer them to the actual image.

Subject: Help with MATLAB GUI/selecting points

From: Blackadder Ray

Date: 14 Dec, 2008 22:28:02

Message: 4 of 6

"Dave Brackett" <davebrackett@hotmail.com> wrote in message <gi3sp5$7ir$1@fred.mathworks.com>...
> "Blackadder Ray" <blackadder.ray@gmail.com> wrote in message <gi1snq$p50$1@fred.mathworks.com>...
> > As a quick follow up - I know this can be done, because 'cpselect' does exactly this. However, I can't directly use cpselect, due to the data I'm working with.
>
> what about creating a transparent axes over the top of the imscrollpanel axes which is the same size and then using ginput on the overlayed axes? you would then need to interpret the coordinate points and refer them to the actual image.

Thanks - I did think of that, but I still have the problem that the image is scrollable - so I'm not sure how to handle that properly :(

Subject: Help with MATLAB GUI/selecting points

From: matt dash

Date: 15 Dec, 2008 02:59:03

Message: 5 of 6

"Blackadder Ray" <blackadder.ray@gmail.com> wrote in message <gi419i$8uv$1@fred.mathworks.com>...
> "Dave Brackett" <davebrackett@hotmail.com> wrote in message <gi3sp5$7ir$1@fred.mathworks.com>...
> > "Blackadder Ray" <blackadder.ray@gmail.com> wrote in message <gi1snq$p50$1@fred.mathworks.com>...
> > > As a quick follow up - I know this can be done, because 'cpselect' does exactly this. However, I can't directly use cpselect, due to the data I'm working with.
> >
> > what about creating a transparent axes over the top of the imscrollpanel axes which is the same size and then using ginput on the overlayed axes? you would then need to interpret the coordinate points and refer them to the actual image.
>
> Thanks - I did think of that, but I still have the problem that the image is scrollable - so I'm not sure how to handle that properly :(

this is pretty much the same as the question asked here:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240813#616753

Subject: Help with MATLAB GUI/selecting points

From: Blackadder Ray

Date: 15 Dec, 2008 18:29:02

Message: 6 of 6

"matt dash" <n.a@mail.com> wrote in message <gi4h5n$pnm$1@fred.mathworks.com>...
> "Blackadder Ray" <blackadder.ray@gmail.com> wrote in message <gi419i$8uv$1@fred.mathworks.com>...
> > "Dave Brackett" <davebrackett@hotmail.com> wrote in message <gi3sp5$7ir$1@fred.mathworks.com>...
> > > "Blackadder Ray" <blackadder.ray@gmail.com> wrote in message <gi1snq$p50$1@fred.mathworks.com>...
> > > > As a quick follow up - I know this can be done, because 'cpselect' does exactly this. However, I can't directly use cpselect, due to the data I'm working with.
> > >
> > > what about creating a transparent axes over the top of the imscrollpanel axes which is the same size and then using ginput on the overlayed axes? you would then need to interpret the coordinate points and refer them to the actual image.
> >
> > Thanks - I did think of that, but I still have the problem that the image is scrollable - so I'm not sure how to handle that properly :(
>
> this is pretty much the same as the question asked here:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/240813#616753
>

Thanks!

Tags for this Thread

No tags are associated with this thread.

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.

Contact us