Module: MaskObjects

Mask Objects removes objects outside of a specified region or regions.
This module allows you to delete the objects or portions of objects that are outside of a region (mask) you specify. For example, after identifying nuclei and tissue regions in previous Identify modules, you might want to exclude all nuclei that are outside of a tissue region.

If using a masking image, the mask is composed of the foreground (white portions); if using a masking object, the mask is composed of the area within the object. You can choose to remove only the portion of each object that is outside of the region, remove the whole object if it is partially or fully outside of the region, or retain the whole object unless it is fully outside of the region.

Available measurements

Parent object measurements:

Masked object measurements:

Settings:

Select objects to be masked

Select the objects that will be masked (that is, excluded in whole or in part based on the other settings in the module). You can choose from any objects created by a previous object processing module, such as IdentifyPrimaryObjects, IdentifySecondaryObjects or IdentifyTertiaryObjects.

Name the masked objects

Enter a name for the objects that remain after the masking operation. You can refer to the masked objects in subsequent modules by this name.

Mask using a region defined by other objects or by binary image?

You can mask your objects by defining a region using objects you previously identified in your pipeline (Objects) or by defining a region based on the white regions in a binary image (Image).

Select the masking object

Select the objects that will be used to define the masking region. You can choose from any objects created by a previous object processing module, such as IdentifyPrimaryObjects, IdentifySecondaryObjects, or IdentifyTertiaryObjects.

Select the masking image

Select an image that was either loaded or created by a previous module. The image should be a binary image where the white portion of the image is the region(s) you will use for masking. Binary images can be loaded from disk using the NamesAndTypes module by selecting "Binary mask" for the image type. You can also create a binary image from a grayscale image using ApplyThreshold.

Invert the mask?

This option reverses the foreground/background relationship of the mask.

Handling of objects that are partially masked

An object might partially overlap the mask region, with pixels both inside and outside the region. MaskObjects can handle this in one of three ways:

Fraction of object that must overlap

(Used only if removing based on a overlap)
Specify the minimum fraction of an object that must overlap the masking region for that object to be retained. For instance, if the fraction is 0.75, then 3/4 of an object must be within the masking region for that object to be retained.

Numbering of resulting objects

Choose how to number the objects that remain after masking, which controls how remaining objects are associated with their predecessors:

Retain outlines of the resulting 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.