[Insight-developers] DanielssonDistanceMapImage segfaults

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Mar 14 11:30:49 EST 2006


Hi,

I'm trying to use the DanielssonDistanceMapImageFilter with some images  
whith a size which is sometime 1 on one dimension, and the filter segfault  
in that case. It seem that the ReflectiveImageRegionConstIterator try to  
access pixels outside the image (!) and that make

       components->GetPixel( here ) = offsetValueThere;

fail in UpdateLocalDistance() method.

I have no idea how to fix that, so I tried to pad the image by one on all  
faces, apply the distance map filter, and crop the pixel, but again I get  
a segfault. I have to use the pad and crop filters AND to call Udapte() on  
my DanielssonDistanceMapImage before calling Update() on the last filter  
filter of my pipeline to finally get the result without segfault.

The problem is easy to reproduce: write a pipeline

reader 3D
danielsson distance map 3D
writer 3D

and read a 2D image (cthead1.png for example) is enough.

It seems that there is several bugs which should be fixed in  
DanielssonDistanceMapImage class :-)

Gaetan

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-developers mailing list