Identifying/counting/measuring stained objects in a field

Hello there in Boston. I’m new to CellProfiler and need some help. We at NMH/Feinberg are working to identify abnormal lung cells for a study looking at the possible correlation of chorioamnionitis and asthma. We want to identify, count, and measure (relative area) of the brown-stained cells on the blue background of the images. I have taken a stab at a pipeline, but really unsure of my programming and of the results. My pipeline attempt, the images (both color and black+white “bw” versions, and the output) are all attached here for you to review.

I have many questions:
Can color images be used? I tried but ran into error msgs, so converted to bw and that’s the output attached here.
How do I properly color threshold?
How to I determine pixel size of objects I want to measure - like a size threshold?

Know my efforts are very rudimentary, but we really want to put your package to use as it would greatly facilitate our work in this and other studies. Would also like to become better acquainted with Cellprofiler in general.

Many thanks in advance,
Lucy
Lucy Minturn
Perinatal Pathology Research Assistant
Department of Pathology, Northwestern University Feinberg School of Medicine
+
Clinical Research Associate
Department of Pediatrics, Division of Neonatology
Ann and Robert H. Lurie Children’s Hospital
320 E. Superior St., Searle 4-490
Chicago, Illinois 60611
Phone: 917-952-6207
lucy.minturn@northwestern.edu
DefaultOUT__2.mat (723 KB)









1stPipelineAttempt42013.cp (6.62 KB)

Hi Lucy,

Yes, they can. However, the object identification modules require grayscale, so that probably accounts for the error messages you saw. However, you can use ColorToGray to convert the color image to grayscale or isolate the specific channel (R,G,B) of interest. The latter is useful if you notice that the contrast is better in one particular channel.

As a side note: JPGs are small but “lossy”; they lose information in compression. We highly recommend saving your raw images as TIFs or PNGs, which are lossless.

You would need to threshold on one of the R,G or B channels, or use the UnmixColors module to deconvolve the color image into grayscale images based on the stains of choice.

You can open the image by double-clkcing on it in the file panel (the lower left panel). When the image window appears, select Tools > Measure length and click/drag to crate a line for which the length is show in the lower right of the window. You can use this to guesstimate the approximate upper/lower limits in IdentifyPrimaryObjects.

I’m attaching a pipeline as a start. I played around with thresholding based on the color unmixing result or based on the R/G/B splitting result, and decided that using the red alone was best.

Regards,
-Mark
2013_04_17.cp (7.45 KB)

Hi Mark,

The pipeline you included has worked very well for us in counting and measuring CD3-stained slides. Many thanks for that.

Now we are (for same study) trying to analyze different stains – FoxP3 for instance. I ran it through and though it appears to the eye to be very similar to CD3, CP is counting way too many cells. I’ve attached here 1 each of original CD3 and FoxP3 slides and the processed CP images, the excel output file, and a pic of the IndentifyPrinaryObject window from the FoxP3 slide. Guidance sorely needed in how to threshold to get only the brown stained cells on the FOxP3 slide.

As a side note, can you automatically save the IndentifyPrinaryObject window with its 4 images? Can’t figure out how to do that.

Thanks and thanks again,
Lucy
DefaultOUT_ImageCD3vFoxP3 52213.csv (1.36 KB)








[quote=“lminturn”]
Now we are (for same study) trying to analyze different stains – FoxP3 for instance. I ran it through and though it appears to the eye to be very similar to CD3, CP is counting way too many cells. I’ve attached here 1 each of original CD3 and FoxP3 slides and the processed CP images, the excel output file, and a pic of the IndentifyPrinaryObject window from the FoxP3 slide. Guidance sorely needed in how to threshold to get only the brown stained cells on the FOxP3 slide. [/quote]

For this image, I suggest using the UnmixColors module and select the two stains that give you the best results.

The important thing here for using this module is not that the stain you select by name needs matches the stain you actually used on your sample, but just that the general color/contrast matches, whatever the stain name may be. So for example, choosing “Alican blue” and “AEC” on the basis of hue matching gives reasonable results. However, selecting “Hematoxylin” and “Eosin” actually does even better in showing up the brown features nicely, even though the color is different. Whatever stain you choose to use, the product of that module is a grayscale image (one for each stain) that can then be used as input into IdentifyPrimaryObjects.

Unfortunately, you cannot save the module display window. However, typically the same salient panel is the overlay of the object outlines on the image, and you can replicate that checking the “Reatin outlines…” box in the IdentifyPrimaryObjects module, use OverlayOutlines to superimpose them on the image of your choice, then SaveImages to save the final image.

Regards,
-Mark