<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239524</link>
    <title>MATLAB Central Newsreader - Instantiation of multiple images in a GUI</title>
    <description>Feed for thread: Instantiation of multiple images in a 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>Wed, 19 Nov 2008 17:43:02 -0500</pubDate>
      <title>Instantiation of multiple images in a GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239524#611856</link>
      <author>Thiago Jota</author>
      <description>I'm trying to instantiate an unique image within each axes object of my GUI. Unfortunately, this becomes problematic after the first image. I am using imread and imshow in the callback of each axes object. Is there any alternative?&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 18:48:30 -0500</pubDate>
      <title>Re: Instantiation of multiple images in a GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239524#611878</link>
      <author>ImageAnalyst</author>
      <description>On Nov 19, 12:43=A0pm, &quot;Thiago Jota&quot; &amp;lt;thi...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I'm trying to instantiate an unique image within each axes object of my G=&lt;br&gt;
UI. Unfortunately, this becomes problematic after the first image. I am usi=&lt;br&gt;
ng imread and imshow in the callback of each axes object. Is there any alte=&lt;br&gt;
rnative?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------------=&lt;br&gt;
---------------------------&lt;br&gt;
Thiago Jota:&lt;br&gt;
Don't load images into the axes in the callback of the axes.  You can&lt;br&gt;
do it in the callback of your listbox or some other function.  You&lt;br&gt;
click on an image filename in your listbox, or set it in your function&lt;br&gt;
somehow.  Then in the call back of the listbox, or in that other&lt;br&gt;
function, you can call imread and imshow.  Before you call those&lt;br&gt;
however, make sure you call the axes function and pass it the handle&lt;br&gt;
to the axes where you want the image displayed.&lt;br&gt;
&lt;br&gt;
Clicking on an axes is problematic because once an image is thrown&lt;br&gt;
into it, I think it essentially lies on top of the axes and you can&lt;br&gt;
never click on the axes again because it's underneath the image -&lt;br&gt;
you're clicking on the image which is a child of the axes and you'd&lt;br&gt;
have to set up a callback for that image which is separate from the&lt;br&gt;
callback of the axes that it lives in.  Really quirky, I know.&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 20:54:02 -0500</pubDate>
      <title>Re: Instantiation of multiple images in a GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239524#611916</link>
      <author>Thiago </author>
      <description>I've found a solution! After creating axes objects in GUIDE, place this code inside each &quot;axes_CreateFcn&quot; callback:&lt;br&gt;
&lt;br&gt;
axes(hObject)&lt;br&gt;
imshow('file.extension');&lt;br&gt;
title('')&lt;br&gt;
&lt;br&gt;
I am able to instantiate multiple images in the same figure with this technique, which originated from this tutorial by Doug Hull:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-background-image-for-a-gui/&quot;&gt;http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-background-image-for-a-gui/&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 21:14:27 -0500</pubDate>
      <title>Re: Instantiation of multiple images in a GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239524#611920</link>
      <author>ImageAnalyst</author>
      <description>On Nov 19, 3:54=A0pm, &quot;Thiago &quot; &amp;lt;thi...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I've found a solution! After creating axes objects in GUIDE, place this c=&lt;br&gt;
ode inside each &quot;axes_CreateFcn&quot; callback:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; axes(hObject)&lt;br&gt;
&amp;gt; imshow('file.extension');&lt;br&gt;
&amp;gt; title('')&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am able to instantiate multiple images in the same figure with this tec=&lt;br&gt;
hnique, which originated from this tutorial by Doug Hull:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-ba...&quot;&gt;http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-ba...&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------&lt;br&gt;
Yes, most of the time you need to call the axes command to set the&lt;br&gt;
current graphics object (the &quot;gca&quot;) to the one you want to put stuff&lt;br&gt;
into before you put the stuff in.  So that's why it worked for you.&lt;br&gt;
It's a bit puzzling though.  You'd think that inside the creation&lt;br&gt;
callback for the axes, that the gca would already be that axes, but&lt;br&gt;
maybe not.  In other words I'm surprised you had to do that because&lt;br&gt;
you'd think that that would have already been done automatically&lt;br&gt;
without you having to explicitly do it.  Maybe that doesn't occur&lt;br&gt;
until the creation callback completely terminates.  But if that were&lt;br&gt;
the case, (the axes weren't yet full created) then how could you issue&lt;br&gt;
an axes() command to it?</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 21:27:02 -0500</pubDate>
      <title>Re: Instantiation of multiple images in a GUI</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239524#611922</link>
      <author>Thiago </author>
      <description>The tutorial I cited explains why.&lt;br&gt;
&lt;br&gt;
ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;236663b5-3953-416e-a6d9-256634da7feb@g38g2000yqd.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Nov 19, 3:54=A0pm, &quot;Thiago &quot; &amp;lt;thi...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; I've found a solution! After creating axes objects in GUIDE, place this c=&lt;br&gt;
&amp;gt; ode inside each &quot;axes_CreateFcn&quot; callback:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; axes(hObject)&lt;br&gt;
&amp;gt; &amp;gt; imshow('file.extension');&lt;br&gt;
&amp;gt; &amp;gt; title('')&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I am able to instantiate multiple images in the same figure with this tec=&lt;br&gt;
&amp;gt; hnique, which originated from this tutorial by Doug Hull:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &lt;a href=&quot;http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-ba...&quot;&gt;http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-ba...&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -------------------------------------------------------------------&lt;br&gt;
&amp;gt; Yes, most of the time you need to call the axes command to set the&lt;br&gt;
&amp;gt; current graphics object (the &quot;gca&quot;) to the one you want to put stuff&lt;br&gt;
&amp;gt; into before you put the stuff in.  So that's why it worked for you.&lt;br&gt;
&amp;gt; It's a bit puzzling though.  You'd think that inside the creation&lt;br&gt;
&amp;gt; callback for the axes, that the gca would already be that axes, but&lt;br&gt;
&amp;gt; maybe not.  In other words I'm surprised you had to do that because&lt;br&gt;
&amp;gt; you'd think that that would have already been done automatically&lt;br&gt;
&amp;gt; without you having to explicitly do it.  Maybe that doesn't occur&lt;br&gt;
&amp;gt; until the creation callback completely terminates.  But if that were&lt;br&gt;
&amp;gt; the case, (the axes weren't yet full created) then how could you issue&lt;br&gt;
&amp;gt; an axes() command to it?</description>
    </item>
  </channel>
</rss>

