[Insight-users] itkStreamingImageFilter with itkHessianSmoothed3DToVesselnessMeasureImageFilter
Moti Freiman
freiman at cs.huji.ac.il
Mon Oct 13 01:37:50 EDT 2008
Hi all,
I must say that it is very nice to see such an interest and assitance in
this mailing list.
Just to comment Ivan's code before updating it in the itk repository,
We tried to use it before several monthes, and found that the order of the
eigen values is not as in the itkHessian
itk::HessianRecursiveGaussianImageFilter, which cause error during the
computation of the vesselness measure.
Below is the mails from Ivan.
In current version Ivan fixed it. So please verify that you use the updated
version of this work.
I'll try to use Ivan's code to generate a streamable vesselness filter.
Moti
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hi Noah,
I think I have fixed the issues with the class
itk::DiscreteHessianGaussianImageFunction.
As you said, the individual derivatives were calculated correctly. The
problem was that the order of derivatives was different from that in
itk::HessianRecursiveGaussianImageFilter. Now that is fixed.
Regarding the differences in the dzz derivative, this should be zero for the
datasets you used as the tube axis go in z direction. However, due to errors
in the approximation of the gaussian kernels, the value is not exactly zero.
I made some tests and the value of this derivative tends to zero as the
MaximumError parameter decreases. The error in the first derivative dz is
about 1e-6 for max_error = 0.005 and 1e-9 for max_error = 0.001. If we
calculate the second derivative of a Gaussian there is a deep negative basin
at zero so the error in dzz is negative and tends to be larger than in the
first derivative due to this effect (about 1% for max_error = 0.005 I
think).
The differences in magnitude arise from normalization etc. (unit integral
normalization, across-scale normalization, spacing normalization). I don't
think there is a problem there as derivatives are calculated in
itk::GaussianOperator the same way. I didn't try with the eigenvalues and
vectors, I will try to see if they make sense.
I uploaded a new patch release of the paper. You can get it at
http://www.insight-journal.org/InsightJournalManager/view_reviews.php?back=publications.php%3Fjournalid%3D9%26order%3Drating%26revision_display%3Dcombined&pubid=179
If you think the paper was useful, it would be nice if you could make a
review. This is a simple process once you have tested the software and
increases the chances that the code is incorporated into the toolkit.
Hope that helps
Ivan
De: ???? ?????? [mailto:noahbroide at gmail.com]
Enviado el: martes, 04 de marzo de 2008 11:27
Para: imacia at vicomtech.es
Asunto: Help with Hessian matrix generator per pixel
Hi Ivan,
I am Trying to use your code for calculating the Hessian Matrix per specific
pixel, Instead of generating The Hessian Matrix on a full image.
Your code was very Helpful, but I Think There might be a bug in it.
I was comparing the results of both your code (using
ImageHessianEigenvalues3D.cxx) and the ITK Hessian filter
(HessianRecursiveGaussianImageFilter) and seems like this is not giving the
same results.
I run both options on an artificial image (cylinders.vtk) output results for
Hessian 2,3,4,5 (xz,yy,yz,zz) were different.
please see images attached (both vtk and jpg)
To be more specific, we checked the Hessian values for pixel = (20,18,33)
and saw the different results as follows:
"Evaluate at index" - your code:
Hessian = [-0.755, -4.4e-09, -0.755, -1.8e-10, -3.31e-09, -0.0702]
Eigen Values = [-1.24, -1.8e-10, 0.416]
"Full Hessian" - ITK Hessian filter
Hessian = [ -0.232, 5.1e-17, -1.34e-37,-0.232, -0, 0]
Eigen values = [-0.232, -0.232, 0]
Our conclusion that the bug is more likely to be in your code and not in
ITK's code, is due to the Eigen values, that According to our tests, did
come out as expected using ITK's code (Lambda1 = Lambda2) , since If you'll
see the image, it is combined from Cylinders only, and for a pixel in a
Cylinder, Lambda1 should be equal to Lambda2.
I am currently working on implementing RegionGrowing filter based on Hessian
for a specific pixel, I would appreciate if you can help me get this code
working well :)
Thanks In Advance!
Noah Broide
On Mon, Oct 13, 2008 at 5:04 AM, Dan Mueller <dan.muel at gmail.com> wrote:
> Hi Karthik, Moti, others,
>
> Out of interest, I am in the process of transferring Ivan's
> contribution to the ITK Review folder: I already have the filters and
> some tests in my local copy, I just have to add a few more tests. I
> expect to commit the files by week's end.
>
> Regards, Dan
>
> 2008/10/12 Karthik Krishnan <karthik.krishnan at kitware.com>:
> > Moti:
> >
> > Yes, you can make the hessian filters in ITK streamable. It has been on
> > my TODO list, since I have a need to detect needles in CT in realtime,
> > for which I'd like to do a localized hessian analysis, which I cannot
> > do with the existing framework.
> >
> > The Hessian filter in ITK, uses the RecursiveGaussianFilter to compute
> > scale-space derivatives (see Deriche). This is fast, however its an IIR
> > approximation of the gaussian and cannot be streamed.
> >
> > ITK provides a discrete gaussian operator for smoothing, (approximated
> > from weighted sums of bessel functions). This is used in the
> > DiscreteGaussianImageFilter. These are streamable.
> >
> > Ivan Macia, (see contribution on Insight-journal below [1]) has very
> > nicely provided implementation of operators for
> >
> > * Local gaussian derivatives using the discrete gaussian
> > * Local hessian using the above
> >
> > They are provided both in the form of operators and image functions,
> > which you can quite trivially wrap into filters. These filters should
> > be streamable.
> >
> > Unfortunately, the RecursiveGaussian has been used as the
> > building block for most filters in ITK, so at some point, I would
> > envision having duplicate filters using these.
> >
> > ------
> > [1] http://www.insight-journal.org/browse/publication/179
> > "Generalized Computation of Gaussian Derivatives Using ITK", Ivan
> > Macia, VICOMTech.
> >
> >
> > Thanks
> > --
> > Karthik Krishnan
> > R&D Engineer,
> > Kitware Inc.
> > Ph: 518 371 3971 x119
> > Fax: 518 371 3971
> >
> >
> > On Sun, Oct 12, 2008 at 1:55 AM, Moti Freiman <freiman at cs.huji.ac.il>
> wrote:
> >> Hi Luis,
> >> Thanks for your detailed answer.
> >> According to your answer, the Hessian filter itself is not streamable,
> >> However, the main cause for memory insufficient is this filter,
> >> since it produces images that are 6-times (in 3D) larger than the
> original
> >> file.
> >> If I'm right, streaming the EigenAnalysisFilter and the vesselness will
> not
> >> solve the problem of large files. ?
> >> Moti
> >>
> >> On Mon, Oct 6, 2008 at 3:34 PM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
> >>>
> >>> Hi Moti,
> >>>
> >>> Looking at the code of this filter, the piece that looks suspicious is
> >>> the internal use of the Symmetric Eigen Analysis filter.
> >>>
> >>> Both of these filters should be able to stream data, but, in the way
> >>> they are nested, the EigenAnalysys filter may be trying to update the
> >>> entire image unnecessarily.
> >>>
> >>> Please try the following:
> >>>
> >>> 1) Remove the EigenAnalysisFilter from inside the
> >>> itkHessianSmoothed3DToVesselnessMeasureImageFilter
> >>>
> >>> 2) create a sequential pipeline where you connect:
> >>>
> >>> Hessian --> Symm.EigenAnalysis --> VesselnessFilter
> >>>
> >>> The Hessian filter itself is not streamable, but the
> >>> Symm.EigenAnalysis and the Vesselness ones, are both
> >>> pixel-wise filter, and they should be streamable.
> >>>
> >>>
> >>> Please let us know if you encounter any problem.
> >>>
> >>> BTW: Once we sort this out, it will be great if you
> >>> could add the conclusions of your observations
> >>> as a review to this paper, and if you found it
> >>> useful, we could try moving this contribution
> >>> to the Review directory, in order to include it
> >>> with the upcoming release of ITK 3.10.
> >>>
> >>>
> >>> Regards,
> >>>
> >>>
> >>> Luis
> >>>
> >>>
> >>> ---------------------
> >>> Moti Freiman wrote:
> >>>>
> >>>> Hi,
> >>>> I want to compute a vesselness measure on a large CT volume
> (512*512*512,
> >>>> 16bit per voxel) using the
> >>>> itkHessianSmoothed3DToVesselnessMeasureImageFilter
> >>>> published in the InsightJournal
> >>>> (http://www.insight-journal.org/browse/publication/163).
> >>>> Since my machine memory is limited I tried to use the
> >>>> itkStreamingImageFilter to divide the computation for several small
> parts
> >>>> which do not require so much memory, and then merge them.
> >>>> However it seems that the streaming filter do not divide the
> computation
> >>>> using the itkHessianSmoothed3DToVesselnessMeasureImageFilter.
> >>>> Any reason, idea?
> >>>> Thanks,
> >>>> Moti
> >>>> --
> >>>> __
> >>>> Moti Freiman, Ph.D Student.
> >>>> Medical Image Processing and Computer-Assisted Surgery Laboratory.
> >>>> School of Computer Science and Engineering.
> >>>> The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel
> >>>> Phone: +(972)-2-658-5371 (laboratory)
> >>>> WWW site: http://www.cs.huji.ac.il/~freiman
> >>>>
> >>>>
> >>>>
> ------------------------------------------------------------------------
> >>>>
> >>>> _______________________________________________
> >>>> Insight-users mailing list
> >>>> Insight-users at itk.org
> >>>> http://www.itk.org/mailman/listinfo/insight-users
> >>
> >>
> >>
> >> --
> >> __
> >> Moti Freiman, Ph.D Student.
> >> Medical Image Processing and Computer-Assisted Surgery Laboratory.
> >> School of Computer Science and Engineering.
> >> The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel
> >> Phone: +(972)-2-658-5371 (laboratory)
> >> WWW site: http://www.cs.huji.ac.il/~freiman
> >>
> >> _______________________________________________
> >> Insight-users mailing list
> >> Insight-users at itk.org
> >> http://www.itk.org/mailman/listinfo/insight-users
> >>
> >>
> >
> >
> >
> > --
> > Karthik Krishnan
> > R&D Engineer,
> > Kitware Inc.
> > Ph: 518 371 3971 x119
> > Fax: 518 371 3971
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> >
>
--
__
Moti Freiman, Ph.D Student.
Medical Image Processing and Computer-Assisted Surgery Laboratory.
School of Computer Science and Engineering.
The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel
Phone: +(972)-2-658-5371 (laboratory)
WWW site: http://www.cs.huji.ac.il/~freiman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081013/b5d00710/attachment-0001.htm>
More information about the Insight-users
mailing list