Reassign Object Numbers renumbers previously identified objects.
Objects and their measurements are associated with each other based on their object numbers (also known as
labels). Typically, each object is assigned a single unique number, such that the exported measurements are ordered by this numbering. This module allows the reassignment of object numbers by either unifying separate objects to share the same label, or splitting portions of separate objects that previously had the same label.
Available measurements
Parent object measurements: - Children Count: The number of relabeled objects created from each parent object.
Reassigned object measurements:
- Parent:The label number of the parent object.
- Location_X, Location_Y: The pixel (X,Y) coordinates of the center of mass of the reassigned objects.
Technical notes
Reassignment means that the numerical value of every pixel within an object (in the label matrix version of the image) gets changed, as specified by the module settings. In order to ensure that objects are labeled consecutively without gaps in the numbering (which other modules may depend on),
ReassignObjectNumbers will typically result in most of the objects having their numbers reordered. This reassignment information is stored as a per-object measurement with both the original input and reasigned output objects, in case you need to track the reassignment.
See also RelateObjects.
Settings:
Select the input objects
Select the objects whose object numbers you want to reassign.
You can use any objects that were created in previous modules, such as
IdentifyPrimaryObjects or IdentifySecondaryObjects.
Name the new objects
Enter a name for the objects whose numbers have been reassigned.
You can use this name in subsequent modules that take objects as inputs.
Operation
You can choose one of the following options:
- Unify: Assign adjacent or nearby objects the same
label based on certain criteria. It can be useful, for example,
to merge together touching objects that were incorrectly split into two pieces
by an Identify module.
- Split: Assign a unique number to separate objects
that currently share the same label. This can occur if you applied certain
operations with the Morph module to objects.
Maximum distance within which to unify objects
(Used only with the Unify option and the Distance method)
Objects that are less than or equal to the distance
you enter here, in pixels, will be unified. If you choose zero
(the default), only objects that are touching will be unified.
Note that Unify will not actually connect or bridge
the two objects by adding any new pixels; it simply assigns the same object number
to the portions of the object. The new, unified object
may therefore consist of two or more unconnected components.
Unify using a grayscale image?
(Used only with the Unify option)
Select Yes to use the objects' intensity features to determine whether two
objects should be unified. If you choose to use a grayscale image,
Unify will unify two objects only if they
are within the distance you have specified and certain criteria about the objects
within the grayscale image are met.
Select the grayscale image to guide unification
(Used only if a grayscale image is to be used as a guide for unification)
Select the name of an image loaded or created by a previous module.
Minimum intensity fraction
(Used only if a grayscale image is to be used as a guide for unification)
Select the minimum acceptable intensity fraction. This will be used
as described for the method you choose in the next setting.
Method to find object intensity
(Used only if a grayscale image is to be used as a guide for unification)
You can use one of two methods to determine whether two
objects should unified, assuming they meet the distance criteria (as specified above):
- Centroids: When the module considers merging two objects,
this method identifies the centroid of each object,
records the intensity value of the dimmer of the two centroids,
multiplies this value by the minimum intensity fraction to generate a threshold,
and draws a line between the centroids. The method will unify the
two objects only if the intensity of every point along the line is above
the threshold. For instance, if the intensity
of one centroid is 0.75 and the other is 0.50 and the minimum intensity fraction
has been chosen to be 0.9, all points along the line would need to have an intensity
of min(0.75, 0.50) * 0.9 = 0.50 * 0.9 = 0.45.
This method works well for round cells whose maximum intensity
is in the center of the cell: a single cell that was incorrectly segmented
into two objects will typically not have a dim line between the centroids
of the two halves and will be correctly unified.
- Closest point: This method is useful for unifying irregularly shaped cells
which are connected. It starts by assigning background pixels in the vicinity of the objects to the nearest
object. Objects are then unified if each object has background pixels that are:
- Within a distance threshold from each object;
- Above the minimum intensity fraction of the nearest object pixel;
- Adjacent to background pixels assigned to a neighboring object.
An example of a feature that satisfies the above constraints is a line of
pixels that connect two neighboring objects and is roughly the same intensity
as the boundary pixels of both (such as an axon connecting two neurons).
Retain outlines of the relabeled objects?
Select Yes to retain the outlines of the new objects
for later use in the pipeline. For example, a common use is for quality control purposes by
overlaying them on your image of choice using the OverlayOutlines module and then saving
the overlay image with the SaveImages module.
Name the outlines
(Used only if the outline image is to be retained for later use in the pipeline)
Enter a name for the outlines of the identified
objects. The outlined image can be selected in downstream modules by selecting
them from any drop-down image list.
Unification method
(Used only with the Unify option)
You can unify objects in one of two ways:
- Distance: All objects within a certain pixel radius
from each other will be unified
- Per-parent: All objects which share the same parent
relationship to another object will be unified. This is not be confused
with using the RelateObjects module, in which the related objects
remain as individual objects. See RelateObjects for more details.
Select the parent object
Select the parent object that will be used to
unify the child objects. Please note the following:
- You must have established a parent-child relationship
between the objects using a prior RelateObjects module.
- Primary objects and their associated secondary objects are
already in a one-to-one parent-child relationship, so it makes no
sense to unify them here.