[Insight-users] RE: How to compute the Hessian?

Iván Macía imacia at vicomtech.org
Mon Jan 28 06:15:41 EST 2008


Hi Rashed,

I'm sending this to the user list in case someone else is interested.

The problem is you need to define the function type first depending on the
image type you want to use and then use the ImageFunction class traits
(typedefs in the class definition) to use the corresponding PointType.

In your case, image we are using a 3D image of shorts (by the way I would
not recommend using int as a pixel type), you should do something like

typedef itk::Image<short,3> ImageType;

typedef itk::DiscreteHessianGaussianImageFunction<ImageType>
HessianFunctionType;

HessianFunctionType::PointType point;
point[0] = 5; // x coordinate
point[1] = 5; // y coordinate
point[2] = 5; // z coordinate
...
hessianFunction->Evaluate(point)

However, I realize that I haven't defined any PointType in the class so try
to replace in itkDiscreteGaussianImageFunction.h the lines 

typedef TInputImage                         InputImageType;
typedef typename InputImageType::PixelType  InputPixelType;
typedef typename InputImageType::IndexType  IndexType;

by these

typedef typename Superclass::InputImageType       InputImageType;
typedef typename Superclass::InputPixelType       InputPixelType;
typedef typename Superclass::IndexType            IndexType;
typedef typename Superclass::ContinuousIndexType  ContinuousIndexType;
typedef typename Superclass::PointType            PointType;

I'll try to include these changes in the next release. Check if it works
please.

Hope that helps

Iván


-----Mensaje original-----
De: rashed.vtk at googlemail.com [mailto:rashed.vtk at googlemail.com] 
Enviado el: sábado, 26 de enero de 2008 22:19
Para: imacia at vicomtech.org
Asunto: RE: How to compute the Hessian?


Hi Ivan, 

Thanks for your paper. I had a good look at your paper and compiled it. It
works perfectly, but now I am having difficulty evaluating the Hessian
matrix at one particular 3D point - which I gathered was the whole purpose
of your extension. In your examples you iterate through the image using
iterators, but how do you do it for a single point? I tried: 

typedef itk::Point< int, Dimension > PointType;
	PointType point;
	point[0] = 5; // x coordinate
	point[1] = 5; // y coordinate
	point[2] = 5; // z coordinate
...
hessianFunction->Evaluate(point) 

But the above code doesn't compile. I know it is something very trivial that
I am missing here. So, please help. 

Thanks
Rashed


Iván Macía-2 wrote:
> 
> Hi Rashed,
> 
> As an alternative you can have a look at my recently submitted paper
> 
> Generalized Computation of Gaussian Derivatives Using ITK
>
http://www.insight-journal.org/InsightJournalManager/publications.php?journa
> lid=9
> 
> where I have implemented a Hessian computation based on discrete
> derivative
> Gaussian kernels. 
> 
> In general it is slower (though I think more precise) than recursive
> Gaussian computations but might be advantageous in the case you are
> computing the Hessian in only a few points of the image (such as when
> performing vessel tracking). The memory footprint is also much lower.
> 
> And if you like it it would be nice if you could make a review :)
> 
> Best regards
> 
> Iván Macía
> 
> 
> -----Mensaje original-----
> De: insight-users-bounces+imacia=vicomtech.org at itk.org
> [mailto:insight-users-bounces+imacia=vicomtech.org at itk.org] En nombre de
> Dan
> Mueller
> Enviado el: viernes, 11 de enero de 2008 3:01
> Para: rashedk
> CC: insight-users at itk.org
> Asunto: Re: [Insight-users] How to compute the Hessian?
> 
> Hi Rashed,
> 
> Have a look at itkHessianRecursiveGaussianImageFilter: it "computes
> the Hessian matrix of an image by convolution with the Second and
> Cross derivatives of a Gaussian."
> 
> You may also be interested in a paper on the Insight Journal by Luca
> Antiga which provides easy to use implementations of both Frangi's and
> Sato's "vesselness" filters, which utilise the Hessian matrix across
> varying scales:
>     http://insight-journal.org/midas/handle.php?handle=1926/576
> 
> HTH
> 
> Cheers, Dan
> 
> 
> On 11/01/2008, rashedk <rashed.vtk at googlemail.com> wrote:
>>
>> Hi there,
>>
>> I am interested in finding ridges in intensity (for vessel detection). In
>> order to do this I need to compute the Hessian. I couldn't a function or
>> filter in ITK which computes the Hessian (although Curves3DExtraction
>> somehow does it). Is there any?
>>
>> Thanks in advance,
>>
>> Rashed.
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.19.0/1216 - Release Date:
> 09/01/2008
> 10:16
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.19.2/1223 - Release Date:
> 13/01/2008
> 20:23
>  
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 
Quoted from: 
http://www.nabble.com/How-to-compute-the-Hessian--tp14747997p14802465.html

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.11/1242 - Release Date: 24/01/2008
20:32
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.11/1242 - Release Date: 24/01/2008
20:32
 



More information about the Insight-users mailing list