Thanks, Brian. Three lines works for me!<div><br></div><div>Cory</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Dec 1, 2012 at 6:36 AM, brian avants <span dir="ltr">&lt;<a href="mailto:stnava@gmail.com" target="_blank">stnava@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">never a 2-liner unless you use simpleitk ....<br>
<br>
typedef CentralDifferenceImageFunction&lt;FixedImageType&gt; GradientCalculatorType;<br>
m_FixedImageGradientCalculator = GradientCalculatorType::New();<br>
m_FixedImageGradientCalculator-&gt;SetInputImage( this-&gt;GetFixedImage() );<br>
gradient = m_FixedImageGradientCalculator-&gt;EvaluateAtIndex( index );<br>
<br>
brian<br>
<div><div class="h5"><br>
<br>
<br>
<br>
On Fri, Nov 30, 2012 at 4:14 PM, Cory Quammen &lt;<a href="mailto:cquammen@cs.unc.edu">cquammen@cs.unc.edu</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I could dig in the documentation for this, but am hoping someone on the list<br>
&gt; just knows off the top of his or her head.<br>
&gt;<br>
&gt; I&#39;d like to compute the gradient of a 3D image given an index. Is there a<br>
&gt; one- or two-liner to do this in ITK? I&#39;d like to avoid computing the full<br>
&gt; gradient image.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Cory<br>
&gt;<br>
&gt; --<br>
&gt; Cory Quammen<br>
&gt; Research Associate<br>
&gt; Department of Computer Science<br>
&gt; The University of North Carolina at Chapel Hill<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Cory Quammen<div>Research Associate</div><div>Department of Computer Science</div><div>The University of North Carolina at Chapel Hill</div><br>
</div>