[Insight-users] using reader as global variable
David Doria
daviddoria at gmail.com
Mon May 30 10:11:35 EDT 2011
On Mon, May 30, 2011 at 5:25 AM, john smith <mkitkinsightuser at gmail.com>wrote:
> I am using Qt add in for visual studio 2010 and I have typed this. But
> still gettting these errors:
> *1>e:\qt
> applications\mainwindow_globalreader\mainwindow\mainwindow\mainwindow.h(49):
> error C2065: 'ImageType' : undeclared identifier
> 1>e:\qt
> applications\mainwindow_globalreader\mainwindow\mainwindow\mainwindow.h(50):
> error C2955: 'itk::ImageFileReader' : use of class template requires
> template argument list
> 1> c:\itk\source\code\io\itkImageFileReader.h(93) : see
> declaration of 'itk::ImageFileReader'
> 1>e:\qt
> applications\mainwindow_globalreader\mainwindow\mainwindow\mainwindow.h(50):
> fatal error C1903: unable to recover from previous error(s); stopping
> compilation
> 1> mainwindow.cpp*
>
> I have include the header fules "itkImage.h" ,"itkImageFileReader.h".Could
> somebody help me?
>
> class MainWindow : public QMainWindow
> {
> ..............
>
>
> private:
> typedef itk::ImageFileReader< ImageType > ReaderType;
> ReaderType::Pointer reader;
>
> };
>
>
> MainWindow::MainWindow(QWidget *parent) :
> QMainWindow(parent),
> ui(new Ui::MainWindow)
> {
> ............
> ...........
> typedef unsigned char InputPixelType;
> typedef itk::Image< InputPixelType, 3 > InputImageType;
> typedef itk::ImageFileReader< InputImageType > ReaderType;
>
> ReaderType::Pointer reader = ReaderType::New();
>
> }
>
As the error says, you have not defined ImageType. You need something like
typedef itk::Image<unsigned char, 2> ImageType;
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110530/3ad7f22b/attachment.htm>
More information about the Insight-users
mailing list