<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042</link>
    <title>MATLAB Central Newsreader - passing images between two GUI</title>
    <description>Feed for thread: passing images between two GUI</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 08 Aug 2008 22:23:01 -0400</pubDate>
      <title>passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448234</link>
      <author>Dina </author>
      <description>&lt;br&gt;
i'm working on an ocr software , and i have 2 GUI's one for&lt;br&gt;
the manual character training, and one for the main program&lt;br&gt;
, the thing is .. i made this pushbutton in the main program&lt;br&gt;
GUI, that if the user wanted to train a certain character on&lt;br&gt;
this GUI it select it and send it to the other trainer GUI,&lt;br&gt;
i know how to select a part of the image .. i just dunno how&lt;br&gt;
to pass it to the other GUI.. can anyone help plz?&lt;br&gt;
&lt;br&gt;
also does any one know how to read directly from the scanner?</description>
    </item>
    <item>
      <pubDate>Fri, 08 Aug 2008 23:04:38 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448241</link>
      <author>bogfrog</author>
      <description>&amp;gt; &lt;br&gt;
&amp;gt; i'm working on an ocr software , and i have 2 GUI's&lt;br&gt;
&amp;gt; one for&lt;br&gt;
&amp;gt; the manual character training, and one for the main&lt;br&gt;
&amp;gt; program&lt;br&gt;
&amp;gt; , the thing is .. i made this pushbutton in the main&lt;br&gt;
&amp;gt; program&lt;br&gt;
&amp;gt; GUI, that if the user wanted to train a certain&lt;br&gt;
&amp;gt; character on&lt;br&gt;
&amp;gt; this GUI it select it and send it to the other&lt;br&gt;
&amp;gt; trainer GUI,&lt;br&gt;
&amp;gt; i know how to select a part of the image .. i just&lt;br&gt;
&amp;gt; dunno how&lt;br&gt;
&amp;gt; to pass it to the other GUI.. can anyone help plz?&lt;br&gt;
&lt;br&gt;
You might want to take a look at this video:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/pick/2005/10/03/guide-video-part-two/&quot;&gt;http://blogs.mathworks.com/pick/2005/10/03/guide-video-part-two/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
That's the way I do stuff like this.  Maybe someone else knows of better ways?</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 00:00:20 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448250</link>
      <author>Dina </author>
      <description>bogfrog &amp;lt;jmcgraw@rcn.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;24866908.1218236727917.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; i'm working on an ocr software , and i have 2 GUI's&lt;br&gt;
&amp;gt; &amp;gt; one for&lt;br&gt;
&amp;gt; &amp;gt; the manual character training, and one for the main&lt;br&gt;
&amp;gt; &amp;gt; program&lt;br&gt;
&amp;gt; &amp;gt; , the thing is .. i made this pushbutton in the main&lt;br&gt;
&amp;gt; &amp;gt; program&lt;br&gt;
&amp;gt; &amp;gt; GUI, that if the user wanted to train a certain&lt;br&gt;
&amp;gt; &amp;gt; character on&lt;br&gt;
&amp;gt; &amp;gt; this GUI it select it and send it to the other&lt;br&gt;
&amp;gt; &amp;gt; trainer GUI,&lt;br&gt;
&amp;gt; &amp;gt; i know how to select a part of the image .. i just&lt;br&gt;
&amp;gt; &amp;gt; dunno how&lt;br&gt;
&amp;gt; &amp;gt; to pass it to the other GUI.. can anyone help plz?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You might want to take a look at this video:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/pick/2005/10/03/guide-video-part-two/&quot;&gt;http://blogs.mathworks.com/pick/2005/10/03/guide-video-part-two/&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; That's the way I do stuff like this.  Maybe someone else&lt;br&gt;
knows of better ways?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
i watched this video .. i just dunno how to apply that on&lt;br&gt;
axes .. i'm a matlab newbie&lt;br&gt;
&lt;br&gt;
but thanx anyway</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 00:27:56 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448257</link>
      <author>bogfrog</author>
      <description>&amp;gt; i watched this video .. i just dunno how to apply&lt;br&gt;
&amp;gt; that on&lt;br&gt;
&amp;gt; axes .. i'm a matlab newbie&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but thanx anyway&lt;br&gt;
&lt;br&gt;
Well what you should take away, is that you can store your data using setappata() and then get it anywhere else using the handle to where it is stored.  So, you might have this in the _opening function_ of your main gui:&lt;br&gt;
&lt;br&gt;
setappdata(0,'hMainGui',gcf); %note: gcf gets the handle&lt;br&gt;
&lt;br&gt;
then, once you load up your image elsewhere in your code, you can do this:&lt;br&gt;
&lt;br&gt;
setappdata(hMainGui,'myImage',imageMatrix);&lt;br&gt;
&lt;br&gt;
then inside the functions for your _other_ gui, you do this:&lt;br&gt;
&lt;br&gt;
hMainGui = getappdata(0,'hMainGui');&lt;br&gt;
imageMatrix = getappdata(hMainGui,'myImage');&lt;br&gt;
&lt;br&gt;
and you will have access to the image in your new gui.</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 01:14:01 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448266</link>
      <author>Dina </author>
      <description>bogfrog &amp;lt;jmcgraw@rcn.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;21579291.1218241707359.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; i watched this video .. i just dunno how to apply&lt;br&gt;
&amp;gt; &amp;gt; that on&lt;br&gt;
&amp;gt; &amp;gt; axes .. i'm a matlab newbie&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; but thanx anyway&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Well what you should take away, is that you can store your&lt;br&gt;
data using setappata() and then get it anywhere else using&lt;br&gt;
the handle to where it is stored.  So, you might have this&lt;br&gt;
in the _opening function_ of your main gui:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; setappdata(0,'hMainGui',gcf); %note: gcf gets the handle&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; then, once you load up your image elsewhere in your code,&lt;br&gt;
you can do this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; setappdata(hMainGui,'myImage',imageMatrix);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; then inside the functions for your _other_ gui, you do this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; hMainGui = getappdata(0,'hMainGui');&lt;br&gt;
&amp;gt; imageMatrix = getappdata(hMainGui,'myImage');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and you will have access to the image in your new gui.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
it gives me this error&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Undefined function or variable 'hMainGui'.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; Main&amp;gt;Main_OpeningFcn at 56&lt;br&gt;
setappdata(hMainGui,'C',imageMatrix);&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; gui_mainfcn at 210&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feval(gui_State.gui_OpeningFcn, gui_hFigure, [],&lt;br&gt;
guidata(gui_hFigure), varargin{:});&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; Main at 42&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gui_mainfcn(gui_State, varargin{:});&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&lt;br&gt;
i would really appreciate it if u gave me more details ..&lt;br&gt;
like what should i write in the pushbutton callback?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
thanks alot</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 03:53:44 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448274</link>
      <author>bogfrog</author>
      <description>&amp;gt; it gives me this error&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  Undefined function or variable 'hMainGui'.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Error in ==&amp;gt; Main&amp;gt;Main_OpeningFcn at 56&lt;br&gt;
&amp;gt; setappdata(hMainGui,'C',imageMatrix);&lt;br&gt;
&lt;br&gt;
If you are in your main opening function, for the main gui, before that line (where you get the error), you should have:&lt;br&gt;
&lt;br&gt;
setappdata(0,'hMainGui',gcf)&lt;br&gt;
hMainGui = getappdata(0,'hMainGui')&lt;br&gt;
&lt;br&gt;
then you can do&lt;br&gt;
&lt;br&gt;
setappdata(hMainGui,'C',imageMatrix);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
See, '0' is the handle to the root workspace.  So in the first line above, I save the gui handle (gotten by gcf) to a application datum I call &quot;hMainGui&quot; stored in the root workspace.  Then I get it from the root (2nd line) and assign it to a variable called hMainGui.  Now the hMainGui handle is defined.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; i would really appreciate it if u gave me more&lt;br&gt;
&amp;gt; details ..&lt;br&gt;
&amp;gt; like what should i write in the pushbutton callback?&lt;br&gt;
&lt;br&gt;
that depends on what you want the pushbutton to do.  I'm not familiar enough with what you're doing to answer. But if you want to access the image data, assuming you build on the same code as above, you would do this:&lt;br&gt;
&lt;br&gt;
hMainGui = getappdata(0,'hMainGui');&lt;br&gt;
image = getappdata(hMainGui,'C')&lt;br&gt;
&lt;br&gt;
now the image should be stored in 'image'</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 08:26:19 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448289</link>
      <author>bogfrog</author>
      <description>You know what... you actually can pass to a gui, in the same way you do to a function.&lt;br&gt;
&lt;br&gt;
In the opening function of the gui, do this:&lt;br&gt;
&lt;br&gt;
handles.input1 = varargin{1};&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
and then elsewhere in this gui, the variable you passed will be in handles.input.</description>
    </item>
    <item>
      <pubDate>Mon, 11 Aug 2008 02:50:03 -0400</pubDate>
      <title>Re: passing images between two GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/174042#448443</link>
      <author>Dina </author>
      <description>bogfrog &amp;lt;jmcgraw@rcn.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;6587715.1218270409944.JavaMail.jakarta@nitrogen.mathforum.o&lt;br&gt;
rg&amp;gt;...&lt;br&gt;
&amp;gt; You know what... you actually can pass to a gui, in the &lt;br&gt;
same way you do to a function.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In the opening function of the gui, do this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; handles.input1 = varargin{1};&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and then elsewhere in this gui, the variable you passed &lt;br&gt;
will be in handles.input.&lt;br&gt;
&lt;br&gt;
thank u</description>
    </item>
  </channel>
</rss>

