Co-culture pipeline/ground truth

Hi, I have been trying to segment cells in a co-culture system but currently I am stuck on things which I should do in building the pipeline. I have already created a z projection on a separate pipeline, increased the intensity and also tried to pick up all nuclei by size. I have also applied a mask through and in the middle of trying to pick up the 2 individual population of cells by “identify primary object”. I believe after that I can perform a ground truth & supervised machine learning in CPA?

I just want to double check whether this is the right approach to co-culture analysis? I have this idea after completing the hepatocyte & fibroblast co-culture tutorial. If yes, I am wondering if anyone can guide me through how I can create the ground truth files and images for CPA? I am quite lost and would appreciate any comments or help! Many thanks!

Hello there,

Although it’s possible to “do all” with CellProfiler, however in such mixture where there’re multiple distinct cell types with different sizes and shapes, it’s easier to do thresholding and segmentation on ilastik first:

Then you transfer the resulted binary masks for each of cell type to CellProfiler, this will help your task to separate the 2 cell cultures. Every measurement steps downstream can be done normally in CellProfiler.


Minh is right that ilastik can often work to separate the two cell types if they’re quite different- if the difference is more subtle then your original idea to find all cells then classify them into the different types in CellProfiler Analyst is probably best. You don’t have to create any ground truth files, you’ll just drag and drop images of your different cells into bins in the Classifier tool, then CPA will do the rest.

Thank you Minh for your suggestion. I think ilastik seems like a very good software to use for my co-culture indeed. Thank you for suggesting this to me!

Just want to quickly clarify with you about ilastik (0.5). This is automatically downloaded when I downloaded CP version stable 2.2.0 right? I noticed it is already saved in my CP folder. I loaded an image which I had done a z projection previously in CP and for some reason the intensity is very bright. This is very different from viewing in CP. Do you know what is the reason for this difference? Does it also mean I need to rescale the intensity of my z projection images in order to work in ilastik?

Thanks Beth for your clarification! I will also give this a try as I am not sure how different the cells have to be in order for iIastik to work.

I was going to post a photo of my co-culture but for some reason I cannot paste anything in the reply section anymore…?


I think it’s better to download the newest ilastik 1.2.0, its performance is better.

Regarding the brightness, when you open it in CP, please try : on the menu bar of the opened image > subplot > Image contrast > see the image’s contrast in “Raw” if the intensity looks OK.

Then consider this post where I think they’ve come across a similar issue:

Thanks Minh for your advice! I downloaded the newest ilastik and the contrast issue has disappeared.

I have also started to work on ilastik and so far it is going good. Many thanks for your help.

1 Like

Hi Minh,

Sorry another question about Ilastik and CP. As I mentioned earlier, I have downloaded Ilastik 1.2.0 as you have suggested. However in somewhere I have read that CP only works with ilastik 0.5 and the post was a few years ago. I am wondering if there is further updates on the compatibility now?

I have CP2.2.0 and I was trying to import the mask which I created from ilastik 1.2.0 through classifypixels but it showed error. Ilastik pixel classification in CP doesn’t seem to work as well. Eventually I would like to use the mask to help to distinguish one population from the other, to do a cell count and also intensity measurement.

Thank you for your help in advance!



Sorry for not being clear. CP 2.2.0 not anymore natively utilize the “classifypixels” module, instead you have to import the mask images from ilastik as input images themselves.

I have a demo video here

Hope that helps.

Thanks so much Minh! I will try it along with your demo video. Appreciate your effort in making this!!

Will update you more later.


Hi Minh

Many thanks for your video again. I’m in the middle of trying to import by following ur video and you may have seen I recently have posted some queries about single mask export error. Taking one step back, I am wanting to clarify this thinking I have with you, to ensure my understanding of ilastik and CP is correct.

Ilastik utilities pixel classification to identify cells and thus is a very powerful tool in a coculture condition where cells have marked difference. So after creating masks for the different populations, you can either export individual, or all to be incooperated into CP. The mask itself is like a “paint over” the desired population of cells and in conjunction of the original image (i.e z projection in grale scale), these two together can then be imported into CP, grouped together and thus identify the masked cells? All the subsequent measurement parameters can then be actioned whether it is size or intensity calculation.

Is this the right interpretation of the overall workflow?

Many thanks!

Yes Shu,

That’s quite a correct interpretation, and in that view, you see that : the mask (from ilastik) is used to know where the cells could be, but there’s no cell yet ! you need to “identify” them hidden “under the mask”, that’s why you still need the module IdentifyPrimaryObject of CP, taking the input = masks, draw the segmentation of the cells, and then downstream analysis as usual.