[Insight-users] How to re-use an itk ImageFileReader?

Hua-Mei Chen huameichen0523 at gmail.com
Wed Oct 1 07:01:50 EDT 2008


Hi,

  I used the following code to read image data. However, my program had an 
error message "Access violation reading location 0xfeeefefe." the second 
time m_ImageFileReader->Delete( ) was invoked. Can anyone tell what goes 
wrong in my code? Thank you.

while (continue){

if (m_ImageFileReader != (void*) 0) m_ImageFileReader->Delete( );
m_ImageFileReader = ImageFileReaderType::New();
m_ImageFileReader->SetFileName( m_InputFileName);
m_InputImage = m_imageFileReader->GetOutput();
m_ImageFileReader->Update();
...
...
}

Chen


----- Original Message ----- 
From: "Hua-Mei Chen" <huameichen0523 at gmail.com>
To: "ITK Users" <insight-users at itk.org>
Sent: Tuesday, September 30, 2008 10:14 AM
Subject: How to re-use an itk ImageFileReader?


> Hi,
>
>   I am trying to re-use an itk ImageFileReader to read the same type of 
> images. However, it crashes the second time the Update( ) method is 
> involked. Do I need to New an itkImageFileReader each time I need one? Is 
> it possible to manually delete an existing itkImageFileReader before I New 
> another one? Please help. Thank you.
>
> Chen 



More information about the Insight-users mailing list