To be more specific I have tried the following, but still I get errors. Could somebody tell me what to type?<br><br>Thanks in advance<br><br> class MainWindow<br>{<br>private:<br> typedef   itk::ImageFileReader&lt; ImageType &gt;   ReaderType;<br>
};<br><br><br><br>MainWindow::MainWindow()<br>
{<br>  reader = ReaderType::New();<br>}<br><br><br><div class="im"><br><br>void MainWindow::push_button_File()<br>{<br></div>      reader-&gt;SetFileName(&quot;test.png&quot;)<div>);<br>
}<br></div><br><br><div class="gmail_quote">2011/5/29 Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
John,<br>
<br>
You are missing:<br>
<br>
typedef   itk::ImageFileReader&lt; ImageType &gt;   ReaderType.<br>
<br>
Please read the ITK Software Guide<br>
<br>
      <a href="http://www.itk.org/ItkSoftwareGuide.pdf" target="_blank">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>
<br>
in particular, Chapter 7 &quot;Reading and Writing Images&quot;<br>
in pdf-pages 295-246.<br>
<br>
<br>
<br>
     Luis<br>
<br>
<br>
---------------------------------------------------------<br>
<div><div></div><div class="h5">On Sun, May 29, 2011 at 1:24 PM, john smith &lt;<a href="mailto:mkitkinsightuser@gmail.com">mkitkinsightuser@gmail.com</a>&gt; wrote:<br>
&gt; When I am trying this I get a message which says<br>
&gt; private:<br>
&gt;   ReaderType::Pointer reader;<br>
&gt; is not a class or namespace name<br>
&gt;<br>
&gt; 2011/5/29 David Doria &lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Sun, May 29, 2011 at 10:00 AM, john smith &lt;<a href="mailto:mkitkinsightuser@gmail.com">mkitkinsightuser@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; How I could do this? Could you give me an example?<br>
&gt;&gt;<br>
&gt;&gt; class MainWindow<br>
&gt;&gt; {<br>
&gt;&gt; private:<br>
&gt;&gt;   ReaderType::Pointer reader;<br>
&gt;&gt; };<br>
&gt;&gt;<br>
&gt;&gt; Then you could initialize it in the constructor:<br>
&gt;&gt;<br>
&gt;&gt; MainWindow::MainWindow()<br>
&gt;&gt; {<br>
&gt;&gt;   reader = ReaderType::New();<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; and use it in your function:<br>
&gt;&gt;<br>
&gt;&gt; void MainWindow::push_button_File()<br>
&gt;&gt; {<br>
&gt;&gt;       reader-&gt;SetFileName(&quot;test.png&quot;);<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; David<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>