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"><<a href="mailto:stnava@gmail.com" target="_blank">stnava@gmail.com</a>></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<FixedImageType> GradientCalculatorType;<br>
m_FixedImageGradientCalculator = GradientCalculatorType::New();<br>
m_FixedImageGradientCalculator->SetInputImage( this->GetFixedImage() );<br>
gradient = m_FixedImageGradientCalculator->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 <<a href="mailto:cquammen@cs.unc.edu">cquammen@cs.unc.edu</a>> wrote:<br>
> Hi all,<br>
><br>
> I could dig in the documentation for this, but am hoping someone on the list<br>
> just knows off the top of his or her head.<br>
><br>
> I'd like to compute the gradient of a 3D image given an index. Is there a<br>
> one- or two-liner to do this in ITK? I'd like to avoid computing the full<br>
> gradient image.<br>
><br>
> Thanks,<br>
> Cory<br>
><br>
> --<br>
> Cory Quammen<br>
> Research Associate<br>
> Department of Computer Science<br>
> The University of North Carolina at Chapel Hill<br>
><br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><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>