[Insight-users] MedianImageFunction -- questions

robert tamburo robert.tamburo at gmail.com
Wed Mar 16 12:01:50 EDT 2011


Hi Robert,

The key function calls for MedianImageFunction are:
medianFunction->SetInputImage(img); // sets input image
medianFunction->SetNeighborhoodRadius(r); // sets neighborhood radius
medianFunction->EvaluateAtIndex(idx);  // returns median value of img pixels
in a neighborhood of radius r centered at idx

On Wed, Mar 16, 2011 at 11:40 AM, <Robert.Atwood at diamond.ac.uk> wrote:

> Hi,
> 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
> However, I don't understand how to use this. How do you set the
> neighbourhood?
> 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
>
> "
> Calculate the median value in the neighborhood of a pixel.
>
> Calculate the median pixel value over the standard 8, 26, etc. connected
> neighborhood. This calculation uses a ZeroFluxNeumannBoundaryCondition.
> "
>
> How do I access the "26,etc" neighbourhoods? Thanks
> Robert
>
>
> ./ITK/Code/Common/itkMedianImageFunction.txx:
>
>
>  73   // Create an N-d neighborhood kernel, using a zeroflux boundary
> condition
>  74   typename InputImageType::SizeType kernelSize;
>  75   kernelSize.Fill( 1 );
>  76
>  77   ConstNeighborhoodIterator<InputImageType>
>  78     it(kernelSize, this->GetInputImage(),
> this->GetInputImage()->GetBufferedRegion());
>  79
>
> --
> 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.
> Any opinions expressed within this e-mail are those of the individual and
> not necessarily of Diamond Light Source Ltd.
> 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.
> 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
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110316/0d273da3/attachment.htm>


More information about the Insight-users mailing list