Masson's trichrome liver fibrosis slide


Dear Sir.
I am a Ph.D. student in Iran and I like to use cellprofiler in my research. I have cell profiler2.2 and have a problem in making pipeline for measuring fibrotic area in the liver. would you please send me appropriate pipeline for this purpose. I have attached a picture of the liver slide.
In forward I thank you for your time and concern. I’m looking forward to hearing from you as soon as possible.
Best regards
Mozhgan Ghobadi Pour


Do you mind describing what

[quote=“GhobadiPour, post:1, topic:4338”]
fibrotic area
[/quote] looks like? Do you care about total area in the whole image, or rather area for each region?




I demonstrate here a pipeline to extract the fibrotic region. Fibrosis.cpproj (642.6 KB)

The ideas are:

  • Use module “UnmixColors” to separate 3 different territories: liver tissue, blood vessels, and fibrotic regions.
  • With unmixed channels, identify object “liver tissue” and “vessels” accordingly.
  • Use module “MaskImage” to extract fibrotic regions from the original picture.

Afterward, you can then measure intensity of the entire fibrotic region with module "MeasureImageIntensity"
Or identify these regions as objects first and then use module “MeasureObjectIntensity” (recommended, since you can also measure the size and area occupied)

Be a histology hero with CellProfiler


The fibrotic area is pink areas bordered by the blue color that surrounding dark pink liver tissue. % of the fibrotic area is= fibrotic area/total area×100.

So I need both fibrotic area and total area in the whole image to calculate % of the fibrotic area.

Thank you for your concern




As written above, to measure area occupied it’s 2 steps further from extracting the fibrotic region:

  • Use module “IdentifyPrimaryObject” to identify fibrotic objects
  • Use module “MeasureImageOccupied

Example pipeline: Fibrosis.cpproj (646.9 KB)


Please try.

Masson's and Liver Lipids (The anti-stain?)

Dear Minh.

Thank you very much for the pipeline. I have tried it and it was wonderful. God bless you.

But I have a question if I use for example 3 images, it would give me data of one image in form of table, same as you have previously sent. In excel file it gives us data of all 3 images data, but not in form of table. In the attachment, I sent you excel file. Is it always works like this or my system has a flaw?

Thank you again for your concern.

Best wishes


Image.csv (307 Bytes)


Hello Mozhgan,

I’m not quite sure if you mean “form of a table” is aligned columns and rows? Maybe you can try adjust the column width in Excel to see it better?

(correct me if you meant something else)

In module “ExportToSpreadsheet”, you can click to this button and select what you would like to have in final table.


Hi Minh,

I have Microsoft office 15, and I have noticed your excel is from office 10, I have examined that and find out cellprofiler is compatible with office 10 it does not work with office 7 either.

Thank you for your help.



Dear Minh

I have a question. Can we get hepatocyte count or mitotic index from the image I have sent before or we should use H&E stained images or images with higher magnification?

In forward I thank you for your time and concern.

Best regards



Hi Mozhgan,

With the current image, I would not be confident counting hepatocytes cell-by-cell using the red channel.
It will be indeed much better with H&E stain at higher magnification.



Hi, Minh

In the attachment, I have sent two images of kidneys tissue. Is it possible to use the pipeline you kindly sent for them or it needed another pipeline for calculating fibrosis percent? again thank you for your instructions.

Thank you




You may have to try it first to see if it’s working.

Please also notice the difference colors, i.e. in liver image it’s more red, and in kidney it’s more purple.
So you may have to play with the module “UnmixColors” , try different options : Hematoxilin, PAS etc. And also try add or “remove stain”.


Dear Dr. Minh
I have analyzed 70 images with the pipeline you have kindly sent. But the results were a range of numbers that I think not quite right. In the attachment, I have sent some of them. I assume this is because all slides did not stain perfectly and some have an artifact in them and we have a different range of colors. What should I do? And how I become confident that the numbers are correct?
Thank you and Best regards
Mozhgan Ghobadi pour


You can add the ‘OverlayOutlines’ and ‘SaveImages’ modules to your pipeline if you want to be able to output a picture of what CellProfiler called a Fibrotic area to see if you agree or not.

As to fixing the pipeline if it’s not correct, that’s a harder issue- it does seem like you have quite a range of colors, due to variability in the stain and/or the fixation process and/or the lighting conditions and/or the exposure that may make automated analysis of these challenging. @Minh wrote a very nice blog post about how to handle some of these issues; hopefully some of the tips in there will help. Otherwise, you may have to use ilastik to pixel-classify the image first or, as a worst case scenario, use IdentifyObjectsManually to find all your fibrotic areas by hand (and then you can let CP quantify the areas for you). You’ll just have to try a few things and see what works best for your images- if you discover something you think will help other people with similar images, we’d love for you to let us know!

Good luck!


Dear bcimini.

Thank you for your answer. I have added 'overlay outlines and ‘save images’ modules to pipeline but I don’t know why it dose not work. In the attachment, I have sent pipeline and image. would you please tell me what to do. Is it possible for cellprofiler org. to open a course in “How to work with cell profiler” in Iran? It would be wonderful.

Best regards



There’s no attachment, sorry.

It’s theoretically possible someone from the group might give a workshop in Iran, but usually for something like that we’d require a group to host us and sponsor our plane travel/hotels/visas etc. We HAVE however been discussing how to do an entirely web-based version 3-5 hour workshop for CellProfiler and CellProfilerAnalyst; if we figure it out, we’ll be sure to post on the board here. There are also some pretty good YouTube tutorials in this thread here.


Dear bcimini.

Thank you for your response. I hope you be successful in making a workshop. I have sent the attachment again. I don’t know why it dose not work. In forward I thank you for your care and answer.

Best wishes



overlay.cpproj (139 KB)


A couple of problems here

  1. You have OverlayOutlines accidentally turned off- see how its checkmark is a lighter green than the rest of the modules? Click on the checkmark again so that it goes from light green to dark green, then it’ll be included in the pipeline.

  2. You haven’t actually created any outline images- in OverlayOutlines, you should NOT use a blank image but use your original image instead, then for Load outlines from image or objects? set it to Objects, then select whatever objects you want to see where CellProfiler drew them. You can keep hitting Add another outline to add more objects. Check out the help section for this module, it should be a good guide.

  3. You’re not saving your outline image- in your SaveImages module, save the OrigOverlay image, and make sure to set the ‘Select image name for file prefix’ box- if you hover your mouse over any settings that are popping up red, it will tell you that they’re set wrong and what to do to fix it.

Good luck!


Dear bcimini.

Thank you for your instructions. The Overly outline was wonderful, by using it we become confident that the numbers are correct or not. I have tried 70 images and have notice that none of them was correct even in my best images the numbers wasn’t from the fibrotic area. I don’t understand what is wrong? In the attachment, I have sent one of the images.

Best regards