[Insight-users] exception error when load image
Luis Ibanez
luis.ibanez at kitware.com
Sun Jun 5 15:49:31 EDT 2011
Hi John,
If you are reusing a pipeline you should call
the method
UpdateLargestPossibleRegion()
in the last filter of the pipeline,
instead of just using:
Update()
Otherwise, the pipeline expects that the new
input image has the same size of the previous
input image.
Luis
----------------------------------------------------
On Wed, Jun 1, 2011 at 9:05 AM, john smith <mkitkinsightuser at gmail.com> wrote:
> 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?
>
> _____________________________________
> 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
>
>
More information about the Insight-users
mailing list