Module: ImageMath

Image Math performs simple mathematical operations on image intensities.
This module can perform addition, subtraction, multiplication, division, or averaging of two or more image intensities, as well as inversion, log transform, or scaling by a constant for individual image intensities.

Keep in mind that after the requested operations are carried out, the final image may have a substantially different range of pixel intensities than the original. CellProfiler assumes that the image is scaled from 0 – 1 for object identification and display purposes, so additional rescaling may be needed. Please see the RescaleIntensity module for more scaling options.

See also ApplyThreshold, RescaleIntensity, CorrectIlluminationCalculate.

Settings:

Operation

Select the operation to perform. Note that if more than two images are chosen, then operations will be performed sequentially from first to last, e.g., for "Divide", (Image1 / Image2) / Image3

Note that Invert, Log transform (base 2), and None operate on only a single image.

Name the output image

Enter a name for the resulting image.

Image or measurement?

You can perform math operations using two images or you can use a measurement for one of the operands. For instance, to divide the intensity of one image by another, choose Image for both and pick the respective images. To divide the intensity of an image by its median intensity, use MeasureImageIntensity prior to this module to calculate the median intensity, then select Measurement and use the median intensity measurement as the denominator

Selec the image that you want to use for this operation.

Measurement

This is a measurement made on the image. The value of the measurement is used for the operand for all of the pixels of the other operand's image.

Enter the number that you would like to multiply the above image by. This multiplication is applied before other operations.

Raise the power of the result by

Enter an exponent to raise the result to *after* the chosen operation

Multiply the result by

Enter a factor to multiply the result by *after* the chosen operation

Add to result

Enter a number to add to the result *after* the chosen operation

Set values less than 0 equal to 0?

Values outside the range 0 to 1 might not be handled well by other modules. Select Yes to set negative values to 0.

Set values greater than 1 equal to 1?

Values outside the range 0 to 1 might not be handled well by other modules. Select Yes to set values greater than 1 to a maximum value of 1.

Ignore the image masks?

Usually, the smallest mask of all image operands is applied after image math has been completed. Select Yes to set equal to zero all previously masked pixels and operate on the masked images as if no mask had been applied.