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: - Count: The number of new masked objects created from each parent object.
Masked 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 masked objects.
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.
- Select No for the mask to be composed of the foregound
(white portion) of the masking image or the area within the masking
objects.
- Select Yes for the mask to instead be composed of the
background (black portions) of the masking image or the area
outside the masking objects.
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:
- Keep overlapping region: Choosing this option
will reduce the size of partially overlapping objects. The part
of the object that overlaps the region will be retained. The
part of the object that is outside of the region will be removed.
- Keep: If you choose this option, MaskObjects
will keep the whole object if any part of it overlaps the masking
region.
- Remove: Objects that are partially outside
of the masking region will be completely removed if you choose
this option.
- Remove depending on overlap: Determine whether to
remove or keep an object depending on how much of the object
overlaps the masking region. MaskObjects will keep an
object if at least a certain fraction (which you enter below) of
the object falls within the masking region. MaskObjects
completely removes the object if too little of it overlaps
the masking region.
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:
- Renumber: The objects that remain will be renumbered
using consecutive numbers. This
is a good choice if you do not plan to use measurements from the
original objects; your object measurements for the
masked objects will not have gaps (where removed objects are missing).
- Retain:: The original labels for the objects will be retained.
This allows any measurements you make from
the masked objects to be directly aligned with measurements you might
have made of the original, unmasked objects (or objects directly
associated with them).
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.