10.32. Compute Feature Neighborhoods
Group (Subgroup)
Statistics (Morphological)
Description
For each feature, determine how many other features have their centroid within a search radius of that feature’s centroid, counted using a true Euclidean (spherical) distance test.
The Search Radius Type parameter selects how the search radius is defined:
Multiples of Equivalent Diameter (default): each feature searches within a radius equal to its own Equivalent Sphere Diameter multiplied by the Multiples of Equivalent Diameter value (
radius_i = equivalentDiameter[i] × multiples). Because the radius scales with each feature’s own size, larger features have larger neighborhoods and the neighbor relationship can be asymmetric (a large feature may reach a small one that does not reach back). This mode requires the Equivalent Diameters feature array. (The average diameter of all features is used only to size the internal search grid. This per-feature radius preserves the behavior of the legacy DREAM3DFindNeighborhoodsfilter.)Search Radius (microns): every feature uses the same absolute search radius (in microns) supplied by the user. The neighborhood is therefore symmetric, and the Equivalent Diameters array is not required.
In the “Multiples of Equivalent Diameter” mode the search radius for feature i is:
radius_i = MultiplesOfEquivalentDiameter × EquivalentDiameter_i
(there is no division by two; the average diameter is used only to size the internal search grid). In the “Search Radius (microns)” mode the radius is the absolute value entered by the user.
The algorithm for determining the number of neighboring Features is:
Determine each feature’s search radius from the selected Search Radius Type
Define a sphere centered at the Feature’s centroid using that radius
Check every other Feature’s centroid to see if it lies within the sphere (a centroid exactly on the sphere surface is counted); keep a count and a list of those that satisfy the test
Repeat for all Features
Feature 0 (the background/unassigned feature) is excluded from the computation entirely: it never searches for neighbors, it is never counted as a neighbor of any other feature, and its Neighborhoods entry is always 0 with an empty NeighborhoodList.
The figure below shows a single target feature and how progressively larger multiples of its own diameter capture more neighboring centroids.

Multiplier
The Multiplier parameter is dimensionless – a multiple of the average ESD. Common values:
1.0 – search sphere is the same size as the average grain. Catches a feature’s immediate neighbors and slightly beyond.
2.0-3.0 – second-nearest-neighbor analysis.
5.0+ – broader clustering / long-range arrangement studies.
Required Input Sources
Cell Feature Ids – produced by a segmentation filter such as Segment Features (Misorientation).
Feature Centroids – produced by Compute Feature Centroids.
Feature Equivalent Diameters – produced by Compute Feature Sizes.
Feature Phases – produced by Compute Feature Phases.
Input Parameter(s)
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Search Radius Type |
Choices |
How the neighbor search radius is defined: (0) as a multiple of each feature’s own Equivalent Sphere Diameter, or (1) as an absolute search radius in microns. |
|
Multiples of Equivalent Diameter |
Scalar Value |
Float32 |
Each feature searches within a radius equal to its OWN Equivalent Sphere Diameter multiplied by this value (radius = equivalentDiameter[i] * multiples). Larger features therefore have larger neighborhoods, and the neighbor relationship can be asymmetric. |
Search Radius (microns) |
Scalar Value |
Float32 |
The absolute radius (in microns) within which to search for ‘neighboring’ Features. A Feature is a neighbor if its centroid lies within this distance of the target Feature’s centroid. |
Selected Image Geometry |
Geometry Selection |
Image |
The target geometry |
Input Feature Data
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Equivalent Diameters |
Array Selection |
Allowed Types: float32 Comp. Shape: 1 |
Path to the array specifying the diameter of a sphere with the same volume as the Feature. Only required when ‘Search Radius Type’ is ‘Multiples of Equivalent Diameter’. |
Centroids |
Array Selection |
Allowed Types: float32 Comp. Shape: 3 |
Path to the array specifying the X, Y, Z coordinates of Feature center of mass |
Output Feature Data
Parameter Name |
Parameter Type |
Parameter Notes |
Description |
|---|---|---|---|
Neighborhoods |
DataObjectName |
Number of Features that have their centroid within the user specified multiple of equivalent sphere diameters from each Feature |
|
Neighborhood List |
DataObjectName |
List of the Features whose centroids are within the user specified multiple of equivalent sphere diameter from each Feature |
Example Pipelines
(03) Small IN100 Morphological Statistics
InsertTransformationPhase
(06) SmallIN100 Synthetic
License & Copyright
Please see the description file distributed with this Plugin
DREAM3D-NX Help
If you need help, need to file a bug report or want to request a new feature, please head over to the DREAM3DNX-Issues GitHub site where the community of DREAM3D-NX users can help answer your questions.