Normalizing Objects

Is there any way to normalize objects in CellProfiler? I have a images of the same cellular sample, in several bands. Two of the bands are from antibody stains which are found in the nucleus of a cell, and another of the bands is from DAPI which basically stains DNA (the nucleus of every cell). I want to normalize my two antibody stains to my DAPI stain because the some of the cells are closer or farther away (in the z-direction) and I’m trying to account for that to get a better intensity reading from the other two bands.
Can this be done in CellProfiler? I’ve found the ImageMath module, but I don’t necessarily want to be working with the whole image. But if that is the only way, I guess I will have to apply masks based on the objects, and then divide the images by one another?

You have to use the CalculateMath module; this module allows you to divide object measurements.

1 Like

Okay great! Thank you!
I actually did end up masking and then doing ImageMath, but I’d like to compare it with object math instead because that’s a little better.

Hmm… So I was able to run the CalculateMath module with the intensity values that I wanted to normalize with (by dividing one by the other), however I’m confused about 2 points. First, the output from the module only shows a table with one row, and three columns. I was expecting to get a new value for every one of the objects available? Also, my output is NaN which probably makes sense, because there are more denominator objects than numerator objects – or the values for the numerator ends up being zero for several of the objects?

Can you post your pipeline? It sounds like you might just have something configured wrong in CalculateMath.

Sure thing. normalizedPipelineObjects.cpproj (800.8 KB)

Hmmm, nothing looks grossly wrong, but I’d need images to validate and troubleshoot the issue. Would you post a set of those as well?

Certainly.
Here are the four images:



Also, here is another pipeline that I made that uses masking and ImageMath to basically get a similar result to what I’m looking for with object division. The problem with this method (or why the other method would be superior) is that I can only do image math between nuclei stains because they overlap, and one of my stains (CD34) is a surface stain, so I cannot do DAPI correction using ImageMath.
normalizedPipelineImages.cpproj (832.1 KB)

Should I load the images another way? They don’t seem to show up for me in my previous post (I’m assuming because they’re fairly large)?

TIF images don’t show correctly in the forum for some reason, but they downloaded and ran fine.

When you say you only got one line from the module, were you referring to the output window (left below)? Because that will only report the average value for the image, which you’re right is NaN because many nuclei don’t have any HA objects associated with them. If you look at the values for any nucleus that is picked up by the HA module, there’s a corresponding output value from CalculateMath (right below).

If you check your database I think you should see that the correct values are being written; if not, that’s a bug and we’ll definitely file it as such. Can you check that and get back to me?

Yes, the one line output is what I was referring to on the left in your attachment.
On the right, have you overlayed the individual results for each object? How did you do that?
So, it did work, just the output from the CalculateMath module is not very clear/verbose?

The image on the right is the WorkspaceViewer, which is in CP 2.2 and on- it’s helpful for when you’re developing pipelines, you can see what each change does and how all your objects and measurements relate. IMO it’s one of our best features but it’s sadly not that well known. :-/

In general most of the measurement module “output” windows only show the average value across all objects measured in the image in question. I think it probably did work unless you have specific evidence that it didn’t.

Okay, great. Thank you for your help!

Just a side note: Whether TIFFs display on the forum is browser dependent. On Mac, for example, Chrome does not display TIFFs but Safari does. This space is one of my few reasons to launch Safari any more!

2 Likes

You always know all the cool stuff :smiley:

2 Likes