Module: FlagImage

Flag Image allows you to flag an image based on properties that you specify, for example, quality control measurements.

This module allows you to assign a flag if an image meets certain measurement criteria that you specify (for example, if the image fails a quality control measurement). The value of the flag is 1 if the image meets the selected criteria (for example, if it fails QC), and 0 if it does not meet the criteria (if it passes QC). The flag can be used in post-processing to filter out images you do not want to analyze, e.g., in CellProfiler Analyst. In addition, you can use ExportToSpreadsheet to generate a file that includes the flag as a metadata measurement associated with the images. The Metadata module can then use this flag to put images that pass QC into one group and images that fail into another.

A flag can be based on one or more measurements. If you create a flag based on more than one measurement, you can choose between setting the flag if all measurements are outside the bounds or if one of the measurements is outside of the bounds.

This module must be placed in the pipeline after the relevant measurement modules upon which the flags are based.

Settings:

Name the flag's category

Name a measurement category by which to categorize the flag. The Metadata category is the default used in CellProfiler to store information about images (referred to as metadata).

The flag is stored as a per-image measurement whose name is a combination of the flag's category and feature name, underscore delimited. For instance, if the measurement category is Metadata and the feature name is QCFlag, then the default measurement name would be Metadata_QCFlag. Please see the Metadata module for more details on metadata collection and usage

Name the flag

The flag is stored as a per-image measurement whose name is a combination of the flag's category and feature name, separated by underscores. For instance, if the measurement category is Metadata and the feature name is QCFlag, then the default measurement name would be Metadata_QCFlag.

Flag if any, or all, measurement(s) fails to meet the criteria?

Skip image set if flagged?

Select Yes to skip the remainder of the pipeline for image sets that are flagged. CellProfiler will not run subsequent modules in the pipeline on the images in any image set that is flagged. Select No for CellProfiler to continue to process the pipeline regardless of flagging.

You may want to skip processing in order to filter out unwanted images. For instance, you may want to exclude out of focus images when running CorrectIllumination_Calculate. You can do this with a pipeline that measures image quality and flags inappropriate images before it runs CorrectIllumination_Calculate.

Flag is based on

Select the object to be used for flagging

(Used only when flag is based on an object measurement)
Select the objects whose measurements you want to use for flagging.

Flag images based on low values?

Select Yes to flag images with measurements below the specified cutoff.

Flag images based on high values?

Select Yes to flag images with measurements above the specified cutoff.

Rules file location

(Used only when flagging 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:

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):

Rules file name

(Used only when flagging 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 an image, for instance:

IF (Image_ImageQuality_PowerLogLogSlope_DNA < -2.5, [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 images whose power log slope is less than -2.5 pixels and will score the opposite for images whose slope is larger. The filter adds positive and negative and flags the images whose positive score is higher than the negative score.

Class number

(Used only when flagging using Rules)
Select which classes to flag when filtering. The CellProfiler Analyst classifier user interface lists the names of the classes in order. By default, these are the positive (class 1) and negative (class 2) classes. FlagImage uses the first class from CellProfiler Analyst if you choose "1", etc.

Please note the following: