Calculate Image Overlap calculates how much overlap occurs between the white portions of two black and white images
This module calculates overlap by determining a set of statistics that measure the closeness of an image or object to its' true value. One image/object is considered the "ground truth" (possibly the result of hand-segmentation) and the other is the "test" image/object; the images are determined to overlap most completely when the test image matches the ground truth perfectly. If using images, the module requires binary (black and white) input, where the foreground is white and the background is black. If you segment your images in CellProfiler using
IdentifyPrimaryObjects, you can create such an image using
ConvertObjectsToImage by selecting
Binary as the color type.
If your images have been segmented using other image processing software, or you have hand-segmented them in software such as Photoshop, you may need to use one or more of the following to prepare the images for this module:
- ImageMath: If the objects are black and the background is white, you must invert the intensity using this module.
- ApplyThreshold: If the image is grayscale, you must make it binary using this module, or alternately use an Identify module followed by ConvertObjectsToImage as described above.
- ColorToGray: If the image is in color, you must first convert it to grayscale using this module, and then use ApplyThreshold to generate a binary image.
In the test image, any foreground (white) pixels that overlap with the foreground of the ground truth will be considered "true positives", since they are correctly labeled as foreground. Background (black) pixels that overlap with the background of the ground truth image are considered "true negatives", since they are correctly labeled as background. A foreground pixel in the test image that overlaps with the background in the ground truth image will be considered a "false positive" (since it should have been labeled as part of the background), while a background pixel in the test image that overlaps with foreground in the ground truth will be considered a "false negative" (since it was labeled as part of the background, but should not be).
Available measurements
- For images and objects:
- True positive rate: Total number of true positive pixels / total number of actual positive pixels.
- False positive rate: Total number of false positive pixels / total number of actual negative pixels
- True negative rate: Total number of true negative pixels / total number of actual negative pixels.
- False negative rate: Total number of false negative pixels / total number of actual postive pixels
- Precision: Number of true positive pixels / (number of true positive pixels + number of false positive pixels)
- Recall: Number of true positive pixels/ (number of true positive pixels + number of false negative pixels)
- F-factor: 2 × (precision × recall)/(precision + recall). Also known as F1 score, F-score or F-measure.
- For objects:
- Rand index: A measure of the similarity between two data clusterings. Perfectly random clustering returns the minimum score of 0, perfect clustering returns the maximum score of 1.
- Adjusted Rand index: A variation of the Rand index which takes into account the fact that random chance will cause some objects to occupy the same clusters, so the Rand Index will never actually be zero. Can return a value between -1 and +1.
References
- Collins LM, Dent CW (1998) "Omega: A general formulation of the Rand Index of cluster recovery suitable for non-disjoint solutions", Multivariate Behavioral Research, 23, 231-242 (link)
Settings:
Select the image to be used as the ground truth basis for calculating the amount of overlap
(Used only when comparing foreground/background)
This binary (black and white) image is known as the "ground truth" image. It can be the product of segmentation performed by hand, or
the result of another segmentation algorithm whose results you would like to compare.
Select the image to be used to test for overlap
(Used only when comparing foreground/background)
This binary (black and white) image is what you will compare with the ground truth image. It is known as the "test image".
Select the objects to be used as the ground truth basis for calculating the amount of overlap
(Used only when comparing segmented objects)
Choose which set of objects will used as the "ground truth" objects. It can be the product of segmentation performed by hand, or
the result of another segmentation algorithm whose results you would like to compare. See the Load modules for more details
on loading objects.
Select the objects to be tested for overlap against the ground truth
(Used only when comparing segmented objects)
This set of objects is what you will compare with the ground truth objects. It is known as the "test object."