I am using Qt add in for visual studio 2010 and I have typed this. But still gettting these errors:<br><i>1>e:\qt applications\mainwindow_globalreader\mainwindow\mainwindow\mainwindow.h(49): error C2065: 'ImageType' : undeclared identifier<br>
1>e:\qt applications\mainwindow_globalreader\mainwindow\mainwindow\mainwindow.h(50): error C2955: 'itk::ImageFileReader' : use of class template requires template argument list<br>1> c:\itk\source\code\io\itkImageFileReader.h(93) : see declaration of 'itk::ImageFileReader'<br>
1>e:\qt applications\mainwindow_globalreader\mainwindow\mainwindow\mainwindow.h(50): fatal error C1903: unable to recover from previous error(s); stopping compilation<br>1> mainwindow.cpp</i><br><br>I have include the header fules "itkImage.h" ,"itkImageFileReader.h".Could somebody help me?<br>
<br>class MainWindow : public QMainWindow<br>{<br> ..............<br><br>private: <br>typedef itk::ImageFileReader< ImageType > ReaderType;<br>ReaderType::Pointer reader;<br><br>};<br><br><br>MainWindow::MainWindow(QWidget *parent) :<br>
QMainWindow(parent),<br> ui(new Ui::MainWindow)<br>{<br>............<br>...........<br> typedef unsigned char InputPixelType;<br> typedef itk::Image< InputPixelType, 3 > InputImageType;<br> typedef itk::ImageFileReader< InputImageType > ReaderType;<br>
ReaderType::Pointer reader = ReaderType::New();<br> <br>}<br><br><br><div class="gmail_quote">2011/5/30 David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="gmail_quote"><div class="im">On Sun, May 29, 2011 at 7:21 PM, john smith <span dir="ltr"><<a href="mailto:mkitkinsightuser@gmail.com" target="_blank">mkitkinsightuser@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
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< ImageType > ReaderType;<div>
<br>
};<br></div></blockquote></div></div></div></blockquote><div><br>void MainWindow::push_button_File()<br>{<br><br> QString fileName = QFileDialog::getOpenFileName(this,<br> tr("Open File"), QDir::currentPath());<br>
<br> reader->SetFileName( fileName.toStdString() );<br> reader->Update();<br>}<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><br><br><br>MainWindow::MainWindow()<br>
{<br> reader = ReaderType::New();<br>}<br></div></blockquote><div><br></div></div>Now you have defined the type, but not created the variable. You need:<div class="im"><div>
<br></div><div><span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">typedef itk::ImageFileReader< ImageType > ReaderType;</span></div></div><div><font face="arial, sans-serif"><span style="border-collapse: collapse;">ReaderType::Pointer reader;<br clear="all">
</span></font><br></div><div>in the class.</div><div><br></div><font color="#888888"><div>David </div></font></div></div>
</blockquote></div><br>