Segmentation of DAPI positive cells and tau stain

Hi everyone,

I am relatively new to the CellProfiler software and I have some struggles with setting up my pipeline. I am trying to image mouse brain sections that I stained with DAPI, NeuN and for tau. I am interested in counting the number of DAPI positive cells and the tau positive area amongst other things.

I am trying to use the IdentifyPrimaryObjects module to segment the nuclei based on the DAPI staining. However, I cannot find a way to prevent oversegmenting. As you can see in the images I attached to this post, our DAPI stain results in these dots within in the nuclei. I was wondering if there is a way to work around this. I have been going through the different thresholding methods CellProfiler offers but have not figured it out yet.

I am also trying to get CellProfiler to accurately measure the signal for tau through the IdentifyPrimaryObjects module. However, as you can see the intensity for this stain is not very high and the shape of the signal varies from image to image so I am struggling to find a solution for this as well.

I have found other posts with questions about how to quantify DAPI staining, but I could not find one that specifically helped you work around these dots.

I hope that some of you with more knowledge and experience will be able to help me with this or give me some tips on how to address these problems!

Set up pipeline.cpproj (759.6 KB)
P1.1_M243_A1_f1-ch1.tif (1.0 MB) P1.1_M243_A1_f1-ch2.tif (1.0 MB) P1.1_M243_A1_f2-ch1.tif (1.0 MB) P1.1_M243_A1_f2-ch2.tif (1.0 MB)

Hi @ddaatselaar,

In your message, you had mentioned about thress stains, but in the sample images you had shared two channels.

  1. Your issue of dots inside the nuclei: You have to use a filter to smooth the signal inside the nuclei, so that the bright dots doesn’t interfer with the segmentation. I have tried the same with your pipeline with the smooth module with the median filter. Further, used this smoothed imaged for segmentation in primary object module. In the primary object module just changed few parameters like size & chosen a adaptive thresholding method (since the signal is not even within the nuclei). This works better, may be you can optimize a bit if not convinced. Here is the screenshot & PFA pipeline.
  2. With respect to your channel 2 (tau) segmentation, its bit unclear about the structure that you are trying to segment. Are you trying to segment weak signal & dots in the image?
    If you are looking for dots structure, explore the example speckles pipeline here.
    Set up pipeline_LB.cpproj (861.8 KB)

Regards,
Lakshmi
www.wakoautomation.com

Dear @lakshmi,

Thank you so much for your tips, this has really helped us develop the pipeline further.
At first, I thought I had optimized my pipeline sufficiently as I saw results like this for my IdentifyPrimaryObjects module:

image

A big part of the images look like that. However, I have also found a relatively high number of images where large parts of areas that are clearly covered by cells are excluded from the analysis. I have been trying different things and changing parameters, but I have not been able to find a way to work around this. I was hoping that someone of the forum would be able to help us with this.

**image **

I have attached some of the problematic as well as succesfully segmented images. I am only uploading the DAPI channel now, because that is where my problems are.

We were also wondering how one should determine what settings are good enough to use for the analysis of hundreds of images as nothing will be perfect. This is clearly not good enough yet, but it also feels like we can keep on optimizing forever. For example, is it okay if the pipeline sometimes excludes ~20 cells in an image that contains around 300?

Any help is welcome and very much appreciated!

Identify nuclei.cpproj (494.7 KB)

P1.1_M209_C4_f1-ch1.tif (1.0 MB) P1.1_M214_C5_f2-ch1.tif (1.0 MB) P1.1_M227_A6_f1-ch1.tif (1.0 MB) P1.1_M227_D6_f2-ch1.tif (1.0 MB) P1.1_M243_B1_f1-ch1.tif (1.0 MB)

Hi @ddaatselaar,

Thanks. I checked your pipeline.
Firstly, with your pipeline query, all your settings in the pipeline is almost fine. Only two things I changed
i.e. Thresholding parameter: since the the threshold in your image set is slightly different I relaxed the minimum threshold value
Thresholding: as two-class, since we applied the filter there is no third class so changed to two class.
PFA screenshot for the changes & the output.


Secondly, for your query on settings for the pipeline, When your dataset is larger, few things could taken care of such as you sample dataset for setting up the pipeline could include all kinds of sample images (good, bad, moderate etc…). Try to optimise, in such a way that it would work your sample dataset. In fact in CP, you can filter an image if it is not suitable for analysis. Sometimes, it can happen that some cells might be excluded, but that is a call the user should take based on the scientific question.
You can always refer to the documentation regarding the parameters. It would be very hard to suggest particular parameter to work, sometimes it could more than one parameter & this totally depends in the sample set. Also you can refer to CP tutorial videos here.
Moreover you can always post your queries here in the forum.

Regards,
Lakshmi
www.wakoautomation.com

In case it helps, here’s a blog post we wrote a few months ago on how to decide when your CellProfiler pipeline is “good enough”. :slight_smile:

@lakshmi and @bcimini thank you both for your response!

It really helped me resolve the problems in our pipeline!

I was hoping that I could still ask you about one more thing. As I mentioned the first time, we are trying to identify the amount of tau in our images. I have attached a few examples of these images to this post.

I have only been able to make it work this way, as the shapes of the signal are so irregular.
Since it is really hard to distinguish between the background signal, I thought it may be an option to use our negative control and to subtract what we measure there from what we measure as a positive signal.
This is of course not ideal and maybe not very accurate. Therefore, I was wondering if you might know another way of handling and identifying these irregular shapes.

Thank you in advance!

P1.4_M205_C1_F1-ch2.tif (1.0 MB) P1.4_M205_D1_F1-ch2.tif (1.0 MB) P1.4_M205_A1_F1-ch2.tif (1.0 MB) P1.4_M205_A1_F2-ch2.tif (1.0 MB) Identify tau.cpproj (89.5 KB)