Expand Or Shrink Objects expands or shrinks objects by a defined distance.
The module expands or shrinks objects by adding or removing border pixels. You can specify a certain number of border pixels to be added or removed, expand objects until they are almost touching or shrink objects down to a point. Objects are never lost using this module (shrinking stops when an object becomes a single pixel). The module can separate touching objects without otherwise shrinking the objects.
ExpandOrShrinkObjects can perform some specialized morphological operations that remove pixels without completely removing an object. See the Settings help (below) for more detail.
Special note on saving images: You can use the settings in this module to pass object outlines along to the module OverlayOutlines and then save them with the SaveImages module. You can also pass the identified objects themselves along to the object processing module ConvertToImage and then save them with the SaveImages module.
Available measurements
Image measurements: - Count: Number of expanded/shrunken objects in the image.
Object measurements: - Location_X, Location_Y: Pixel (X,Y) coordinates of the center of mass of the expanded/shrunken objects.
See also Identify modules.
Settings:
Select the input objects
Select the objects that you want to expand or shrink.
Name the output objects
Enter a name for the resulting objects.
Select the operation
Select the operation that you want to perform:
- Shrink objects to a point: Remove all pixels but one from filled objects. Thin objects
with holes to loops unless the "fill" option is checked.
- Expand objects until touching: Expand objects, assigning every pixel in the image to an
object. Background pixels are assigned to the nearest object.
- Add partial dividing lines between objects: Remove pixels from an object that are adjacent to another
object's pixels unless doing so would change the object's Euler number
(break an object in two, remove the object completely or open a hole in
an object).
- Shrink objects by a specified number of pixels: Remove pixels around the perimeter of an object unless doing
so would change the object's Euler number (break the object in two, remove the object completely or open
a hole in the object). You can specify the number of times
perimeter pixels should be removed. Processing stops automatically when there are no more
pixels to remove.
- Expand objects by a specified number of pixels: Expand each object by adding background pixels adjacent to the
image. You can choose the number of times to expand. Processing stops
automatically if there are no more background pixels.
- Skeletonize each object: Erode each object to its skeleton.
- Remove spurs: Remove or reduce the length of spurs in a skeletonized image.
The algorithm reduces spur size by the number of pixels indicated in the
setting Number of pixels by which to expand or shrink.
Fill holes in objects so that all objects shrink to a single point?
(Used only if one of the "shrink" options selected)
Select
Yes to ensure that each object will shrink
to a single point, by filling the holes in each object.
Select No to preserve the Euler number. in this case, the
shrink algorithm preserves each object's Euler number,
which means that it will erode an object with a hole to a ring in order to
keep the hole. An object with two holes will be shrunk to two rings
connected by a line in order to keep from breaking up the object or breaking
the hole.
Retain the outlines of the identified 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 outline image
(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.