# Get a neighborhood around a specific point

**URL:** <https://discourse.itk.org/t/get-a-neighborhood-around-a-specific-point/5987>\
**Category:** Beginner Questions\
**Created:** [June 12, 2023, 2:50pm UTC](https://discourse.itk.org/t/get-a-neighborhood-around-a-specific-point/5987 "2023-06-12T14:50:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lermontov](https://discourse.itk.org/letter_avatar_proxy/v4/letter/l/bbe5ce/32.png) [@Lermontov](https://discourse.itk.org/u/Lermontov)\
**Post date:** [June 12, 2023, 2:50pm UTC](https://discourse.itk.org/t/get-a-neighborhood-around-a-specific-point/5987/1 "2023-06-12T14:50:03Z")

</div>

Hi,

Is there a method on ITK that can, given a physical point, define a ball-shaped neighborhood of physical points within a given raduis ? I try to study the ability of an optimisation algorithm to converge on the good solution given a certain radius around the known good solution at the surface of a volume.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [June 12, 2023, 3:24pm UTC](https://discourse.itk.org/t/get-a-neighborhood-around-a-specific-point/5987/2 "2023-06-12T15:24:01Z")

</div>

You could take a look at [SphereSpatialFunction](https://itk.org/Doxygen/html/classitk_1_1SphereSpatialFunction.html), [ShapedNeighborhoodIterator](https://itk.org/Doxygen/html/classitk_1_1ShapedNeighborhoodIterator.html) and its descendants, and this [example](https://examples.itk.org/src/filtering/mathematicalmorphology/createabinaryballstructuringelement/documentation).
