<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>RE : [Insight-users] itkGaussianDerivativeImageFunction, are you correct?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Sure.<BR>
<BR>
The file is itkGaussianDerivativeImageFunction.txx<BR>
<BR>
The lines of code are those in Evaluate or EvaluateAtIndex. For instance:<BR>
<BR>
EvaluateAtIndex(const IndexType& index) const<BR>
{<BR>
OutputType gradient;<BR>
<BR>
for(unsigned int i=0; i<itkGetStaticConstMacro(ImageDimension2);i++)<BR>
{<BR>
// Apply each gaussian kernel to a subset of the image<BR>
InputPixelType pixel = this->GetInputImage()->GetPixel(index);<BR>
double value = pixel;<BR>
<BR>
// gaussian blurring first<BR>
for(unsigned int direction=0;direction<itkGetStaticConstMacro(ImageDimension2);direction++)<BR>
{<BR>
if(i != direction)<BR>
{<BR>
unsigned int id= 2*direction+1; // select only gaussian kernel;<BR>
unsigned int center = (unsigned int)((m_OperatorArray[id].GetSize()[direction]-1)/2);<BR>
TOutput centerval = m_OperatorArray[id].GetCenterValue();<BR>
m_OperatorArray[id][center] = 0;<BR>
m_OperatorImageFunction->SetOperator(m_OperatorArray[id]);<BR>
value = m_OperatorImageFunction->EvaluateAtIndex(index)+centerval*value;<BR>
}<BR>
}<BR>
<BR>
// then derivative in the direction<BR>
signed int center = (unsigned int)((m_OperatorArray[2*i].GetSize()[i]-1)/2);<BR>
TOutput centerval = m_OperatorArray[2*i].GetCenterValue();<BR>
m_OperatorArray[2*i][center] = 0;<BR>
m_OperatorImageFunction->SetOperator(m_OperatorArray[2*i]); <BR>
value = m_OperatorImageFunction->EvaluateAtIndex(index)+centerval*value;<BR>
<BR>
gradient[i] = value;<BR>
}<BR>
<BR>
return gradient;<BR>
}<BR>
<BR>
The gaussian blur part perfom a convolution on the central column of pixel, the neighbor columns are not convolved<BR>
the dervative will be convolved with an horizontal filter, it takes then the next two pixel neighbours of the central pixel in order to have a row for convolution. Instead of taking the neighb. pixels, computed values from the other 2 columns should be taken.<BR>
<BR>
<BR>
For information I have implemented a new version of the filter for gaussian derivative that handle 1,2,3 or more dimensions for images. A version for a Hessian Image Function is almost finished, I will surely sumit it the insight journal if I find time or just drop it to the list.<BR>
<BR>
Before this I want to be sure that what I am commenting on the current itk impl. is correct, I have to be sure that my understanding of convolution is good ^_^<BR>
<BR>
Best Regards,<BR>
<BR>
Jerome Schmid<BR>
<BR>
-------- Message d'origine--------<BR>
De: Henning Meyer [<A HREF="mailto:tutmann@gmail.com">mailto:tutmann@gmail.com</A>]<BR>
Date: lun. 3/20/2006 9:47<BR>
À: SCHMID, Jerome<BR>
Objet : Re: [Insight-users] itkGaussianDerivativeImageFunction, are you correct?<BR>
<BR>
Jerome,<BR>
<BR>
can you please adress the file and the lines of code you refer to?<BR>
<BR>
Thank you,<BR>
<BR>
Henning<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>