[Insight-users] crashes N-D Linear Time Exact Signed Euclidean Distance Transform

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Sun Jul 6 04:17:34 EDT 2008


Hi,

I finally fixed that bug. It was caused by a wrong boundary test.
I have commited the fix both in ITK cvs and in the watershed  
repository (for the multithreaded version).

Please let us know if it works for you.

Thanks for the report, and for your patience.

Regards,

Gaëtan


Le 30 juin 08 à 17:18, Oleksandr Dzyubak a écrit :

> Hi Gaëtan,
>
> Please let me know if any progress.
>
> Thanks for your help,
> Alex
>
> Gaëtan Lehmann wrote:
>>
>> Hi Alex,
>>
>> I have reproduced your problem and I'm searching what is causing it  
>> currently.
>> I'll let you know if I found the problem.
>>
>> Regards,
>>
>> Gaëtan
>>
>> Le 19 juin 08 à 23:24, Oleksandr Dzyubak a écrit :
>>
>>> Hi Gaëtan,
>>>
>>> Thanks for your help.
>>> I am still getting the error below.
>>>
>>> ******** Begin Error********
>>> dzyubak at debian: /Lehmann$ ./SignedMaurerDistanceMapImageFilterTest  
>>> smallDataset.hdr out.hdr
>>> SignedMaurerDistanceMapImageFilterTest: /usr/local/include/ 
>>> InsightToolkit/Utilities/vxl/core/vnl/vnl_vector.h:168: T&  
>>> vnl_vector<T>::operator()(unsigned int) [with T = double]:  
>>> Assertion `i<size()' failed.
>>> Aborted
>>>
>>> *******End Error*******
>>>
>>> And I still want to make it work. In an attachment you can find  
>>> the archived source tree dm.tar.gz
>>> which I downloaded from the link you provided.
>>> To the directory I also added the images I tried to work with.
>>> I am using Debian Etch with gcc "version 4.1.2 20061115  
>>> (prerelease) (Debian 4.1.1-21)",
>>> "cmake version 2.6-patch 0", and "Insight_CVS_Jun_03_2008.tar.gz".
>>>
>>> I would be more than happy if you could give me a hint on how to  
>>> proceed.
>>>
>>> Alex
>>>
>>>
>>> Gaëtan Lehmann wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm afraid I can't reproduce any of the problems you have.
>>>> Can you send me your source tree? You seem to have put everything  
>>>> in a “Lehmann” directory — maybe with it, I would be able to  
>>>> reproduce them.
>>>>
>>>> Regards,
>>>>
>>>> Gaëtan
>>>>
>>>>
>>>>
>>>> Le 3 juin 08 à 21:36, Oleksandr Dzyubak a écrit :
>>>>
>>>>> Hi Gaëtan,
>>>>>
>>>>> Thanks for your help.
>>>>>
>>>>> I have rebuilt ITK to include all the changes made recently.
>>>>> Following the link you provided, I downloaded your version of  
>>>>> the filter.
>>>>> During the compilation I got some warnings but was able to get  
>>>>> an executable (see below).
>>>>> However when I ran the executable, the program crashed again
>>>>> with a different error message though (before it was malloc()  
>>>>> from AnalyzeIO).
>>>>>
>>>>> **************** Begin Error Message *********
>>>>> dzyubak at debian: /Lehmann$ ./ 
>>>>> SignedMaurerDistanceMapImageFilterTest SquareBinary201.hdr  
>>>>> test.hdr
>>>>> SignedMaurerDistanceMapImageFilterTest: /usr/local/include/ 
>>>>> InsightToolkit/Utilities/vxl/core/vnl/vnl_vector.h:168: T&  
>>>>> vnl_vector<T>::operator()(unsigned int) [with T = double]:  
>>>>> Assertion `i<size()' failed.
>>>>> Aborted
>>>>> ************** End Error Message ********
>>>>>
>>>>>
>>>>> *********** Begin Compilation Warnings ****
>>>>> dzyubak at debian: /BUILD$ make
>>>>> Scanning dependencies of target  
>>>>> SignedMaurerDistanceMapImageFilterTest
>>>>> [100%] Building CXX object CMakeFiles/ 
>>>>> SignedMaurerDistanceMapImageFilterTest.dir/ 
>>>>> itkSignedMaurerDistanceMapImageFilterTest.cxx.o
>>>>> /home/dzyubak/Test/N- 
>>>>> D_Linear_Time_Exact_Signed_Euclidean_Distance_Transform/Lehmann/ 
>>>>> itkBinaryBorderImageFilter.txx: In member function 'void  
>>>>> itk::BinaryBorderImageFilter<TInputImage,  
>>>>> TOutputImage 
>>>>> > 
>>>>> ::CompareLines 
>>>>> (std::vector<itk::BinaryBorderImageFilter<TInputImage,  
>>>>> TOutputImage>::runLength,  
>>>>> std::allocator<itk::BinaryBorderImageFilter<TInputImage,  
>>>>> TOutputImage>::runLength> >&, const  
>>>>> std::vector<itk::BinaryBorderImageFilter<TInputImage,  
>>>>> TOutputImage>::runLength,  
>>>>> std::allocator<itk::BinaryBorderImageFilter<TInputImage,  
>>>>> TOutputImage>::runLength> >&) [with TInputImage =  
>>>>> itk::Image<double, 3u>, TOutputImage = itk::Image<double, 3u>]':
>>>>> /home/dzyubak/Test/N- 
>>>>> D_Linear_Time_Exact_Signed_Euclidean_Distance_Transform/Lehmann/ 
>>>>> itkBinaryBorderImageFilter.txx:250:   instantiated from 'void  
>>>>> itk::BinaryBorderImageFilter<TInputImage,  
>>>>> TOutputImage>::ThreadedGenerateData(const typename  
>>>>> TOutputImage::RegionType&, int) [with TInputImage =  
>>>>> itk::Image<double, 3u>, TOutputImage = itk::Image<double, 3u>]'
>>>>> /home/dzyubak/Test/N- 
>>>>> D_Linear_Time_Exact_Signed_Euclidean_Distance_Transform/Lehmann/ 
>>>>> itkSignedMaurerDistanceMapImageFilterTest.cxx:69:   instantiated  
>>>>> from here
>>>>> /home/dzyubak/Test/N- 
>>>>> D_Linear_Time_Exact_Signed_Euclidean_Distance_Transform/Lehmann/ 
>>>>> itkBinaryBorderImageFilter.txx:405: warning: unused variable 'ee1'
>>>>> Linking CXX executable SignedMaurerDistanceMapImageFilterTest
>>>>> [100%] Built target SignedMaurerDistanceMapImageFilterTest
>>>>>
>>>>> ********* End Compilation Warnings *******
>>>>>
>>>>> Gaëtan Lehmann wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> The SignedMaurerDistanceMapImageFilter won't work when the  
>>>>>> input image is 2D but the filter is 3D — the size is 1 on one  
>>>>>> dimension.
>>>>>> I have fixed that in an external repository, with some other  
>>>>>> changes to
>>>>>>
>>>>>> a. avoid spending so much time in the border detection
>>>>>> b. multithread it
>>>>>> c. make it work with any sizes on all the dimensions
>>>>>>
>>>>>> That work is available at
>>>>>>
>>>>>> http://voxel.jouy.inra.fr/darcs/contrib-itk/watershed
>>>>>>
>>>>>> You'll have to take the classes  
>>>>>> SignedMaurerDistanceMapImageFilter and BinaryBorderImageFilter.
>>>>>>
>>>>>> I'll try to put b. and c. in ITK before the next release.
>>>>>> a. has to pass through the process of the peer review in the  
>>>>>> insight journal before being integrated in ITK.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gaëtan
>>>>>>
>>>>>>
>>>>>> Le 2 juin 08 à 21:18, Oleksandr Dzyubak a écrit :
>>>>>>
>>>>>>> Hi Bill,
>>>>>>>
>>>>>>> Now I am a bit confused by what you are saying.
>>>>>>>
>>>>>>> 1) You say that it works for 3D but does not for 2D.
>>>>>>> I cannot understand that since 2D dimensionality is a  
>>>>>>> particular case of 3D.
>>>>>>> Lets say 2D is a 3D with just one z-component. From my  
>>>>>>> prospective, it has to work
>>>>>>> for 2D if it does for 3D. Opposite is not necessary true though.
>>>>>>>
>>>>>>> 2) If I comment the writer out, the program still crashes with  
>>>>>>> the same error.
>>>>>>>
>>>>>>> 3) All my images are in the Analyze75 format
>>>>>>> and while using the other ITK filters I have not had any  
>>>>>>> problems so far.
>>>>>>> (I mean with ITK Analyze reader/writer, except orientations,  
>>>>>>> of course).
>>>>>>>
>>>>>>> Do you mean that even though my executables did not complain,
>>>>>>> the results I was getting could be wrong since I used ITK  
>>>>>>> Analyze reader/writer?
>>>>>>>
>>>>>>> If so, in what fashion could the final results be wrong?
>>>>>>>
>>>>>>> Is it error-prone for some particular platform/compiler
>>>>>>> (Linux Debian with gcc 4.1.2 in my case) or it is more general  
>>>>>>> case?
>>>>>>>
>>>>>>> How severe does it affect the final results?
>>>>>>>
>>>>>>> Thanks for your help,
>>>>>>>
>>>>>>> Alex
>>>>>>>
>>>>>>>
>>>>>>> Bill Lorensen wrote:
>>>>>>>> Oleksandr,
>>>>>>>>
>>>>>>>> There are some known problems in the ITK Analyze reader/ 
>>>>>>>> writer when
>>>>>>>> the images are 2D and not 3D. I think the read part has been  
>>>>>>>> fixed
>>>>>>>> recently. However, the write part still has problems. If your  
>>>>>>>> images
>>>>>>>> are 3D, then all should be fine. Until we fix this 2D Analyze  
>>>>>>>> image
>>>>>>>> problem, I'm afraid you cannot run the filters.
>>>>>>>>
>>>>>>>> Bill
>>>>>>>>
>>>>>>>> On Sun, Jun 1, 2008 at 1:07 PM, Oleksandr Dzyubak <adzyubak at gmail.com 
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>> Hi Bill,
>>>>>>>>>
>>>>>>>>> This time I try to be more accurate.
>>>>>>>>>
>>>>>>>>> 1) I downloaded ITK from CVS, compiled with the RelWithDeb  
>>>>>>>>> flag, and
>>>>>>>>> installed on my Linux box.
>>>>>>>>> 2) I have Debian Etch with gcc 4.1.2
>>>>>>>>> 3) The example itkSignedMaurerDistanceMapImageFilterTest.cxx  
>>>>>>>>> was taken
>>>>>>>>> from ITK distro and not from IJ.
>>>>>>>>>
>>>>>>>>> Insight/Testing/Code/BasicFilters/ 
>>>>>>>>> itkSignedMaurerDistanceMapImageFilterTest.cxx
>>>>>>>>>
>>>>>>>>> 4) Example was compiled in debug mode.
>>>>>>>>> 5) As you advised, the example was run on both  
>>>>>>>>> SquareBinary201.png and
>>>>>>>>> SquareBinary201.hdr.
>>>>>>>>>
>>>>>>>>> Results.
>>>>>>>>> As you predicted, the example has processed the *.png image  
>>>>>>>>> taken from ITK
>>>>>>>>> distro resulting
>>>>>>>>> in a nice looking map.
>>>>>>>>>
>>>>>>>>> dzyubak at debian: /BUILD$ ./ 
>>>>>>>>> SignedMaurerDistanceMapImageFilterTest
>>>>>>>>> SquareBinary201.png test_png.hdr
>>>>>>>>> WARNING: In /root/Insight/Code/IO/itkAnalyzeImageIO.cxx,  
>>>>>>>>> line 1280
>>>>>>>>> AnalyzeImageIO (0x8169a98): ERROR: Analyze 7.5 File Format  
>>>>>>>>> Only Allows RPI,
>>>>>>>>> PIR, and RIP Orientation
>>>>>>>>>
>>>>>>>>> However when I tried to run it on a real stuff (all my  
>>>>>>>>> images in Analyze75
>>>>>>>>> format), the same image but
>>>>>>>>> taken from IJ archive (SquareBinary201.hdr), it crashes.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Insight-users mailing list
>>>>>>> Insight-users at itk.org
>>>>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>>>
>>>>>> --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  http://www.mandriva.org
>>>>>> http://www.itk.org  http://www.clavier-dvorak.org
>>>>>>
>>>>>
>>>>
>>>> --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  http://www.mandriva.org
>>>> http://www.itk.org  http://www.clavier-dvorak.org
>>>>
>>>
>>> <dm.tar.gz>
>>
>> --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  http://www.mandriva.org
>> http://www.itk.org  http://www.clavier-dvorak.org
>>
>

-- 
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  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080706/a48f3c8d/attachment.pgp>


More information about the Insight-users mailing list