[Insight-users] using reader as global variable

john smith mkitkinsightuser at gmail.com
Sun May 29 19:21:42 EDT 2011


To be more specific I have tried the following, but still I get errors.
Could somebody tell me what to type?

Thanks in advance

 class MainWindow
{
private:
 typedef   itk::ImageFileReader< ImageType >   ReaderType;
};



MainWindow::MainWindow()
{
  reader = ReaderType::New();
}




void MainWindow::push_button_File()
{
      reader->SetFileName("test.png")
);
}


2011/5/29 Luis Ibanez <luis.ibanez at kitware.com>

> John,
>
> You are missing:
>
> typedef   itk::ImageFileReader< ImageType >   ReaderType.
>
> Please read the ITK Software Guide
>
>      http://www.itk.org/ItkSoftwareGuide.pdf
>
> in particular, Chapter 7 "Reading and Writing Images"
> in pdf-pages 295-246.
>
>
>
>     Luis
>
>
> ---------------------------------------------------------
> On Sun, May 29, 2011 at 1:24 PM, john smith <mkitkinsightuser at gmail.com>
> wrote:
> > When I am trying this I get a message which says
> > private:
> >   ReaderType::Pointer reader;
> > is not a class or namespace name
> >
> > 2011/5/29 David Doria <daviddoria at gmail.com>
> >>
> >> On Sun, May 29, 2011 at 10:00 AM, john smith <
> mkitkinsightuser at gmail.com>
> >> wrote:
> >>>
> >>> How I could do this? Could you give me an example?
> >>
> >> class MainWindow
> >> {
> >> private:
> >>   ReaderType::Pointer reader;
> >> };
> >>
> >> Then you could initialize it in the constructor:
> >>
> >> MainWindow::MainWindow()
> >> {
> >>   reader = ReaderType::New();
> >> }
> >>
> >> and use it in your function:
> >>
> >> void MainWindow::push_button_File()
> >> {
> >>       reader->SetFileName("test.png");
> >> }
> >>
> >> David
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110530/bee6a211/attachment.htm>


More information about the Insight-users mailing list