[Insight-users] exception error when load image

john smith mkitkinsightuser at gmail.com
Wed Jun 1 09:05:41 EDT 2011


Hello,

I have declared a reader as global variable
*
  typedef unsigned char        InputPixelType;
  typedef unsigned char        OutputPixelType;

  typedef itk::Image< InputPixelType,  3 >    InputImageType;
  typedef itk::Image< OutputPixelType, 2 >    OutputImageType;

  typedef itk::ImageFileReader< InputImageType  >  ReaderType;
  typedef itk::ImageFileWriter< OutputImageType >  WriterType;
  ReaderType::Pointer reader = ReaderType::New();*

I am using Qt to open and display images. So I have created a function
*
void MainWindow::push_button_File()
{

   fileName = QFileDialog::getOpenFileName(this,
                                   tr("Open File"), QDir::currentPath());

      reader->SetFileName( fileName.toStdString()  );
     reader->Update();
}*

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:

*Unhandled exception at 0x764ab727 in mainwindow.exe: Microsoft C++
exception: itk::InvalidRequestedRegionError at memory location 0x0095c0d8..*

Do you know why is this happening?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110601/adedc5db/attachment.htm>


More information about the Insight-users mailing list