<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi all,<br>
<br>
For my application I need to calculate the image derivative at a number
of physical locations. I have found two suitable </font><font
 face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace">ImageFunctions</font></font><font
 face="Helvetica, Arial, sans-serif">: <font
 face="Courier New, Courier, monospace">CentralDifferenceImageFunction<font
 face="Helvetica, Arial, sans-serif"> </font></font>and <font
 face="Courier New, Courier, monospace">GaussianDerivativeImageFunction</font>.
The </font><font face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace">GaussianDerivativeImageFunction
</font>is more suitable to my application because it uses a Gaussian
kernel to smooth noise artifacts.<br>
<br>
Unfortunately, there seems to be a discrepancy with the </font><font
 face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace">GaussianDerivativeImageFunction::Evaluate(const
PointType&amp; point)</font> function. The </font><font
 face="Courier New, Courier, monospace">Evaluate</font><font
 face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace">(const PointType&amp; point)</font>
function should evaluate the function at the given physical point (ie.
taking into account the image spacing and origin). For example see
itkCentralDifferenceImageFunction.h&nbsp; which - via <font
 face="Courier New, Courier, monospace">itk::ImageFunction::ConvertPointToNearestIndex(..)</font>
- uses <font face="Courier New, Courier, monospace">itk::Image::TransformPhysicalPointToContinuousIndex(..)<font
 face="Helvetica, Arial, sans-serif"> to transform the physical point
to a <font face="Courier New, Courier, monospace">ContinuousIndex</font>
in pixel space before evaluation.</font></font> <br>
<br>
It appears that </font><font face="Helvetica, Arial, sans-serif"><font
 face="Courier New, Courier, monospace">GaussianDerivativeImageFunction
</font><b>does not</b> transform the point from physical space to pixel
space before evaluation. If you look at the <font
 face="Courier New, Courier, monospace">Evaluate(..)<font
 face="Helvetica, Arial, sans-serif"> function in the
itkGaussianDerivativeImageFunction.txx file, the physical point is cast
to an index (the rounding differences are used as the offset to
recompute the kernel) and then <font
 face="Courier New, Courier, monospace">itk::Image::GetPixel(const
IndexType &amp;index)<font face="Helvetica, Arial, sans-serif"> is
invoked - no transformation from physical space to pixel space occurred!</font></font>
</font></font><br>
<br>
Have I missed something, or is this an omission?<br>
<br>
Thanks for your help.<br>
<br>
Dan</font><font face="Helvetica, Arial, sans-serif"></font><font
 face="Helvetica, Arial, sans-serif"><br>
</font>
<div class="moz-signature">-- <br>
<font color="Gray">
Dan Mueller (d.mueller[at]qut.edu.au)<br>
School of Engineering Systems (ES)<br>
Faculty of Built Environment and Engineering (BEE)<br>
Queensland University of Technology (QUT)<br>
CRICOS No: 00213J<br>
</font>
</div>
</body>
</html>