[Insight-users] Runtime error about"itkimagefilereader" &SignedDanielssonDistanceMapImageFilter

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 23 09:10:28 EDT 2006


Hi Jianfeng,

If you had a previous application that was mixing
elements build for Debug with elements build for Release,
and that application "worked fine", it just means that
you were "very lucky", and that luck will probably not
last for long.

You should not mix compilation modes. In fact the Visual Studio
linker warns you about that when you attempt to mix compilation
modes. Unfortunately, Visual Studio, then let you put the rope
around your neck by offering you the option of forcing the linking
to continue.

Many users, naively, accept that offer and end up with executables
that have unpredictable behavior.


About the DanielssonDistance filter. It is a N-D filter, just as
most of the ITK filters. The distance map will have the same dimension
as the input image.

   If your input image is 2D, the distance map will be 2D
   If your input image is 3D, the distance map will be 3D
   If your input image is 4D, the distance map will be 4D...


You may want to read the ITK Software Guide:


     http://www.itk.org/ItkSoftwareGuide.pdf


there is a section that describes the use of the Danielson
Distance filter.



    Regards,



       Luis



------------------------
jxu9 at uiuc.edu wrote:
> Hello, Luis and Andinet,
> 
> I can read the png file if I set my application "release"
> mode,but I am puzzled about that. Is it a requirement to set
> both ITK and my application the exact same compilation
> mode? I remember my previous applications were not but worked
> well.
> 
> Another problem about SignedDanielssonDistanceMapImageFilter,
> which is used to create a distance mapping. I think the
> output image should be 3D, if the input one is 2D. is it right?
> 
> Bests,
> Jianfeng
> 
> ---- Original message ----
> 
>>Date: Sun, 22 Oct 2006 14:27:14 -0400
>>From: Luis Ibanez <luis.ibanez at kitware.com>  
>>Subject: Re: [Insight-users] Runtime error about"itkimagefilereader"  
>>To: jxu9 at uiuc.edu
>>Cc: insight-users at itk.org
>>
>>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
>>>
> 
> _______________________________________________
> 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