Measure Object Neighbors calculates how many neighbors each object has and records various properties about the neighbors' relationships, including the percentage of an object's edge pixels that touch a neighbor.
Given an image with objects identified (e.g., nuclei or cells), this module determines how many neighbors each object has. You can specify the distance within which objects should be considered neighbors, or that objects are only considered neighbors if they are directly touching.
Available measurements
Object measurements - NumberOfNeighbors: Number of neighbor objects.
- PercentTouching: Percent of the object's boundary pixels that touch neighbors, after the objects have been expanded to the specified distance. Note: This measurement is only available if you use the same set of objects for both objects and neighbors.
- FirstClosestObjectNumber: The index of the closest object.
- FirstClosestDistance: The distance to the closest object.
- SecondClosestObjectNumber: The index of the second closest object.
- SecondClosestDistance: The distance to the second closest object.
- AngleBetweenNeighbors: The angle formed with the object center as the vertex and the first and second closest object centers along the vectors.
Object relationships: The identity of the neighboring objects, for each object. Since per-object output is one-to-one and neighbors relationships are often many-to-one, they may be saved as a separate file in ExportToSpreadsheet by selecting Object relationships from the list of objects to export.
Technical notes
Objects discarded via modules such as
IdentifyPrimaryObjects or
IdentifySecondaryObjects will still register as a neighbors for the purposes of accurate measurement. For instance, if an object touches a single object and that object had been discarded,
NumberOfNeighbors will be positive, but there will not be a corresponding
ClosestObjectNumber.
See also the Identify modules.
Settings:
Select objects to measure
Select the objects whose neighbors you want to measure.
Select neighboring objects to measure
This is the name of the objects that are potential
neighbors of the above objects. You can find the neighbors
within the same set of objects by selecting the same objects
as above.
Method to determine neighbors
There are several methods by which to determine whether objects are neighbors:
- Adjacent: In this mode, two objects must have adjacent
boundary pixels to be neighbors.
- Expand until adjacent: The objects are expanded until all
pixels on the object boundaries are touching another. Two objects are
neighbors if their any of their boundary pixels are adjacent after
expansion.
- Within a specified distance: Each object is expanded by
the number of pixels you specify. Two objects are
neighbors if they have adjacent pixels after expansion.
For Adjacent and Expand until adjacent, the
PercentTouching measurement is the percentage of pixels on the boundary
of an object that touch adjacent objects. For Within a specified distance,
two objects are touching if their any of their boundary
pixels are adjacent after expansion and PercentTouching measures the
percentage of boundary pixels of an expanded object that
touch adjacent objects.
Neighbor distance
(Used only when "Within a specified distance" is selected)
The Neighbor distance is the number of pixels that each object is
expanded for the neighbor calculation. Expanded objects that touch
are considered neighbors.
Retain the image of objects colored by numbers of neighbors?
An output image showing the input objects
colored by numbers of neighbors may be retained. A colormap of your choice shows
how many neighbors each object has. The background is set
to -1. Objects are colored with an increasing color value
corresponding to the number of neighbors, such that objects with no
neighbors are given a color corresponding to 0. Use the SaveImages
module to save this image to a file.
Name the output image
(Used only if the image of objects colored by numbers of neighbors
is to be retained for later use in the pipeline)
Specify a name
that will allow the the image of objects colored by numbers of neighbors
to be selected later in the pipeline.
Select colormap
(Used only if the image of objects colored by numbers of neighbors
is to be retained for later use in the pipeline)
Select the colormap to use to color the neighbor number image. All available colormaps can be seen
here.
Retain the image of objects colored by percent of touching pixels?
Select Yes to keep an image of the input objects
colored by the percentage of the boundary touching their neighbors.
A colormap of your choice is used to show the touching percentage of
each object. Use the SaveImages module to save this image to a file.
Name the output image
(Used only if the image of objects colored by percent touching
is to be retained for later use in the pipeline)
Specify a name that will allow the the image of objects colored by percent of touching
pixels to be selected later in the pipeline.
Select a colormap
(Used only if the image of objects colored by percent touching
is to be retained for later use in the pipeline)
Select the colormap to use to color the percent touching image. All available colormaps can be seen
here.