How Cellprofiler loads 16-bit images

Hi,

I have a question about how CellProfiler loads images and presents pixel intensities. I am using 16-bit images. When I open these images in ImageJ, pixel intensities range from 0-300. However, when I open the same image in CellProfiler, pixel intensities range between 0-003. It seems cellprofiler is rescaling the image by dividing each pixel intensity with 65536. Is there any way to make cell profiler not do this rescaling and show the raw data?

Also, I did all my analysis with this default ‘rescaling.’ I am wondering if this rescaling has rendered my analysis meaningless. It seems that all intensities were scaled by a common factor. Do you think this will be a big deal if you are doing quantitative microscopy?

Thanks for helping with this.

Best,
Sohail

The default behavior of CP is to scale everything to between 0 and 1, in order to maintain consistency across image bit-depths and avoid having to re-evaluate various intensity-dependent settings for different image formats (e.g., lower threshold bound in IdentifyPrimaryObjects).

If you really want the intensity to show the 16-bit range, you could insert the RescaleIntensity module to scale your images accordingly. However, please note that the object identification modules will assume a 0-to-1 scaling, although this restriction should not affect the image/object measurement modules.

For quantitative analysis and publication purposes, the units of intensity from microscopy images are usually described as “Intensity units” or “Arbitrary intensity units” since microscopes are not calibrated to an absolute scale. So rescaling the intensities should not affect the quantitative outcome at all.

Regards,
-Mark

Mark,

Thanks for the information.

Best,
Sohail

Hi there, I have kind of same problem, I´m working in a protocol for automatic FRET analysis in immune synapses of T cells imaged by TIRF. And it´s working great with the detection, etc. But since it rescales the original images, I think it does affect my final FRET Efficiency calculations. So I get how we can rescale the original files to their original info values by multiplying by 65535 but then the detection modiules won´t detect anything because the threshold is 0 to 1, any help here please?

Thanks a lot in advance

Hi,

Any rescaling of intensity (back to the original scale) for purposes of some external comparison to other intensity values should be done on the final intensity values measured in a Measure module. CellProfiler does expect intensity values from 0-1, so indeed if you rescale before segmentation, that will affect the results. (But please note that the intensity scales from image acquisition devices are almost always on arbitrary scales, so internal rescaling within CellProfiler is valid.)

As in the Help for NamesAndTypes says:

[quote]If you wish to make measurements on the unscaled image, use the ImageMath module to multiply the scaled image by the actual image bit-depth.
[/quote]

Just be sure to do this after any Measure[Image|Object]Intensity modules and the intensity scale will be returned to the original scale. Finally, be sure to check your scaling method in NamesAndTypes to see whether you are using the metadata in the image to rescale vs. a fixed 2^16.

Cheers,
David

Dear David,

Thanks a lot for your quick answer, but I don´t get it to work, I´m not sure exactly where to put the rescale or image math method I´ve tried several places. I attached my pipeline so maybe you can take a look. Tomorrow I will analyze the same images with SlideBook and ImageJ and I can attach them as well in order to see what I´m trying to say.

Cheers and sorry for the bothering

Javi
E-FRET.cppipe (20.2 KB)





You would insert a RescaleIntensity module, one for each image, before you take your measurements or do whatever arithmetic operations you want to do to the rescaled image. For each RescaleIntensity module, select “Choose specific values to be reset to a custom range” and set 0 to get mapped to 0, and 1.0 to get mapped to 65535 (assuming 16-bit).

Please note that you should not use these rescaled images for any type of object detection, as in those cases, the scaling is assumed to be 0 to 1. Also, in ImageMath, remember to select “No” for “Set values greater than 1 equal to 1”.

Regards,
-Mark

To add to what Mark said, I looked at your pipeline and nothing seems wrong to me. What exactly doesn’t seem right to you? The intensities of the original images are in the 0.005 to 0.03 intensity range, scaled to the bit-depth (right-click an image and Show Image Histogram). If you want to recover the absolute values coming off the camera, then you can insert an CalculateMath module after the MeasureObjectIntensity module and multiply the Measurement of Intensity -> MeanIntensity by 2^16, or use the built-in “Scaling” measure (see screenshot for an example). This should bring the intensities back into the range that ImageJ shows.

Hope that helps,
David


Dear David and Mark,

Thanks a lot for answering, I think I solve it. I attached the final pipeline to analyze the precious images. Basically I add a Rescale Intensity module for each image, string the minimum and maximum from ImageJ histogram, and a Calculate Math for subtracting a mean background calculated previously as well with ImageJ. Now I guess that if I just subtract background from unscaled images that should work as well. But one important thing is to set the numbers as whatever.0 and put attention on how you import the csv file, setting , for separator of decimals and . for thousands. I fuss because I´m running a spanish OS, I don´t know.

Anyway, I really appreciate your help
E-FRET.cppipe (26.1 KB)

I have a problem where I have bright artifacts in my pictures and they cause the actual signal to appear dimmer. This is not a problem if I analyze the pictures with imagej, as the objects in two pictures, one of which is dimmer because of the bright dots, same equal intensities when measured there. However if I measure the intensities in Cell Profiler, no matter if I use image bit depth or metadata for scaling, if I use thresholding or not, the objects in the picture with the bright artifacts and dim cells have about half the mean intensity. The nuclei areas found are similar between the two programs. Cell Profiler is re-scaling everything in the picture based on the brightest pixel, and I can’t find where it does it and how to turn that off. Here are the image sets I’m using. filename ending in 0 is the dapi channel, the one ending with 2 is tritc, whose intensity I’m measuring based on the objects found in the DAPI channel. I added the pipeline I’m using there too.
https://onedrive.live.com/redir?resid=589BBD0F35824B07!4696&authkey=!AEA0bh6RSckO3p0&ithint=folder%2Ctiff

Hmm, that doesn’t sound like the desired behavior at all! I think there may be something funny about how your images are being saved, because I can replicate the issue when I tell it to use image metadata to set the max and min, but I don’t think it’s a CP issue in general because when I tell it to use bit depth in my hands it works just fine. What version of CP are you using?

It’s 2.1.1. The images are exported as 16 bit tiff from SlideBook 6.0.

Yup, on the build I have of 2.1.1 this replicates; on later versions of the software such as the Beta currently available for download, it behaves like I said before (rescales when told to use metadata, doesn’t when told to use bit depth). An update should therefore solve your problem!

I’ve never used SlideBook before and I’m not really very familiar with it, but my guess is that it’s doing something not nice to the image metadata that CP isn’t happy with. Noting this in case it crops up again in the future.

Yes, thanks, that works. Thank you for the prompt response and for trying to solve the problem.