Qupath help - masking a channel from cell detections or converting detctions to annotations

Hi, I am using a multichannel cytof TIFF. From this, I use the brush tool to select the cells of interest. Then use cell detection to create an area around the nucleus to represent the cell.

I want to create a mask using my mitochondrial mass marker to then look at mitochondrial protein intensities in the same pixels as the mass marker within each cell.

I cant seem to get the colocalisation scripts to work. One alternative I found was using tile creation (1 pixel) then getting the data from this. However this is limited to annotations not detections so does not split for each cell but the area created by the brush tool.

Is there a way to

  1. Create an image mask so only analyse pixels within each cell with mito mass value >1 (seems to be the background for my mass marker)

  2. convert detections to annotations would be the alternative.

I am using Qupath 0.2 but have the older 1.2 installed as well. the images consist of 11 channels with mass marker on 5 and my nuclear markers on 10 and 11

If your image has pixel size data, have you tried subcellular detections? Once you have those objects, you can select them to run Add Intensity Features for any other channels of interest. Just make sure to lower the minimum spot size if you are looking for very small objects.

And what problems did you run into with the colocalization script? If the relevant code has changed, it might not work in the newest m# versions, as some of the locations of object based functions have changed, and will continue to change =/

Though I should point out that I have vague memories of Add Intensity Features not working on objects with small numbers of pixels. Tiles of very small size were ignored by this function when I tested it, though I have not tested it in some of the newest builds.

I have never really coded so it was more a case of I couldn’t get the code from GitHub to run or work - user error essentially.

In the subcellular spot detection, what should I be selecting in terms of the values everything is defaulted to -1

It doesn’t seem to add anything further in terms of data than just my normal cell exports.

Attached is the image of my workflow - All I need to do is analyse the pixels with a positive >1 value in the blue channel for all channels in each cell independently.

Apologies extremely amateur with qupath and very much out of my usual line of work

Picture1

-1 means that channel will not be used to create subcellular detections, which is what you want for most channels.

If you are looking at 4 channels, I would do the following:

  1. Cell detection on nuclear channel
  2. Subcellular detection on your main mitochondrial protein (threshold the same way you do your nuclear detection channel, think of them as mini-nuclei found within cells). Hopefully your resolution is high enough that these take up a significant number of pixels, but knowing CyTOF data, that might not be the case.
  3. If the subcellular detections are large enough, run Add Intensity Features (may as well run it on all detections) to add mean intensity for the other channels of interest to your subcellular detections. If this is not working, you will find that some subcellular detections do not have an entry for any of the newly added intensity measurements. It won’t be 0; the measurement will be entirely missing.

If you can’t get the subcellular detections to work, you might look at this:

If all of that works, you could look into colocalization or R^2 values, but you need a solidly defined structure for such measurements to be meaningful.

Also, there isn’t really a QuPath 0.2 just yet, but there are several variants. I am guessing if you are just starting that you are using the current, m3, but with m1 and m2 also out there, it helps to be specific. Some functions/scripts are broken or changed between versions.