Module: ExpandOrShrinkObjects

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: Object measurements:

See also Identify modules.


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:

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.