Hello, in my application I want to load my image once using a reader and then use this reader every time I want to make image processing in the input image.How could I declare this reader as global variable? I have tried many things but I didn;t manafe to use reader as global variable. I would appreciate your help.<br>
<br><i> typedef unsigned char InputPixelType;<br> typedef unsigned char OutputPixelType;<br><br> typedef itk::Image< InputPixelType, 3 > InputImageType;<br> typedef itk::Image< OutputPixelType, 2 > OutputImageType;<br>
<br> typedef itk::ImageFileReader< InputImageType > ReaderType;<br> typedef itk::ImageFileWriter< OutputImageType > WriterType;<br>ReaderType::Pointer reader = ReaderType::New();<br> reader->SetFileName( fileName.toStdString() );<br>
reader->Update();</i><br> <br><br>supposing that I have this function to load the reader<br><i><br>void MainWindow::push_button_File()<br>{<br><br> fileName = QFileDialog::getOpenFileName(this,<br> tr("Open File"), QDir::currentPath());<br>
<br>}</i><br><br>and this function to use the reader<br><br><i>void MainWindow::z_slice_extract()<br>{<br> reader=.....<br>}</i><br>