Processing Negative Control Image in Groups to Take Separate Measurements


I am a new user of CellProfiler, attempting to count the number of cells expressing different fluorescent markers. I’ve been through the tutorials, the help modules, and the forum posts. They have been very helpful in fixing other problems, but I have not yet been able to find an answer for this particular issue.

I want to measure the intensity of my negative control image (using MeasureImageIntensity) and then subtract a percentage of that intensity from my experimental images (using ImageMath). The problem I’m encountering is that I can’t figure out how to group my images so that I can measure the control image separately from the experimental images. If I separate them using NamesAndTypes based on their metadata, I receive an error that there are not the same amount of images in each group (which I think is because it is expecting each group to consist of the different channels). If I separate them using Groups, the groups don’t show up as options further down in the pipeline. Additionally, I’ve tried to measure the control image in a separate pipeline and import the measurements, but ImageMath only takes measurements from images within the pipeline.

Any help would be appreciated! I can post the pipeline I’m working on or any example images if necessary.

Thank you!

Basically, is there a way to subtract the intensity of the negative control image from the experimental images before they are processed (e.g. processed through identifyprimaryobjects)? I am sure I must be missing something.

Hi @WhatTheToast,

If you’re using a single negative control image for the entire data set, you may be best off just finding the value to subtract manually and just writing that into the pipeline. Otherwise the concept isn’t too different from Illumination Correction, so tutorials on that may help you with pairing a single control image with multiple other data sets. You can achieve this by using the NamesAndTypes module and matching images based on metadata rather than order, I can provide further guidance if that’s the route you wish to take.

Hope that helps

1 Like

Hi @DStirling,

Somehow I can’t figure out how to manually subtract the value if I measure it separately – do you have any suggestions for modules that could accomplish this?

I did try Illumination Correction on my images, but it didn’t work very well for my purposes. My issue isn’t uneven illumination, but autofluorescence and background noise.

Could you please further explain what you mean about using the NamesAndTypes module and matching images based on metadata? I’ve tried using both metadata and order, and for both I get the same error where both groups have to have the same number of images.


You can subtract a static number using the ImageMath module. Choose ‘None’ as the operation and then in the ‘add to result’ section enter your number (made negative).

Regarding NamesAndTypes, let’s imagine that you have one control image in your experiment, which consists of one plate. We can use the settings in the image below to pair the DNA and stain images with a single control image which will be applied to every group on the entire plate. Just be aware that there always needs to be a single image matching each set of criteria, so you’ll need to add additional metadata matching criteria for each factor (e.g. if you had multiple timepoints, you’d add a match level for timepoint in the setup below).


Hope that makes sense!

1 Like

Thank you for your help! I am trying to understand the NamesAndTypes functionality. I tried changing the “Match metadata” settings, but it always gave me groups each only with one file in them, or no groups at all. I must be misunderstanding. I’ve attached an image of my metadata groups from the Metadata module. How should I set this up?

Thank you!

So I gather you have the one “Negative” image visible here? Are all the other images of a single channel or do you need to pair them?

I can help you set this up, but could you send me the current rules/settings you have in NamesAndTypes?

1 Like

Thank you for your help, I really do feel lost here.

There is the one negative image, and all the other images have 4 channels each. I split the channels later using ColorToGray.

Here are the settings. I was actually able to get three groups (One for each treatment group) with the current settings, but each still has only one image in it.


Ah, I think I see what you’re doing. You don’t need to worry about using the treatment groups in NamesAndTypes, this module is for generating sets of images that’ll be analysed together rather than groups. That metadata can be used after analysis. It looks like you’re successfully matching the negative control to everything, so you just need to get the positive images treated individually. Could you try changing ‘Treatment’ in your Match Metadata settings to ‘FileLocation’ (which is unique for each file) and see if that works?

1 Like

Oh that worked, thank you! I’ll be able to run all of the images against the measure of the control intensity now. I’ll just have to run the control in a different pipeline and analyze it by itself.

Thank you for your help.

1 Like