Using Ilastik pixel classification as segmentation mask

Hello, I am trying to analyze a tissue that is predominantly composed of proteins instead of cells. This makes it difficult to use nuclei-based cell segmentation, so I’ve been using Ilastik pixel classification to differentiate my tissue from the background. However, I’m running into problems when I use the generated probabilities in CellProfiler to identify primary objects (i.e. tissue). It identifies uneven lumps of pixels as an object, and using smaller pixel numbers as boundaries isn’t working because it just excludes the larger areas that are still tissue. The same problem still occurs when I do the object classification with Ilastik as well.

As a solution, I was wondering if it’s possible to use the actual pixel classification as the segmentation mask for downstream analysis? Is there a way to use individual pixels or a set amount of pixels as my segmentation? Any help would be appreciated! Thanks.

Hi @13sjc10,

welcome to the forum!!

I am not a biologist, but I’ll still try to help with the ilastik side. For that it would be easier for me if you could share a small (annotated) example image on what you have, and what you are trying to achieve. Would this be possible?


Hi @k-dominik, thanks for the response! I’ve uploaded images as requested. The bottom image shows the original image I want to analyze, and the middle image shows the classified tissue in yellow and the background in black. The top image shows what I get when I run the segmentation image through cellprofiler to identify objects. As you can see, the huge blob that is classified as one object seriously skews any results that I get.

I’m interested in how different markers localize to different areas of the tissue, so I’d ideally like to classify the tissue area into separate objects of 2-3 pixels each.

Object Segmentation Tissue

I see you have multi-channel data there. I’ll try to rephrase the problem you’re solving just to make sure I understand it:

  • you want to quantify the differently colored pixels
  • you want to do this only in the area that is “tissue”, disregarding the black background.

In principle you would want to count pixels above a certain intensity level in the different channels in per cell in the tissue region.

If that is the case I am not sure if cellprofiler is the right tool in this instance. In this resolution, it will be very difficult to split the image into individual cells (could you do it by hand in this data?! Out of curiosity). Do you think you could also work with a different measure, like, e.g. ratio of certain pixel type to the total area of tissue)?