Rescaling Intensity


My Data is collected in a 32bit tiff format where the most intense pixels have values of ~3000 but are quantitative so I am not that interested in downsampling to a 16 or 8 bit file. However, very few pixels are that intense and the average pixel intensity would be ~500. Regardless the image is predominantly black and Cell Profiler is unable to segment it. Now, I can rescale intensity for the purposes of cell segmentation by choosing a specific value to reset the full intensity range too. However, this requires a manual input for each image. Is there any way the computer can determine these numbers empirically?


@Ecswanson would you please share a sample image and your pipeline?

My pipeline is really primitive right now as I am still trying to determine the best way to prepare the data for segmentation so any advice you could give would be great. Threshold Protocol.cppipe (12.5 KB)

  1. RescaleIntensity has an option to stretch the image from the minimum to maximum pixel value.
  2. If your image is looking all-black, you should consider adjusting the scaling settings from ‘normal’ to ‘log’ in the File->Preferences menu
  3. You shouldn’t need to do either to get CP to threshold your objects properly; try changing which threshold method you use (such as Otsu 3-class or RobustBackground), you may need to try a few to find the one that works best .

All that being said, CP can interact strangely sometimes with 32 bit tifs; in order to get CP to work well on your images you either set the rescaling manually in NamesAndTypes or you may even need to transform them to 16 bit (which you should be able to do while still keeping your data quantitative, though I certainly understand the hesitence).

Thank you so much for the quick responses I will for sure check this out and see how it works.

As far as I know the thresholding methods in CellProfiler are not able to set thresholds to a value higher than 1.0, which is a problem trying to segment objects in 32-bit images, which are not rescaled during the import and thus typically contain values larger than 1.0.

I use the chance to make my “monthly reminder” that I would still love to see no rescaling during import and enabling thresholds larger than 1.0 :slight_smile:

@Christian_Tischer Noted. We’re still working on finalizing how some things will be handled in 3.0, but I think you’re going to get some of (thought not everything) you want.

Thanks @Christian for weighing in and shedding further light on the issue. I tried what @bcimini suggested and had no luck.I think the upload of the raw image failed previously so I will try it again so that I can get some further help. I will also upload the image with rescaled intensity that I created using Cell Profiler to show where the nuclei should be and an image of how the Otsu and Robust background thresholding worked for me which was very similar. Notice that it things everything is a nuclei. I even tried changing the tolerance for nuclear size to no avail.

The website does not seem to support uploading 32bit tiff files so it is still not included.