[Insight-users] vessel enhancing diffusion filter (release 200)

Luis Ibanez luis.ibanez at kitware.com
Thu Jun 12 18:11:30 EDT 2008


Hi Oleksandr,


We are glad to hear that you found this Insight Journal paper useful.


Just to make the credits straight:

      The orginal filter was proposed in:

        "Vessel enhancing diffusion:
         A scale space representation of vessel structures."
         by R. Mannieshing, M.A. Viergever, and W. J . Niessen.
         Medical Image Analysis, 2006.

The implementation of this filter in ITK code was done by
Andinet Enquobahrie (at Kitware) and supervised by Stephen Aylward
(at Kitware).


---------

About your question regarding memory requirements:

1) The number "6" in the formula comes from the representation
    of the Hessian matrix in ITK. Hessian matrices are symmetric
    and therfore, instead of 9 independent components, they only
    have 6 independent components. Therefore ITK use only 6 doubles
    for storing them.

2) Yes, there are more intermediate structures used internally,
    than the ones used by the Hessian filter.


3) The swap memory should count. That is, you should be able
    to allocate 4Gb in your machine.

    That's actually an interesting test to perform before we
    move further.

    Can you check in a simple C++ program that you can allocate
    an array of 4Gb (well... maybe 3.5Gb) of memory ?


4) When the filter was tested, images of 100x100x100 were used.
    We will have to profile memory use starting from there...


5) It will be useful to know what the actuall memory request was.
    Did you got that number as part of the error message ?

    If so, could you please post it to the list ?



   Thanks


      Luis




--------------------------
Oleksandr Dzyubak wrote:
> Hi Luis,
> 
> First of all many thanks all of you for such a good filter, "Vessel 
> enhancing diffusion filter".
> With great pleasure I read the article from the the IJ distribution and 
> the references therein.
> 
> Since I am working on vessels, of course, I was tempted to give that 
> filter a try. So I did.
> As well as Laura, I got the same error message and following your advice
> and formula, I calculated the memory request.
> 
> I tested the filter using an image 565x440x100 pixels.
> BTW, why 6 in your formula "sizeof(double) x 6 bytes per pixel"?
> Do you store some intermediate results all the time?
> Lets calculate memory. In my case sizeof(double)=8.
> 
> octave:2> 8*6*(565*440*100)
> ans = 1193280000
> 
> OK. Filter + ImageItself = 1.19 +  0.0497 ~ 1.2397 GB
> 
> I have 2 GB + 2 GB (swap). As you say, I almost hit the limit but some 
> piece is still left.
> Does a swap part count? I cropped the original image (which is 100 times 
> larger then the one I used)
> down to 47MB just to test the filter and even with such a small image 
> size the filter fails to allocate memory?
> 
> Does it mean that this filter has no use for boxes with limited resources?
> 
> BTW, the only "itkAnisotropicDiffusionVesselEnhancementImageFilterTest" 
> fails.
> The other one, 
> "itkMultiScaleHessianSmoothed3DToVesselnessMeasureImageFilterTest" works 
> fine.
> 
> Just by luck or you implemented another memory model?
> 
> Thanks,
> 
> Alex
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Laura,
>>
>> This is annoying, but normal.
>>
>> This code computes Hessians of images, which in 3D requires
>> the allocation of sizeof(double) x 6 bytes per pixel.
>>
>> That is, you will need 48 bytes per pixel of your image
>> in order to store the resulting Hessian alone. There will be
>> of course additional intermediate allocations.
>>
>> If you need to process large images you may need a 64bits
>> machine with a larger memory...
>>
>> What is the actual size (in pixels) of the image that
>> you are processing ?
>>
>> Can you process selected regions of the image ?
>>
>> Usually there is a lot of empty (or at least, non interesting)
>> space in medical images. You could use the RegionOfInterest
>> filter to reduce the vessel enhancing processing to smaller
>> section of the image.
>>
>>
>> Please let us know,
>>
>>
>>     Thanks
>>
>>
>>        Luis
>>
>>
>>
>>
>>
>> ---------------------------------
>> Laura Fernandez de Manuel wrote:
>>
>>> Hi all,
>>>  
>>> We have been checking the implementation of the "Vessel Enhancing 
>>> Diffusion Filter" depicted here:
>>>  
>>> http://insight-journal.org/midas/handle.php?handle=1926/558
>>>  
>>> although it works properly with the example 3D images provided 
>>> (ranging from around 30 to 250 KB) we didn't succeed to make it work 
>>> in images any larger (5MB images failed already for instance). We 
>>> work in a system with 4GB RAM so we don't know which can be the 
>>> source of the "Failed to allocate memory for image" errors that we 
>>> get. Here, I attach the error message we get:
>>>  
>>> ------------------------------------------------------------------------------------------------------ 
>>>
>>> ./itkAnisotropicDiffusionVesselEnhancementImageFilterTest.exe 
>>> image00_2.mhd image_2Enhanced.mhd
>>> Reading input image : image00_2.mhd
>>> Enhancing vessels.........: image00_2.mhd
>>> Iteration:      0
>>> Computing vesselness for scale with sigma= 0.2
>>> Exception caught:
>>> itk::ExceptionObject (0138FB20)
>>> Location: "class itk::SymmetricSecondRankTensor<double,3> *__thiscall 
>>> itk::ImportImageContainer<unsigned long,class 
>>> itk::SymmetricSecondRankTensor<double,3> >:: AllocateElements 
>>> (unsigned long) const"
>>> File: itk3.6.0\code\common\itkImportImageContainer.txx
>>> Line: 193
>>> Description: Failed to allocate memory for image.
>>> ------------------------------------------------------------------------------------------------------ 
>>>
>>>  
>>> Thanks a lot!
>>>  
>>> carlos & laura
>>>
>>>  
>>>  
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> 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