Trouble exporting multiple labels of objects in Ilastik

I’m trying to classify cells and nuclei to count nuclei per cell. The nuclei are unlabeled and dark. I ran pixel and object classifications separately. My pixel is pretty good and I can export those prediction maps. I could just threshold in imageJ to count but I want to try to classify objects in Ilastik.

I have 3 labels in pixel: background, cells, nuclei.

Then I thresholded in objects Label 1 and cells and label 2 as nuclei.

How can I export this as a 2 channel tif for processing in imageJ?

I can export an 8 bit tif of just nuclei (or the last think I thresholded). PS my raw data is a single image, no time series.

So how to do get a binary image with two channels, representing thresholded objects for the cells and nuclei (blue and the pink)?

Hi @Ashley_Arthur,

maybe just to clarify, for me, you want to count the number of nuclei in each cell.
Right now you have two ilastik projects.

  1. Pixel classification with thre classes: 1 - background, 2 - cells, 3 - nuclei
  2. Object classification: here I am not sure anymore, which one you have used for thresholding.

As of export options from pixel classification, the (simple) segmentation image will have a single channel and as many different numbers as you have classes. That means, all pixels from your first label (background) would get a value of 0, all pixels from the cell class would get a value of 1, all nucleus pixels a value 2. In order to “see” this in Fiji, you’d have to apply a colormap (e.g. Glasbey).

In practice we recommend to export to hdf5 from ilastik and use the ilastik fiji plugin in order to load the file.

Also take a look at our faq.

If you could maybe clear up 2) for me (sorry, might just be Monday) I could help more :slight_smile:

Hello-

Pixel classification is working pretty well.

I’m having trouble with object export

I’d like to export masks of both the cell bodies and nuclei. If I do object classification with raw and pixel probability maps I can threshold the 2-cell and 3-nuclei channels. I want to export the binary mask (object predictions) as a 2 channel image of each mask thresholding on 2- cells and 3- nuclei. Is this possible? The way I do it now is I have two separate object classification projects, I threshold and export separately and then just merge them in Fiji, its okay but just wondering if its possible to export both thresholds at once.

Ashley

Hi Ashley,

thank you for clearing that up! In object classification it is not possible to combine thresholds from different channels to threshold two different kinds of objects. It is usually the foreground channel that is used in object classification that has high probability values for different kinds of objects. The idea is that you already have different kinds of objects in your foreground class from pixel classification that you want to separate, or characterize with object classification.

The way you are doing it, with the two projects, is the recommended way to do it :slight_smile: