<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249405</link>
    <title>MATLAB Central Newsreader - Using Array data to read in Images</title>
    <description>Feed for thread: Using Array data to read in Images</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>Sun, 19 Apr 2009 17:43:02 -0400</pubDate>
      <title>Using Array data to read in Images</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249405#643836</link>
      <author>Alexander </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I have an array in matalb called IMAGESDATA, each cell in the array holds two values; name and path, so for example &quot;IMAGESDATA(1,1).name&quot; = doneB.jpg and &quot;IMAGESDATA(1,2).path&quot; = C:\....... The array holds the details for 4 images.&lt;br&gt;
I want to read in each of the images in seperatly using their path and name in the IMAGESDATA array.&lt;br&gt;
so along the lines of:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;function Getimages(handles)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;global IMAGESDATA;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A = (imread ( IMAGESDATA(1,2) + IMAGESDATA(1,1) ));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;B = (imread ( IMAGESDATA(2,2) + IMAGESDATA2,1) ));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;C = (imread ( IMAGESDATA(3,2) + IMAGESDATA(3,1) ));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;D = (imread ( IMAGESDATA(4,2) + IMAGESDATA(5,1) ));&lt;br&gt;
&lt;br&gt;
Is there anyway of doing this?, do i need to put it in a function?,  can anyone help?&lt;br&gt;
&lt;br&gt;
Many Thanks&lt;br&gt;
&lt;br&gt;
Alex</description>
    </item>
    <item>
      <pubDate>Sun, 19 Apr 2009 18:37:01 -0400</pubDate>
      <title>Re: Using Array data to read in Images</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249405#643845</link>
      <author>Jiro Doke</author>
      <description>&quot;Alexander &quot; &amp;lt;airkemp@gmail.com&amp;gt; wrote in message &amp;lt;gsfnr6$5e9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have an array in matalb called IMAGESDATA, each cell in the array holds two values; name and path, so for example &quot;IMAGESDATA(1,1).name&quot; = doneB.jpg and &quot;IMAGESDATA(1,2).path&quot; = C:\....... The array holds the details for 4 images.&lt;br&gt;
&amp;gt; I want to read in each of the images in seperatly using their path and name in the IMAGESDATA array.&lt;br&gt;
&amp;gt; so along the lines of:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;      function Getimages(handles)&lt;br&gt;
&amp;gt;      global IMAGESDATA;&lt;br&gt;
&amp;gt;           &lt;br&gt;
&amp;gt;      A = (imread ( IMAGESDATA(1,2) + IMAGESDATA(1,1) ));&lt;br&gt;
&amp;gt;      B = (imread ( IMAGESDATA(2,2) + IMAGESDATA2,1) ));&lt;br&gt;
&amp;gt;      C = (imread ( IMAGESDATA(3,2) + IMAGESDATA(3,1) ));&lt;br&gt;
&amp;gt;      D = (imread ( IMAGESDATA(4,2) + IMAGESDATA(5,1) ));&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is there anyway of doing this?, do i need to put it in a function?,  can anyone help?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Many Thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Alex&lt;br&gt;
&lt;br&gt;
Alex,&lt;br&gt;
&lt;br&gt;
There are some inconsistencies in the way your described your problem. Do you have a cell array or an array of structures? &quot;IMAGESDATA(1,1).name&quot; is a syntax you use for structures. But then, I'm not sure why you don't have the path also stored in the (1,1) index, as in &quot;IMAGESDATA(1,1).path&quot;.&lt;br&gt;
&lt;br&gt;
So I'm just going to give you a general answer. If FILENAME contains the name of the file and PATHNAME contains the name of the path, you can create the full path to the file like this:&lt;br&gt;
&lt;br&gt;
fullfile(PATHNAME, FILENAME)&lt;br&gt;
&lt;br&gt;
Then pass that into IMREAD:&lt;br&gt;
&lt;br&gt;
imread(fullfile(PATHNAME, FILENAME))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Hope this helps.</description>
    </item>
    <item>
      <pubDate>Sun, 19 Apr 2009 19:03:02 -0400</pubDate>
      <title>Re: Using Array data to read in Images</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249405#643847</link>
      <author>Alexander </author>
      <description>&quot;Jiro Doke&quot; &amp;lt;jiro.doke@mathworks.com&amp;gt; wrote in message &amp;lt;gsfr0d$qke$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Alexander &quot; &amp;lt;airkemp@gmail.com&amp;gt; wrote in message &amp;lt;gsfnr6$5e9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I have an array in matalb called IMAGESDATA, each cell in the array holds two values; name and path, so for example &quot;IMAGESDATA(1,1).name&quot; = doneB.jpg and &quot;IMAGESDATA(1,2).path&quot; = C:\....... The array holds the details for 4 images.&lt;br&gt;
&amp;gt; &amp;gt; I want to read in each of the images in seperatly using their path and name in the IMAGESDATA array.&lt;br&gt;
&amp;gt; &amp;gt; so along the lines of:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;      function Getimages(handles)&lt;br&gt;
&amp;gt; &amp;gt;      global IMAGESDATA;&lt;br&gt;
&amp;gt; &amp;gt;           &lt;br&gt;
&amp;gt; &amp;gt;      A = (imread ( IMAGESDATA(1,2) + IMAGESDATA(1,1) ));&lt;br&gt;
&amp;gt; &amp;gt;      B = (imread ( IMAGESDATA(2,2) + IMAGESDATA2,1) ));&lt;br&gt;
&amp;gt; &amp;gt;      C = (imread ( IMAGESDATA(3,2) + IMAGESDATA(3,1) ));&lt;br&gt;
&amp;gt; &amp;gt;      D = (imread ( IMAGESDATA(4,2) + IMAGESDATA(5,1) ));&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Is there anyway of doing this?, do i need to put it in a function?,  can anyone help?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Many Thanks&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Alex&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Alex,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; There are some inconsistencies in the way your described your problem. Do you have a cell array or an array of structures? &quot;IMAGESDATA(1,1).name&quot; is a syntax you use for structures. But then, I'm not sure why you don't have the path also stored in the (1,1) index, as in &quot;IMAGESDATA(1,1).path&quot;.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; So I'm just going to give you a general answer. If FILENAME contains the name of the file and PATHNAME contains the name of the path, you can create the full path to the file like this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; fullfile(PATHNAME, FILENAME)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then pass that into IMREAD:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; imread(fullfile(PATHNAME, FILENAME))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hope this helps.&lt;br&gt;
&lt;br&gt;
Hi Jiro, Thanks for getting back.&lt;br&gt;
&lt;br&gt;
Applogies, IMAGESDATA is an array of structures, each structure within the array has 2 fields, path and name so IMAGESDATA(1,1) has a path field and a name field, IMAGESDATA(1,2) has a different path field and a name field so i need a way of access each individual field if possible.&lt;br&gt;
&lt;br&gt;
any ideas?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
Alex</description>
    </item>
    <item>
      <pubDate>Sun, 19 Apr 2009 19:13:01 -0400</pubDate>
      <title>Re: Using Array data to read in Images</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249405#643852</link>
      <author>Jiro Doke</author>
      <description>&quot;Alexander &quot; &amp;lt;airkemp@gmail.com&amp;gt; wrote in message &amp;lt;gsfsh6$4lb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hi Jiro, Thanks for getting back.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Applogies, IMAGESDATA is an array of structures, each structure within the array has 2 fields, path and name so IMAGESDATA(1,1) has a path field and a name field, IMAGESDATA(1,2) has a different path field and a name field so i need a way of access each individual field if possible.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; any ideas?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Alex&lt;br&gt;
&lt;br&gt;
Okay, so you should be able to do what I mentioned in the previous post:&lt;br&gt;
&lt;br&gt;
imread(fullfile(IMAGESDATA(1,1).path, IMAGESDATA(1,1).name))&lt;br&gt;
&lt;br&gt;
jiro</description>
    </item>
  </channel>
</rss>

