Counting crystal-violet stained astrocytes and glia in invasion chamber

Hi all,

I’m new to CellProfiler and I have a set of tricky pictures to count. In a nutshell, we’re doing simple invasion in collagen-coated chambers and then staining with crystal violet. One problem is that our cell type has a tendency to clump and overlap along with having long processes that touch neighbors. I’ve been tinkering with multiple types of pipelines and am still having trouble getting the program to recognize the unusual cell shapes in a homogenous manner–additionally, I don’t know how to mask for the little air pockets in the collagen. I’ve included a picture below and some of the previous (simplistic) pipeline that has worked the best for me so far.

One problem I’ve also been having is that I would try to select for the red channel, apply a binary threshold and then count the resulting dark clumps but for some reason the program is finding random things in the white background to count as opposed to the stained cells. Is there a way to invert this so that it will count the dark and not the light?

  1. Crop (1-1000 from each edge, discard edges)
  2. Color to Gray (combine)
  3. Apply Threshold
    • grayscale
    • above threshold
    • number of pixels to expand: 0.1
    • Global, otsu, 2 classes, weighted variance, no smoothing
  4. Identify Primary Objects
    • ???

Not sure where to go from here, but I feel like I’m probably missing a few important modules somewhere.

Thanks for reading!

Hi there! Maybe my 2 cents will help.

There is an option to invert the image - unfortunately I do not know where. I will check and add this later.

Why do you wish to crop? The borders of the image don’t look bad… Furthermore, CP has the option to discard objects touching the edge (if this is your concern)

Maybe there is a filter you could use to enhance the boundaries between cells - however, be careful.

Do you see an advantage in first applying a threshold, then Identifying primary objects? Have you tried using only IdentifyPrimaryObjects, without ApplyThreshold?

Generally speaking: you are correct, these images may be really tricky. I am having trouble distinguishing your cells by looking at them (and while that is by no means a reference for anything whatsoever, it usually predicts how easy I can analyse my own images) Tricky to the extent that one might ask if you have the option to (re-)aquire images with a simple fluorescent nuclear dye (DAPI), which would make counting cells a breeze.

Good Luck!

Hi Fabba123,

Thanks for your reply! I was hoping someone would have something to add.

The inversion would be great! It would basically be the key I need to finish counting. From there I wouldn’t have to worry about intensity so much as shape, which is much more manageable.

I’ve been cropping mostly because when I load the whole image the program would crash and the error would be memory related. I’m not sure why this is a problem seeing as it’s a simple .TIF file. I’ve found that cropping the image has it load faster, even if the cells on the edges are fine. I don’t have a problem with cropping because the images are random shots taken around a well, so I’m just looking for a representative number for each sample.

As for enhancing boundaries between cells, I’ve been having mixed results. It’s hard to assign a fixed pixel number that would definitively account for both the shape and intensity of the nuclei, seeing as they’re all piled up or blocked by processes. To account for this, I’ve tried multiple thresholding methods (Global, Adaptive, etc.) and then their settings (Otsu is usually best) but they usually tend to find things that aren’t really there or just ignore the cells that are there. I’ve decided to stay with Global, Otsu, 2 classes, weighted variance and no smoothing and then try to adjust for intensity, shape, or propagate. Shape usually works best, but it also has the problem of adding things that aren’t there.

As for your idea with skipping the thresholding and going straight to IdentifyPrimaryObjects, I think I also had a memory problem here as well, if I remember it correctly. I’m going to try it again in a few minutes and see if it goes through.

I totally agree on the fluorescent nuclear dye–in an ideal world, that would be my first choice. Unfortunately, about 10 other people and I are basically doing one big fishing expedition from a huge list of targets and we are still on the preliminary “see what we get in the net” stage. Once we find something concrete I will definitely grab a few dyes for staining and run the pics through CP.

Thanks Fabba123!

Inversion can be accomplished by the ImageMath module, just select “Invert” under the operation. Haven’t had a chance to look at the rest yet but that should get you started.

1 Like

Another option (if you want to invest the time) could be to use the bundled Ilastik tool to identify nuclei… Check out the “ClassifyPixels” module. (I find this version very unintuitive though)

Since you seem to be interested in counting cells only, you might as well give the current standalone version of Ilastik a try!
http://ilastik.org/
You can “annotate” nuclei based on your subjective impression and the software will adapt the detection process accordingly. I believe you can perform many basic measurements with this software, but it comes nowhere close to the flexibility of CP.

That does sound appealing, I’ll have to look into it. I know, I’m feeling a bit spoiled with all that I can do with CP but only need to count cells!