<div>Hi Robert,</div><div><br></div>The key function calls for MedianImageFunction are:<div>medianFunction->SetInputImage(img); // sets input image<br><div>medianFunction->SetNeighborhoodRadius(r); // sets neighborhood radius</div>
<div>medianFunction->EvaluateAtIndex(idx); // returns median value of img pixels in a neighborhood of radius r centered at idx<br><br><div class="gmail_quote">On Wed, Mar 16, 2011 at 11:40 AM, <span dir="ltr"><<a href="mailto:Robert.Atwood@diamond.ac.uk" target="_blank">Robert.Atwood@diamond.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I want to evaluate the median at several points in the image, rather than median filter the whole image and query those points. This would be simple if I could use itk::MedianImageFunction<br>
However, I don't understand how to use this. How do you set the neighbourhood?<br>
The doxygen does not seem to show me any function for setting this, and inspecting the code I find this segment, as far as I can tell it always creates a 1x1x1 kernel? That's not what I want , do I misunderstand? The Doxygen states<br>
<br>
"<br>
Calculate the median value in the neighborhood of a pixel.<br>
<br>
Calculate the median pixel value over the standard 8, 26, etc. connected neighborhood. This calculation uses a ZeroFluxNeumannBoundaryCondition.<br>
"<br>
<br>
How do I access the "26,etc" neighbourhoods? Thanks<br>
Robert<br>
<br>
<br>
./ITK/Code/Common/itkMedianImageFunction.txx:<br>
<br>
<br>
73 // Create an N-d neighborhood kernel, using a zeroflux boundary condition<br>
74 typename InputImageType::SizeType kernelSize;<br>
75 kernelSize.Fill( 1 );<br>
76<br>
77 ConstNeighborhoodIterator<InputImageType><br>
78 it(kernelSize, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion());<br>
79<br>
<br>
--<br>
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.<br>
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.<br>
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.<br>
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom<br>
<br>
<br>
<br>
<br>
_____________________________________<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</blockquote></div><br></div></div>