<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div style="font-family: arial; "><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">Hello everybody, </font></div>
<div style="font-family: arial; "><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><br></font></div><div style="font-family: arial; "><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">0) From what I understood, there are three (main) ways </font></div>
<div style="font-family: arial; "><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">one can calculate the gradient of an image in ITK:</font></div><div style="font-family: arial; ">
<font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">a) Use itkGradientImageFilter</font></div><div style="font-family: arial; "><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">b) Use itkRecursiveGaussianImageFilter that </span></div>
<div style="font-family: arial; "><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">approximates the gradient </font></div><div style="font-family: arial; "><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">c) Use DiscreteGaussianImageFilter which is slower </font></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">but more accurate for ``smaller" sigma values </font></div></div><div><br></div><div>I will start with the RecurssiveGaussianImageFilter</div>
<div>given here:</div><div> <a href="http://www.itk.org/Doxygen/html/classitk_1_1RecursiveGaussianImageFilter.html#details">http://www.itk.org/Doxygen/html/classitk_1_1RecursiveGaussianImageFilter.html#details</a></div><div>
<span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">1) Here It says "it can take the derivative of the blurred image in one step"</span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">and there is no SetDirection function listed on this page as expected from </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">the previous sentence. However, if you follow the examples link, </span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">there you </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">see that SetDirection is being used. The itk manual also has SetDirection </span></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">method. From my toy example, without using SetDirection, the default behavior</span></font></div>
<div></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">looks like the filter is using the </span></font><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">X direction. </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">1.a) Assuming that this filter is going to work in all the directions </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">without the need of a different filter for each and every other </span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">direction, how would one go with images having different </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">resolution in a dimension? If my x-y spacing is 1micron</span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">and z spacing is 2micron, how would the filter behave </span></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">and what flags should be turned on for correct behavior? </span></font></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">1.b) Assuming that this filter will need the dimension that it is</span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">going to work</span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">, I guess it is the user's responsibility to set the </span></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">sigma values accordingly to match with my image spacing?</span></font></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; "><br></span></font></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">2) </span><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">Similar questions can be asked about GradientRecursiveGaussianImageFilter</span></font></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">given here:</span></font></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; "> <a href="http://www.itk.org/Doxygen/html/classitk_1_1GradientRecursiveGaussianImageFilter.html#details">http://www.itk.org/Doxygen/html/classitk_1_1GradientRecursiveGaussianImageFilter.html#details</a></span></font></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">The page does not list any SetDirection function and </font></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">this time the given examples are matching. My question </font></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">is whether the</font><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "> filter is compensating for my </span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">z spacing issue. </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">Do I need to use resample filter and interpolate my image </span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">prior to using this filter ? </span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">The same question arises for </span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">the </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">HessianRecursiveGaussianImageFilter.</span></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><br>
</font></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">3) For the case of DiscreteGaussianImageFilter given here </span></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><a href="http://www.itk.org/Doxygen/html/classitk_1_1DiscreteGaussianImageFilter.html#details">http://www.itk.org/Doxygen/html/classitk_1_1DiscreteGaussianImageFilter.html#details</a></font></div>
<div>it looks like I can use <span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">SetUseImageSpacing to solve my </span></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">problem about the spacing. The submission also states </span></font></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">"</span></font>The analytical approach results in increased accuracy and speed </div>
<div>with respect to convolution with the itk::DerivativeOperator, which </div><div>can lead to numerical problems with large values of ó.<span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; ">"</span></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; "><br></span></font></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><span class="Apple-style-span" style="font-size: 12px; ">4) </span></font><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">DiscreteGaussianDerivativeImageFilter expects an array </span></div>
<div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">for SetOrder function(eg [0,2,0] for Iyy), the rest of the derivative </font></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif">classes expects just a number. Some of these filters use </font></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">SetSigma some use SetVariance which makes it harder to </span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">just change the DerivativeType and compare results. It might </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">be handy to have a common API </span></div><div><font class="Apple-style-span" face="'Lucida Grande', Verdana, Geneva, Arial, sans-serif"><br>
</font></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">I guess there are many different ways </span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">which made me a little </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">bit confused. I would appreciate </span><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">any help </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "><br></span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">Thank you, </span></div>
<div><span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">Cagatay Bilgin</span></div>