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

Luis Ibanez luis.ibanez at kitware.com
Thu Jun 12 18:14:49 EDT 2008


Yes, Federico is right here.

Thanks to the symmetry of the Hessian matrix,
ITK only needs to store 6 components.


The Hessian matrix in 3D has 9 components:

      Hxx  Hxy  Hxz
      Hyx  Hyy  Hyz
      Hzx  Hzy  Hyz


and the symmetry is such that

      Hxy = Hyx
      Hzx = Hxz
      Hzy = Hyz


Therefore ITK only stores the six values:


     Hxx, Hyy, Hzz, Hxy, Hxz, Hyz



    Regards,


       Luis


-------------------------
fjlb at duke.edu wrote:
> 
> Oleksandr,
> 
> I assumed you had a 3D dataset. Yes, in 3D the Hessian has 9 components 
> put they
> are repeated so you essentially only need to compute 6 of them. My original
> dataset was of 512x512x164 and I cropped/downsampled to 175x150x82 and the
> filter worked fine on a PC with 3GB of RAM. I guess that for larger 
> datasets
> Luis recommended 64 bit machines but I'm not sure.
> 
> 
> Federico
> Quoting Oleksandr Dzyubak <adzyubak at gmail.com>:
> 
>> Hi Frederico,
>>
>> In 2-D case the Hessian matrix has 4 components.
>> If we are talking about 3-D, then it should be 9.
>> In general case it has to be 2^d, where d is your dimension.
>>
>> I cropped and downsapmled my image just for the computation time 
>> saving sake.
>> In reality, my images would be much larger.
>> And as Luis mentioned in some of his emails a while ago,
>> there should be way/room for memory distributed calculations.
>> That is especially important for the cases like this one.
>>
>> BTW, what was the pixel size of your image?
>>
>> Thanks,
>>
>> Alex
>>
>>
>> fjlb at duke.edu wrote:
>>
>>> Oleksandr,
>>>
>>> I believe that the 6 in the formula is due to the fact that the 
>>> Hessian matrix
>>> contains six different partial derivatives, hence it needs to store 6 
>>> copies of
>>> your volume in memory. I have used the filter and I had to crop and 
>>> downsample
>>> my volumes for it to work. Try downsampling your volumes and it 
>>> should not be a
>>> problem.
>>>
>>>
>>> Federico
>>>
>>> Quoting Oleksandr Dzyubak <adzyubak at gmail.com>:
>>>
>>>> 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
>>>>
>>>>
>>>> _______________________________________________
>>>> 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