From: Corey Kelly on
"Steven Lord" <slord(a)mathworks.com> wrote in message <hth8i4$rgb$1(a)fred.mathworks.com>...
>
> "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> news:hth88t$8hv$1(a)fred.mathworks.com...
> > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > <htflih$t3e$1(a)fred.mathworks.com>...
> >> Walter Roberson <roberson(a)hushmail.com> wrote in message
> >> <TFIKn.37401$304.13037(a)newsfe12.iad>...
> >> > Corey Kelly wrote:
> >> >
> >> > > I was leaning towards the buttondown callback anyway. Any ideas why
> >> > > my callback isn't producing any results? I'm testing it without the
> >> > > image stack playing for the time being, and still can't get any
> >> > > response, even though I've set all the hittest properties.
> >> >
> >> > Sorry, no idea at the moment. If it were a hittest problem, then
> >> > clicking outside of the images should get you the axis callback.
> >> >
> >> > I do not recall at the moment whether you indicated which Matlab
> >> > version you are using?
> >>
> >> I don't seem to get the callback by clicking outside of the image either.
> >> I'm using 2010a.
> >
> > So this is an interesting development, hopefully it will help.
> > I was debugging this problem and discovered the following. I've got
> > 'visible' set to 'off' for my axis so that there's nothing in the GUI
> > until the image is loaded. I tried setting it to 'on', and in that case,
> > if I click on the axis before loading an image, I get the buttondown
> > callback. I still don't get the callback after loading the image, though.
> > Any ideas what this means? Seems like there's still something fishy going
> > on with my hittest properties.
>
> Are you taking this into account?
>
> http://www.mathworks.com/support/solutions/en/data/1-3K8R2L/?solution=1-3K8R2L
>
> IMAGE is a high-level plotting function and by default it does restore many
> of the axes properties (including ButtonDownFcn) to their default values
> when called.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
>

Thanks for the suggestion! I hadn't considered that. Unfortunately, it doesn't seem to be making any difference. I've changed the NextPlot property to replacechildren for the axes object, and after my call to imshow(), I've reset the buttondwn callback as follows:
set(handles.axes1, 'ButtonDownFcn', {@axes1_ButtonDownFcn,hObject,eventdata,handles});

but I'm still not getting the callback after the image is loaded.
From: Corey Kelly on
"Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <hth9m1$cs2$1(a)fred.mathworks.com>...
> "Steven Lord" <slord(a)mathworks.com> wrote in message <hth8i4$rgb$1(a)fred.mathworks.com>...
> >
> > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > news:hth88t$8hv$1(a)fred.mathworks.com...
> > > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > > <htflih$t3e$1(a)fred.mathworks.com>...
> > >> Walter Roberson <roberson(a)hushmail.com> wrote in message
> > >> <TFIKn.37401$304.13037(a)newsfe12.iad>...
> > >> > Corey Kelly wrote:
> > >> >
> > >> > > I was leaning towards the buttondown callback anyway. Any ideas why
> > >> > > my callback isn't producing any results? I'm testing it without the
> > >> > > image stack playing for the time being, and still can't get any
> > >> > > response, even though I've set all the hittest properties.
> > >> >
> > >> > Sorry, no idea at the moment. If it were a hittest problem, then
> > >> > clicking outside of the images should get you the axis callback.
> > >> >
> > >> > I do not recall at the moment whether you indicated which Matlab
> > >> > version you are using?
> > >>
> > >> I don't seem to get the callback by clicking outside of the image either.
> > >> I'm using 2010a.
> > >
> > > So this is an interesting development, hopefully it will help.
> > > I was debugging this problem and discovered the following. I've got
> > > 'visible' set to 'off' for my axis so that there's nothing in the GUI
> > > until the image is loaded. I tried setting it to 'on', and in that case,
> > > if I click on the axis before loading an image, I get the buttondown
> > > callback. I still don't get the callback after loading the image, though.
> > > Any ideas what this means? Seems like there's still something fishy going
> > > on with my hittest properties.
> >
> > Are you taking this into account?
> >
> > http://www.mathworks.com/support/solutions/en/data/1-3K8R2L/?solution=1-3K8R2L
> >
> > IMAGE is a high-level plotting function and by default it does restore many
> > of the axes properties (including ButtonDownFcn) to their default values
> > when called.
> >
> > --
> > Steve Lord
> > slord(a)mathworks.com
> > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> > To contact Technical Support use the Contact Us link on
> > http://www.mathworks.com
> >
>
> Thanks for the suggestion! I hadn't considered that. Unfortunately, it doesn't seem to be making any difference. I've changed the NextPlot property to replacechildren for the axes object, and after my call to imshow(), I've reset the buttondwn callback as follows:
> set(handles.axes1, 'ButtonDownFcn', {@axes1_ButtonDownFcn,hObject,eventdata,handles});
>
> but I'm still not getting the callback after the image is loaded.

Sorry to continue posting on this one, but I'm really hoping someone has dealt with a similar problem and will notice this post. I'm trying every possible combination of these properties and possible solutions, and having no luck. I'll summarize:

-GUI contains an unpopulated axes object to start, I have created the following callback:
function axes1_ButtonDownFcn(hObject, eventdata, handles)
cp = get(handles.axes1,'CurrentPoint')
guidata(hObject, handles);

and it works perfectly, returning the mouse coordinates to the command window.

-The axes is populated by calling imshow(). I am aware that this resets the properties of the axes object, and I have tried multiple methods of preventing/compensating for this:
set(handles.axes1,'nextplot','replacechildren');
handles.currimage = imshow(handles.imagestack(:,:,1),[0 1012]);
set(handles.axes1,'HitTest','on');
set(handles.axes1, 'ButtonDownFcn', @axes1_ButtonDownFcn);

but the callback still ceases to function.

As I mentioned, I've tried multiple combinations of HitTest and Visible properties for the axes.
I have a few theories about what might be the problem:
-Some property of the imshow() handle that must be set. I've tried explicitly setting the HitTest for the handles.currimage object to either on or off, but neither changed the functionality.
-Some reference to a 'parent' handle, as I'm technically clicking on the image, but I want a callback from the axes object. I've played around with this, but I'm not really sure how it would be implemented.

I'd really appreciate any other ideas! I've got the rest of this program finished and just need to get this final feature working.
From: us on
"Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <hti5hs$tj$1(a)fred.mathworks.com>...
> "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <hth9m1$cs2$1(a)fred.mathworks.com>...
> > "Steven Lord" <slord(a)mathworks.com> wrote in message <hth8i4$rgb$1(a)fred.mathworks.com>...
> > >
> > > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > > news:hth88t$8hv$1(a)fred.mathworks.com...
> > > > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > > > <htflih$t3e$1(a)fred.mathworks.com>...
> > > >> Walter Roberson <roberson(a)hushmail.com> wrote in message
> > > >> <TFIKn.37401$304.13037(a)newsfe12.iad>...
> > > >> > Corey Kelly wrote:
> > > >> >
> > > >> > > I was leaning towards the buttondown callback anyway. Any ideas why
> > > >> > > my callback isn't producing any results? I'm testing it without the
> > > >> > > image stack playing for the time being, and still can't get any
> > > >> > > response, even though I've set all the hittest properties.
> > > >> >
> > > >> > Sorry, no idea at the moment. If it were a hittest problem, then
> > > >> > clicking outside of the images should get you the axis callback.
> > > >> >
> > > >> > I do not recall at the moment whether you indicated which Matlab
> > > >> > version you are using?
> > > >>
> > > >> I don't seem to get the callback by clicking outside of the image either.
> > > >> I'm using 2010a.
> > > >
> > > > So this is an interesting development, hopefully it will help.
> > > > I was debugging this problem and discovered the following. I've got
> > > > 'visible' set to 'off' for my axis so that there's nothing in the GUI
> > > > until the image is loaded. I tried setting it to 'on', and in that case,
> > > > if I click on the axis before loading an image, I get the buttondown
> > > > callback. I still don't get the callback after loading the image, though.
> > > > Any ideas what this means? Seems like there's still something fishy going
> > > > on with my hittest properties.
> > >
> > > Are you taking this into account?
> > >
> > > http://www.mathworks.com/support/solutions/en/data/1-3K8R2L/?solution=1-3K8R2L
> > >
> > > IMAGE is a high-level plotting function and by default it does restore many
> > > of the axes properties (including ButtonDownFcn) to their default values
> > > when called.
> > >
> > > --
> > > Steve Lord
> > > slord(a)mathworks.com
> > > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> > > To contact Technical Support use the Contact Us link on
> > > http://www.mathworks.com
> > >
> >
> > Thanks for the suggestion! I hadn't considered that. Unfortunately, it doesn't seem to be making any difference. I've changed the NextPlot property to replacechildren for the axes object, and after my call to imshow(), I've reset the buttondwn callback as follows:
> > set(handles.axes1, 'ButtonDownFcn', {@axes1_ButtonDownFcn,hObject,eventdata,handles});
> >
> > but I'm still not getting the callback after the image is loaded.
>
> Sorry to continue posting on this one, but I'm really hoping someone has dealt with a similar problem and will notice this post. I'm trying every possible combination of these properties and possible solutions, and having no luck. I'll summarize:
>
> -GUI contains an unpopulated axes object to start, I have created the following callback:
> function axes1_ButtonDownFcn(hObject, eventdata, handles)
> cp = get(handles.axes1,'CurrentPoint')
> guidata(hObject, handles);
>
> and it works perfectly, returning the mouse coordinates to the command window.
>
> -The axes is populated by calling imshow(). I am aware that this resets the properties of the axes object, and I have tried multiple methods of preventing/compensating for this:
> set(handles.axes1,'nextplot','replacechildren');
> handles.currimage = imshow(handles.imagestack(:,:,1),[0 1012]);
> set(handles.axes1,'HitTest','on');
> set(handles.axes1, 'ButtonDownFcn', @axes1_ButtonDownFcn);
>
> but the callback still ceases to function.
>
> As I mentioned, I've tried multiple combinations of HitTest and Visible properties for the axes.
> I have a few theories about what might be the problem:
> -Some property of the imshow() handle that must be set. I've tried explicitly setting the HitTest for the handles.currimage object to either on or off, but neither changed the functionality.
> -Some reference to a 'parent' handle, as I'm technically clicking on the image, but I want a callback from the axes object. I've played around with this, but I'm not really sure how it would be implemented.
>
> I'd really appreciate any other ideas! I've got the rest of this program finished and just need to get this final feature working.

a hint:
- create the axis AH
- set the BUTTONDOWNFCN callback
- HOLD ON
- create the image
- set the BUTTONDOWNFCN callback of this image
to simply retrieve the parent's, ie, AH, BUTTONDOWNFCN and call it as a function

us
From: Corey Kelly on
"us " <us(a)neurol.unizh.ch> wrote in message <htihi8$sjj$1(a)fred.mathworks.com>...
> "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <hti5hs$tj$1(a)fred.mathworks.com>...
> > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <hth9m1$cs2$1(a)fred.mathworks.com>...
> > > "Steven Lord" <slord(a)mathworks.com> wrote in message <hth8i4$rgb$1(a)fred.mathworks.com>...
> > > >
> > > > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > > > news:hth88t$8hv$1(a)fred.mathworks.com...
> > > > > "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message
> > > > > <htflih$t3e$1(a)fred.mathworks.com>...
> > > > >> Walter Roberson <roberson(a)hushmail.com> wrote in message
> > > > >> <TFIKn.37401$304.13037(a)newsfe12.iad>...
> > > > >> > Corey Kelly wrote:
> > > > >> >
> > > > >> > > I was leaning towards the buttondown callback anyway. Any ideas why
> > > > >> > > my callback isn't producing any results? I'm testing it without the
> > > > >> > > image stack playing for the time being, and still can't get any
> > > > >> > > response, even though I've set all the hittest properties.
> > > > >> >
> > > > >> > Sorry, no idea at the moment. If it were a hittest problem, then
> > > > >> > clicking outside of the images should get you the axis callback.
> > > > >> >
> > > > >> > I do not recall at the moment whether you indicated which Matlab
> > > > >> > version you are using?
> > > > >>
> > > > >> I don't seem to get the callback by clicking outside of the image either.
> > > > >> I'm using 2010a.
> > > > >
> > > > > So this is an interesting development, hopefully it will help.
> > > > > I was debugging this problem and discovered the following. I've got
> > > > > 'visible' set to 'off' for my axis so that there's nothing in the GUI
> > > > > until the image is loaded. I tried setting it to 'on', and in that case,
> > > > > if I click on the axis before loading an image, I get the buttondown
> > > > > callback. I still don't get the callback after loading the image, though.
> > > > > Any ideas what this means? Seems like there's still something fishy going
> > > > > on with my hittest properties.
> > > >
> > > > Are you taking this into account?
> > > >
> > > > http://www.mathworks.com/support/solutions/en/data/1-3K8R2L/?solution=1-3K8R2L
> > > >
> > > > IMAGE is a high-level plotting function and by default it does restore many
> > > > of the axes properties (including ButtonDownFcn) to their default values
> > > > when called.
> > > >
> > > > --
> > > > Steve Lord
> > > > slord(a)mathworks.com
> > > > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> > > > To contact Technical Support use the Contact Us link on
> > > > http://www.mathworks.com
> > > >
> > >
> > > Thanks for the suggestion! I hadn't considered that. Unfortunately, it doesn't seem to be making any difference. I've changed the NextPlot property to replacechildren for the axes object, and after my call to imshow(), I've reset the buttondwn callback as follows:
> > > set(handles.axes1, 'ButtonDownFcn', {@axes1_ButtonDownFcn,hObject,eventdata,handles});
> > >
> > > but I'm still not getting the callback after the image is loaded.
> >
> > Sorry to continue posting on this one, but I'm really hoping someone has dealt with a similar problem and will notice this post. I'm trying every possible combination of these properties and possible solutions, and having no luck. I'll summarize:
> >
> > -GUI contains an unpopulated axes object to start, I have created the following callback:
> > function axes1_ButtonDownFcn(hObject, eventdata, handles)
> > cp = get(handles.axes1,'CurrentPoint')
> > guidata(hObject, handles);
> >
> > and it works perfectly, returning the mouse coordinates to the command window.
> >
> > -The axes is populated by calling imshow(). I am aware that this resets the properties of the axes object, and I have tried multiple methods of preventing/compensating for this:
> > set(handles.axes1,'nextplot','replacechildren');
> > handles.currimage = imshow(handles.imagestack(:,:,1),[0 1012]);
> > set(handles.axes1,'HitTest','on');
> > set(handles.axes1, 'ButtonDownFcn', @axes1_ButtonDownFcn);
> >
> > but the callback still ceases to function.
> >
> > As I mentioned, I've tried multiple combinations of HitTest and Visible properties for the axes.
> > I have a few theories about what might be the problem:
> > -Some property of the imshow() handle that must be set. I've tried explicitly setting the HitTest for the handles.currimage object to either on or off, but neither changed the functionality.
> > -Some reference to a 'parent' handle, as I'm technically clicking on the image, but I want a callback from the axes object. I've played around with this, but I'm not really sure how it would be implemented.
> >
> > I'd really appreciate any other ideas! I've got the rest of this program finished and just need to get this final feature working.
>
> a hint:
> - create the axis AH
> - set the BUTTONDOWNFCN callback
> - HOLD ON
> - create the image
> - set the BUTTONDOWNFCN callback of this image
> to simply retrieve the parent's, ie, AH, BUTTONDOWNFCN and call it as a function
>
> us

-Axis is created by GUIDE
-buttondownfcn created as described above

hold on;
handles.currimage = imshow(handles.imagestack(:,:,1),[0 1012]);
set(handles.currimage, 'ButtonDownFcn',@axes1_ButtonDownFcn);

Now I can load the image and get a response when I click on it. Unfortunately, the response in the following error:

??? Input argument "handles" is undefined.

Error in ==> min_analysis>axes1_ButtonDownFcn at 185
cp = get(handles.axes1,'CurrentPoint');

??? Error while evaluating image ButtonDownFcn
From: Corey Kelly on
*snip*
> > a hint:
> > - create the axis AH
> > - set the BUTTONDOWNFCN callback
> > - HOLD ON
> > - create the image
> > - set the BUTTONDOWNFCN callback of this image
> > to simply retrieve the parent's, ie, AH, BUTTONDOWNFCN and call it as a function
> >
> > us
>
> -Axis is created by GUIDE
> -buttondownfcn created as described above
>
> hold on;
> handles.currimage = imshow(handles.imagestack(:,:,1),[0 1012]);
> set(handles.currimage, 'ButtonDownFcn',@axes1_ButtonDownFcn);
>
> Now I can load the image and get a response when I click on it. Unfortunately, the response in the following error:
>
> ??? Input argument "handles" is undefined.
>
> Error in ==> min_analysis>axes1_ButtonDownFcn at 185
> cp = get(handles.axes1,'CurrentPoint');
>
> ??? Error while evaluating image ButtonDownFcn

Also, if I try

hold on;
handles.currimage = imshow(handles.imagestack(:,:,1),[0 1012]);
set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,hObject,eventdata,handles});

I get

??? Error using ==> min_analysis>axes1_ButtonDownFcn
Too many input arguments.

??? Error while evaluating image ButtonDownFcn
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11
Prev: mbuild -setup doesn't see my compiler
Next: Using imcontrast