Hello,<br><br>I have declared a reader as global variable<br><i><br> 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();</i><br>
<br>I am using Qt to open and display images. So I have created a function<br><i><br>void MainWindow::push_button_File()<br>{<br><br> fileName = QFileDialog::getOpenFileName(this,<br> tr("Open File"), QDir::currentPath());<br>
<br> reader->SetFileName( fileName.toStdString() );<br> reader->Update();<br>}</i><br><br>My problem is that when I load my first image I do not have any problem. But when I reload my reader with an other image I get this exception error:<br>
<br><i>Unhandled exception at 0x764ab727 in mainwindow.exe: Microsoft C++ exception: itk::InvalidRequestedRegionError at memory location 0x0095c0d8..</i><br><br>Do you know why is this happening?<br>