Filter Objects eliminates objects based on their measurements (e.g., area, shape, texture, intensity).
This module removes selected objects based on measurements produced by another module (e.g.,
MeasureObjectSizeShape,
MeasureObjectIntensity,
MeasureTexture, etc). All objects that do not satisfy the specified parameters will be discarded.
This module also may remove objects touching the image border or edges of a mask. This is useful if you would like to unify images via ReassignObjectNumbers before deciding to discard these objects.
Please note that the objects that pass the filtering step comprise a new object set, and hence do not inherit the measurements associated with the original objects. Any measurements on the new object set will need to be made post-filtering by the desired measurement modules.
Available measurements
Image measurements: - Count: The number of objects remaining after filtering.
Object measurements: - Parent: The identity of the input object associated with each filtered object.
- Location_X, Location_Y: The pixel (X,Y) coordinates of the center of mass of the remaining objects.
See also any of the MeasureObject modules, MeasureTexture, MeasureCorrelation, and CalculateRatios.
Settings:
Name the output objects
Enter a name for the collection of objects that are retained after applying the filter(s).
Select the object to filter
Select the set of objects that you want to filter. This setting
also controls which measurement choices appear for filtering:
you can only filter based on measurements made on the object you select.
If you intend to use a measurement
calculated by the CalculateMath module to to filter objects, select
the first operand's object here, because CalculateMath measurements
are stored with the first operand's object.
Select the filtering mode
You can choose from the following options:
- Measurements: Specify a per-object measurement made by an upstream
module in the pipeline.
- Rules: Use a file containing rules generated by CellProfiler Analyst.
You will need to ensure that the measurements specified by the rules file are
produced by upstream modules in the pipeline.
- Image or mask border: Remove objects touching the border of the image and/or the
edges of an image mask.
Select the filtering method
(Used only if filtering using measurements)
There are five different ways to filter objects:
- Limits: Keep an object if its measurement value falls within a range you specify.
- Maximal: Keep the object with the maximum value for the measurement
of interest. If multiple objects share a maximal value, retain one object
selected arbitrarily per image.
- Minimal: Keep the object with the minimum value for the measurement
of interest. If multiple objects share a minimal value, retain one object
selected arbitrarily per image.
- Maximal per object: This option requires you to choose a parent object.
The parent object might contain several child objects of
choice (for instance, mitotic spindles within a cell or FISH
probe spots within a nucleus). Only the child object whose measurements equal the maximum child-measurement
value among that set of child objects will be kept
(for example, the longest spindle
in each cell). You do not have to explicitly relate objects before using this module.
- Minimal per object: Same as Maximal per object, except filtering is based on the minimum value.
Assign overlapping child to
(Used only if filtering per object)
A child object can overlap two parent objects and can have
the maximal/minimal measurement of all child objects in both parents.
This option controls how an overlapping maximal/minimal child
affects filtering of other children of its parents and to which
parent the maximal child is assigned. The choices are:
- Both parents: The child will be assigned to both parents
and all other children of both parents will be filtered. Only the
maximal child per parent will be left, but if RelateObjects
is used to relate the maximal child to its parent, one or the other
of the overlapping parents will not have a child even though the
excluded parent may have other child objects. The maximal child
can still be assigned to both parents using a database join
via the relationships table if you are using ExportToDatabase
and separate object tables.
- Parent with most overlap: The child will be
assigned to the parent with the most overlap and a child with a
less maximal/minimal measurement, if available, will be assigned
to other parents. Use this option to ensure that parents with
an alternate non-overlapping child object are assigned some child
object by a subseequent RelateObjects module.
Rules file location
(Used only when filtering using Rules)
Select the location of the rules file that will be used for filtering.
You can choose among the following options which are common to all file input/output
modules:
- Default Input Folder: Use the default input folder.
- Default Output Folder: Use from the default output folder.
- Elsewhere...: Use a particular folder you specify.
- Default input directory sub-folder: Enter the name of a subfolder of
the default input folder or a path that starts from the default input folder.
- Default output directory sub-folder: Enter the name of a subfolder of
the default output folder or a path that starts from the default output folder.
Elsewhere and the two sub-folder options all require you to enter an additional
path name. You can use an absolute path (such as "C:\imagedir\image.tif" on a PC) or a
relative path to specify the file location relative to a directory):
- Use one period to represent the current directory. For example, if you choose
Default Input Folder sub-folder, you can enter "./MyFiles" to look in a
folder called "MyFiles" that is contained within the Default Input Folder.
- Use two periods ".." to move up one folder level. For example, if you choose
Default Input Folder sub-folder, you can enter "../MyFolder" to look in a
folder called "MyFolder" at the same level as the Default Input Folder.
Rules file name
(Used only when filtering using Rules)
The name of the rules file. This file should be a plain text
file containing the complete set of rules.
Each line of
this file should be a rule naming a measurement to be made
on the object you selected, for instance:
IF (Nuclei_AreaShape_Area < 351.3, [0.79, -0.79], [-0.94, 0.94])
The above rule will score +0.79 for the positive category and -0.94
for the negative category for nuclei whose area is less than 351.3
pixels and will score the opposite for nuclei whose area is larger.
The filter adds positive and negative and keeps only objects whose
positive score is higher than the negative score.
Class number
(Used only when filtering using Rules)
Select which of the classes to keep when filtering. The
CellProfiler Analyst classifier user interface lists the names of
the classes in left-to-right order.
FilterObjects uses the
first class from CellProfiler Analyst if you choose "1", etc.
Please note the following:
- The object is retained if the object falls into the selected class.
- You can make multiple class selections. If you do so, the module
will retain the object if the object falls into any of the selected classes.
Select the objects that contain the filtered objects
(Used only if a per-object filtering method is selected)
This setting selects the container (i.e., parent) objects for the Maximal per object
and Minimal per object filtering choices.
Retain 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)
(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.