From: us on
"Corey Kelly"
> 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

yes, of course...
carefully follow the syntax required to build callback functions...

us
From: Corey Kelly on
"us " <us(a)neurol.unizh.ch> wrote in message <htjdo4$fpu$1(a)fred.mathworks.com>...
> "Corey Kelly"
> > 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
>
> yes, of course...
> carefully follow the syntax required to build callback functions...
>
> us

Thank you so much! Played around a bit, ended up with

set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});

and now it works! I click, it gives coordinates. Now my issue is figuring out what the coordinates mean.. haha...
Coordinates from the axes object were much more straightforward. Now I'm getting huge negative numbers.
From: Corey Kelly on
"Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <htjg34$mqe$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <htjdo4$fpu$1(a)fred.mathworks.com>...
> > "Corey Kelly"
> > > 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
> >
> > yes, of course...
> > carefully follow the syntax required to build callback functions...
> >
> > us
>
> Thank you so much! Played around a bit, ended up with
>
> set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});
>
> and now it works! I click, it gives coordinates. Now my issue is figuring out what the coordinates mean.. haha...
> Coordinates from the axes object were much more straightforward. Now I'm getting huge negative numbers.

So it seems my problem is not solved. This method for setting the ButtonDownFcn for the image object doesn't seem to pass the handles correctly to the callback. I can't reference any of my program variables properly from within the callback. Is my syntax correct?

set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});

I tried changing it to

set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,hObject, eventdata, handles});

but then I get the following error:

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

??? Error while evaluating image ButtonDownFcn

I'm confused about this "@" notation and how exactly this function is being passed.
From: us on
"Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <htjmbp$j4o$1(a)fred.mathworks.com>...
> "Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <htjg34$mqe$1(a)fred.mathworks.com>...
> > "us " <us(a)neurol.unizh.ch> wrote in message <htjdo4$fpu$1(a)fred.mathworks.com>...
> > > "Corey Kelly"
> > > > 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
> > >
> > > yes, of course...
> > > carefully follow the syntax required to build callback functions...
> > >
> > > us
> >
> > Thank you so much! Played around a bit, ended up with
> >
> > set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});
> >
> > and now it works! I click, it gives coordinates. Now my issue is figuring out what the coordinates mean.. haha...
> > Coordinates from the axes object were much more straightforward. Now I'm getting huge negative numbers.
>
> So it seems my problem is not solved. This method for setting the ButtonDownFcn for the image object doesn't seem to pass the handles correctly to the callback. I can't reference any of my program variables properly from within the callback. Is my syntax correct?
>
> set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});
>
> I tried changing it to
>
> set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,hObject, eventdata, handles});
>
> but then I get the following error:
>
> ??? Error using ==> min_analysis>axes1_ButtonDownFcn
> Too many input arguments.
>
> ??? Error while evaluating image ButtonDownFcn
>
> I'm confused about this "@" notation and how exactly this function is being passed.

a hint:
- did you follow these guidelines...

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/f1-5978.html

us
From: Corey Kelly on
"Corey Kelly" <ckelly01(a)uoguelph.ca> wrote in message <htjg34$mqe$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <htjdo4$fpu$1(a)fred.mathworks.com>...
> > "Corey Kelly"
> > > 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
> >
> > yes, of course...
> > carefully follow the syntax required to build callback functions...
> >
> > us
>
> Thank you so much! Played around a bit, ended up with
>
> set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});
>
> and now it works! I click, it gives coordinates. Now my issue is figuring out what the coordinates mean.. haha...
> Coordinates from the axes object were much more straightforward. Now I'm getting huge negative numbers.

So it seems my problem is not solved. This method for setting the ButtonDownFcn for the image object doesn't seem to pass the handles correctly to the callback. I can't reference any of my program variables properly from within the callback. Is my syntax correct?

set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,handles});

I tried changing it to

set(handles.currimage, 'ButtonDownFcn',{@axes1_ButtonDownFcn,hObject, eventdata, handles});

but then I get the following error:

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

??? Error while evaluating image ButtonDownFcn

I'm confused about this "@" notation and how exactly this function is being passed.
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