Intensity values when loading images in Cellprofiler

Hi Team,

We load a 14-bit tif images to Cellprofiler and the intensity values look different from the raw values.
Do you know what is the conversion that Cellprofiler does when loading the images? Does it do stretching automatically? We would like to keep of course the raw values without stretching.

Thanks in advance,

Maya

Hi Maya,

My first question is: What exactly do you mean that the “intensity values look different from the raw values”? Do the images in CP actually appear differently than when you view the images elsewhere, or are you talking about the intensity values themselves (as when you view a histogram of the values from CP’s Image Tools)?

It might be helpful to upload an example image if you don’t think posting an explanation is clear enough. In any case, CellProfiler should not do any stretching of the values (unless of course, the user requests it via a module, e.g., RescaleIntensity).

Regards,
-Mark

Hi Mark,

Thanks for your reply.
The images are acquired in a 14 bit camera, and the values of the signal range between 1000-2000 (when I open the images in NIS-elements or in ImageJ) and of the background between 100-200. When I open the same image in CellProfiler using load images the values shown are in the range of ~0.01-0.02, and there is no relation between the values of different pixels. Do you know why the pixel values are different from the original image?
Please find attached histograms of the same image, opened in matlab (imread and imhist) or opened in CP)
Please let me know if there could be any kind of streching when loading the images in CP




Thanks,

Maya

Hi Maya,

CellProfiler scales images from 0-to-1, but otherwise leaves them untouched. Your image is a prime example of why we do this, in addition to standardize images regardless of the camera or image format bit-depth. I suspect that the histograms you display are in fact equivalent, however the Matlab histogram is so compressed toward the 0 end, it is obscuring the information that is obvious in the CP histogram. Your camera may be 14-bit, but almost surely the image is written in a 16-bit format. Thus the Matlab hist has a max of 2^16 = 65536, when in fact you camera is only using a tiny fraction of this dynamic range, compressed toward zero. You can confirm this easily by changing your x-axis in Matlab to the max intensity in your image, e.g.

and you will likely see that the two histograms look the more similar.

If you’re still unconvinced, post the image and we’ll take a look.

Cheers,
Dave

Hi,

We tried the histograms and they indeed look the same.
I have a few questions about the scaling:
Is the scaling done according to all the images in the image set, or per image?
I think this scaling might be problematic in the sense that if we have two different experiments that we wish to compare, say one with intensity values ranging from 1000-2000 and one from 2000-4000 then due to the scaling we will lose this information if I understand it correctly. How do you usually address this issue? And how is the scaling done, in case we want to reverse it?

Thanks,
Barak

Hi,

The scaling is for display purposes and to compare across image formats, so it will not affect the case that you cite (1000-2000 vs. 2000-4000) assuming they were taken with the same camera and the same bit depth. We do scale the images down to 0-1, but always from the maximum allowable value of the image format (e.g. for a 12-bit image, the values of 1 to 2^12 get divided by 2^12 to scale them to 0-1). So this scaling is safe as long as all the images within your experiment have the same image bit depth (almost always), and if not, then I’d suggest you should convert them to the same before analyzing. Does this help?

David

Hi David,

Thanks for the help. Your answer helps, as you said, we should be able to compare experiments because the scaling factor depends on the image format (which we keep).

Barak