Ki67 Scoring Pipeline

Hello,
First of all, thank you so much for developing such a useful software for biological sample analysis. I have been doing Ki67 scoring by manually counting thousands of cells, but now hope to use your software to do this for me.

I have adapted one of the posted pipelines to do this for me, however it is giving me errors and doesn’t appear to export the desired data to excel (see attached pipeline).

What is want is the following: Count the total number of DAB positive cells, count the total number of cells (nuclei), and export these numbers to excel. I would like to do this for a series of images that I import. The Ki67 score is calculated by dividing DAB positive cells by total cells, thus if possible would like to export this proportion to excel as well (ie. total # DAB cells, total # of cells, proportion of DAB+ cells/total cells).

Your help on the current pipeline would be much appreciated.

Thank you, sincerely,
Chad
Ki67 Pipeline.cp (10.5 KB)

Hi Chad,

A few pointers:

  • It seems in order to output the proportion of objects in each bin, you need to give the bins a name in ClassifyObjects.
  • It doesn’t seem like you are exporting the results from the ClassifyObjects module. Press the big button in ExportToSpreadsheet and make sure that you are getting the measurements that you want.

I’m making comments without an image to run the pipeline on, so I don’t know what error you are getting. If this doesn’t solve your problem, you may want to upload an image for further help.

Regards,
-Mark

I think Ki67 images would be like this.

Hi Mark,

Thanks for responding so quickly, sorry I haven’t been able to respond sooner (just moved and without internet).

So I gave the bins a name in ClassifyObjects. I don’t have to have the proportions calculated for me, but really just need the number of Ki67 positive cells (DAB+ staining) exported (I think I’ve named this Bin1Objs); as well as the total number of nuclei (Hematoxylin staining, which appear to be named Bin2Objs). I feel certain I am doing something wrong, since the values exported using the image that was posted by dhani02 (thanks btw, perfect Ki67 image!) gave me the same value for both Bin1Objs and Bin2Objs.

No error was given to me using this .jpg image. I was using much higher resolution .tiff images which may have been causing an error and was also taking much longer to process. I was misinformed by someone that .tiff images were required to use CellProfiler (perhaps on earlier versions).

Your help is much appreciated, thank you,
Chad

**Attached is a revised version of the pipeline. Please try the run on prior posted Ki67 image.
Ki67 Pipeline.cp (9.92 KB)

Hi Chad,

There are a few issues to be address in your pipeline:

  • Generally speaking, you don’t want to use JPGs for your images since they lose information in compression. You’re better off using TIF or PNG since they are “lossless”. Also, you should use raw images; in other words, don’t create a TIF by converting a JPG! :smiley:
  • The measurements you want are in the per-image spreadsheet, not in the per-object spreadsheets you are exporting. Once you enable that, and select the Count measurements and the Classify measurements, you should see the values that you want. In this case, using the pipeline as it stands, I see a value of 12 under Classify_Ki67 Positive_NumObjectsPerBin, 409 in Classify_rest_NumObjectsPerBin and 421 in the Count_Nuclei columns.
  • The FilterObject modules are not
    doing what you want since no objects are being filtered out based on the criteria you’ve input. This is why the counts are the same for the Bin1 and Bin2 objects: they are all being retained. Object_Number is simply a label starting at 1 and going up; a cutoff of 0 has no effect. - Aside from this, the detection is not working terribly well. I’m attaching a modified pipeline which does a better job (I think).

Hope this helps!
-Mark
2011_07_01.cp (10.8 KB)

Dear Mark,
Is it possible to modify the pipeline and add the DisplayScatterPlot so we can see the distribution of DAB positive cells/brown cells (it’s mean that more brown the color of the cell is on top of the scatter plot graphic and DAB negative cells/blue cells (more blue the cell is on the bottom of the scatter graphic). I already try to add the DisplayScatterPlot module but still not working. I also attached sample picture of the scatter plot graphic I want to get after add the DisplayScatterPlot module. And for Chad I hope CP will help much for doing automatic counting in your Ki67 images.
Regards,
Dhani.


Hi Dhani,

We wouldn’t be able to reproduce a graph exactly like the one you describe (it looks like you want gating capability as well?), but the DisplayScatterPlot module should be able to do simple per-object vs. per-object measurements.

However, you mentioned that the module “wasn’t working.” When you try to include DisplayScatterPlot after a MeasureObjectIntensity module, do you find that you are unable to select different images for the objects on the two axes? If so, this is a bug; we will try to fix it for the next release.

Regards,
-Mark

Dear Mark,
The DisplayScatterPlot module is working fine, it’s not work when I try to include this module in the pipeline because I’m not put MeasureObjectIntensity module before DisplayScatterPlot module. But Mark can we modify the pipeline so CP can doing simple math to scoring the percentage of Ki-67 positive cells that calculated according to this formula :
(Ki-67 number/Total number of the cells) X 100. I know that we can do it directly in excel, but it will be great if the pipeline result also show the Ki Index. But if CP can’t do it, it’s ok because we still can do it in excel :stuck_out_tongue: .

Hi guys,
Thank you for all your comments and help on this. I am still not having any luck even after trying to alter several parameters. I have attached two example .tiff files of Ki67 stained images. One has low fraction, about 6%, while the other is much higher, about 47%. When I alter the parameters of cell size or thresholds, percent surface coverage etc…I can get one image to give close ratios to what I want, but then the results for the other image are far off. I am still working off of the attached pipeline, but haven’t modified it furthe bc have had no improvement.
Your help is much appreciated!
Chad
Ki67 Pipeline_070911.cp (10.8 KB)



[quote=“dhani02”]can we modify the pipeline so CP can doing simple math to scoring the percentage of Ki-67 positive cells that calculated according to this formula :
(Ki-67 number/Total number of the cells) X 100.[/quote]

You can do this using the CalculateMath module:

  • Operation: Divide
  • First operand: Image > Count > Ki67Nuclei
  • 2nd operand: Image > Count > AllNuclei
  • Multiply the result by: 100

Regards,
-Mark

It works perfectly Mark. Thanks.
Regards
Dhani.

I’ve given it some additional work myself, and while I can make some headway detecting the brown nuclei, I cannot seem to detect the blue, at least with the staining you are using.
-Mark

Hi Mark,
Not sure where to go from here since I am not able to get reliable Ki67 ratios. Do you think CP is not able to pick up this nuclei staining well enough? The most important element of the scoring is to get consistent brown nuclei to total nuclei ratios between seperate images…I will eventually run it on about 60 images, so consistency will be key.
Thanks,
Chad

Hi Chad,

My last suggestion is to use the pixel classification program packaged with the latest release of CP, called illastik. It only works on Windows, but can be a powerful tool if regular thresholding and object discrimination doesn’t work. You can find it under the CellProfiler item in the Start Folder menu.

Some quick notes on its use:
[ul][li]When starting a new project (under the Project tab), load in a few representative image files; you shouldn’t need to load them all, and indeed loading too many will cause you memory problems.[/li][li]Under the [i]Classification tab > Select features[/]i, you can try selecting just the color features. Pick the size scale that’s appropriate for your images (I think Huge, Megahuge and Gigahuge will do). Selecting too many will cause memory problems.[/li][li]On the right-hand side, click “Create class” and create the regions that you want to divide the image into; I would make three: blue nuclei, brown nuclei and everything else. You can give these classes the names or colors you want (e.g, call the blue class “Blue”).[/li][li]Select a label and you’ll see that the mouse turns into a cross-hair when waved over the image. Scribble on those parts of the image that correspond to the class selected. You shouldn’t need to be extensive; just a few representative areas.[/li]
[li]Click Classification tab > Train and Predict to try to classify the image areas using the features and labels you’ve provided. You’ll see the displays appear under “Overlays” on the lower right, which you can toggle on or off.I would recommend turn off the Segmentation display since it tends to occlude the overlay.[/li][li]If it doesn’t do well enough, scribble on more areas and then re-train (click Train and Predict)[/li][li]If you’ve happy with the image, select the next image from the upper right, and view the results there. If it doesn’t do well, scribble some regions on the new image.[/li][li]Once you’re happy with the overall result, save the project (Project > Save) and save the classifier (Classification > Export Classifier)[/li][/ul]
At this point, you can use the classifier in CellProfiler by adding the module ClassifyPixels to your pipeline (again, this is only available on Windows). Point the module at the color image and at the classifier (.h5) file, and select the number of the label you want (0 for the 1st label, 1 for the second and so on).

The output of ClassifyPixels is a grayscale image representing the regions which corresponding to the label you want; this can be used as input into IdentifyPrimaryObjects to find the objects of interest. You can use multiple ClassifyPixels modules to highlight the different regions you specify.

Regards,
-Mark

1 Like

Dear Mark,
Today I get another different Ki67 picture. I already try to modify the pipeline so can used to analyze the image but I’m not satisfied with the result. Another problem is hard to identify the tissue using previous pipeline (2011_07_01.cp). Can you help me so I can use CP for analyze this image.
2011_10_01Ki.cp (8.44 KB)


Maybe Mark can intuit what you mean by “I’m not satisfied with the result”, but I can’t! :smile: Would you please define the true/false positives/negative cells or tissue here perhaps by editing the image with arrows to these regions?

Thanks,
David

Sorry I’ have been moved to another city so lately reply this topic. What I’m not satisfied is the segmentation on Ki67 Nuclei. Many Ki 67 Nuclei that failed to segmented whit this pipeline (In attachment file). The true value of Ki-67 are 176 and the total cells are 436. The Ki-67 value if i used this pipelines are 165 which is underestimated that the true values. Index of Ki-67 obtained manually are 40,36% and index Ki-67 obtain with CP are 30,9%. The different is 10%. Unfortunately the minimum value that can accept are below than 5 %. Can the pipelines modify to get a better segmentation for Ki-67 Nuclei. (I attach all three file that need)
Regards,
Dhani.



2011_07_01Ki.cp (10.8 KB)

Was there any luck with modifying this pipeline to get good results? I’m trying to do exactly the same thing with Ki67 now and counting so many cells by hand is driving me crazy!

Hi,

I don’t have any news on this thread - does anyone else? If you post a few images and an attempt at a CP pipeline, we may be able to help. This thread is pretty old it seems!

Cheers,
David

Hi,

does anyone had a pipeline for DAB stain counting that works?
(do I have to change the picture to grayscale?)
thanks