[Insight-users] Runtime error about"itkimagefilereader"

Luis Ibanez luis.ibanez at kitware.com
Sun Oct 22 14:27:14 EDT 2006


Hi Jianfeng,

As the reply email to 2005-April/012712.html says...

You are probably mixing Debug and Release builds.

Please make sure that you build both ITK and your
application for the exact same compilation mode:

            Debug or Release

Also, you may want to add the following line
after the Update() call, in order to identify
where is your application crashing:

    ImageReader->Update();
    ImageReader->GetOutput()->Print( std::cout );

Please let us know what you find.


   Thanks


      Luis


--------------------
jxu9 at uiuc.edu wrote:
> Hello, Andinet,
> 
> Thank you for your respond.
> The error is:
> -------------------------------------
> Debug Assertion Failed!
> 
> Program:E:\Project\vtkitk.exe
> File:dbgheap.c
> Line:1011
> Expression:_CrtIsValidHeapPointer(pUserData)
> ........
>  Abort          Retry          Ignore
> ---------------------------------------------------------------
> I think I have the same problem in the link:
> http://public.kitware.com/pipermail/insight-users/2005-April/012712.html
> In the mode "release", there is no error, but the result seems incorrect, 
> while in the mode "debug", a error described above will occur.
> However,I do not understand the solution showed in the link.
> When I cmaked the ITK sorce code, I set the option "ITK_USE_SYSTEM_PNG"
> and "ITK_USE_SYSTEM_PNG"  both "OFF". Do I need to reset them to be "ON"?
> 
> Thank you again!
> 
> Bests,
> Jianfeng Xu
> 
> ---- Original message ----
> 
>>Date: Sun, 22 Oct 2006 09:52:03 -0400
>>From: Andinet Enquobahrie <andinet.enqu at kitware.com>  
>>Subject: Re: [Insight-users] Runtime error about"itkimagefilereader"  
>>To: Jianfeng Xu at UIUC <jxu9 at uiuc.edu>
>>Cc: insight-users at itk.org
>>
>>Jianfeng Xu at UIUC wrote:
>>
>>
>>>Hello, All,
>>
>>What is the runtime error you are getting? Give us the details...
>>
>>
>>>I have some problem with reading PNG files. When I run my code, a
>>>"Runtime Error" will occur.
>>>My code is simple and showed as follows:
>>>typedef itk::Image<unsigned short,2> InternalImageType;
>>>typedef itk::ImageFileReader< InternalImageType > ImageReaderType;
>>>ImageReaderType::Pointer ImageReader;
>>>ImageReader=ImageReaderType::New();
>>>ImageReader->SetFileName("med.png");
>>>ImageReader->Update();
>>>The image is created by the Windows tool "Paint" and saved as "png" file.
>>>Could some one shed light on it? Thank you!
>>>Bests,
>>>Jianfeng
>>>
>>>------------------------------------------------------------------------
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>> 
>>>
>>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list