Unable to measure and visualise a radial distribution

Just to start, thanks for the awesome tool you’ve made!

Sadly, I myself aren’t awesome enough to get it to do what I want. This is the
situation:

I am have made fluorescent images of cell stained for
Clathrin. I am interested in the radial distribution of the small Clathrin
coated vesicles in the cell and found that CellProfiler has the ability to
measure this. I followed the directions given in this thread and used
the Speckle example pipeline to construct something for my own dataset. The
masking, segmentation, and following steps all seem to be handled nicely, but
the radial distribution step is somehow going wrong. The produced heat map
shows only the one color which is associated with the lowest value and the table
accompanying it puts all the measured points in the ‘overflow’ bin. This is
with the scaled bins on and trying to create my own bins has not yielded any
different results.

I really have the feeling I’m missing one step, but after a
few days of puzzling I am admitting defeat and ask for help.
In the attached ZIP file there is a sample image, a mask
image, and the pipeline. If anything else would be helpful, please let me know
and I’ll try to upload it asap.

RadialCV.zip (80.4 KB)

In the ‘command’ window I do see a warning popping up when running the pipeline, but I
do not know if this is something important: “Worker 0: WARNING: Unable to load
module 'vigra.fourier’ “. I’m running CP 2.2.0 on a Windows 10 64 bit machine.

Thanks in advance for any help and criticisms!

You’re trying to measure the radial intensity distribution inside PitPoints, which are only 1 pixel in size- they won’t have an intensity distribution therefore.

I think from your description you want to measure the number of pits in each “bin” of the cell, right? This is what I’d recommend if that’s what you want; if not please give more information.

-Change your ConvertObjectsToImage from greyscale to binary- greyscale gives every point a different intensity, which is not what you want.
-Change your MeasureObjectIntensityDistribution to measure Cells in the PitPoints channel (you had the channel set correctly but the object set wrong)
-The graph you’re showing is the RadialCV, which is the variability inside each bin; you want Fraction at Distance.

The graph I get when I make those changes looks like this- does that seem right?. Good luck!

Thank you very much for your help! This is indeed what I was looking for. Apparently I was thrown off by the wording of the “MeasureObjectIntensityDistribution” module which asks what objects to measure, but I get that now . The RadialCV is still interesting to me, but indeed only useful when combined with the Cell Fraction at Distance.

I’ve been trying to scale this up to look at complete images and not just the cut out of one cell. When I use the same pipeline it seems to work out ok, just that this time the Fraction at Distance does not give anything useful while the RaidalCV does. Again I have the feeling I’m missing a small thing, just like before. I am aware that the segmentation of the image with multiple cells is not optimal yet, but it is still a proof of principle. Or do you think this influences the outcome? The only thing I could come up with is that the morphology of the cells is messing up the scalable bin sizes. But playing with the non-scalable bins didn’t yield anything useful either.

So in short, is it possible to measure the number of PitPoints in each bin of the parent cell in a multicell image and create a heatmap from these measurements?

MultiCell.zip (564.6 KB)

It seems to be related to the fact that some of your cells touch the edge of the image; if I tell your first IdentifyPrimaryObjects module to throw out cells that touch the edge of the image, it works fine. It’s definitely a bug- if you check your output both Fraction and Mean are listed as nan. I filed it as a bug here; in the meantime hopefully throwing out the edge cells isn’t fatal to your application.

Ah, that was indeed something I didn’t try yet. Although in the future it might be nice if it works with cells touching the edge, at the moment it is not a problem. Thank you for submitting the bug report and thanks again for the swift reply! Happy CP user here. :slight_smile:

Although in the future it might be nice if it works with cells touching the edge, at the moment it is not a problem.

IMO it’s a bit dangerous to use the module on cells that touch the edge of the image since presumably there’s a good chance they’re partially cut off and your distribution will be skewed because of it; again, not a problem for now but something to consider when a distribution that fixes this bug comes out.

Yes that is absolutely true and I would not want to use it for cells which are cut in half by the edge. I however found out that I do have some images where, after applying a threshold, small parts still touch the edge. In a lot of cases its just a few pixels and I would still like to include those cells. But since it is not possible, it is of later concern.

You could always use ExpandOrShrinkObjects to shrink all your cells a tiny amount (say 5 pixels)- that’d allow you to keep the ones that just graze the edge. It would also put the ones that are cut in half back into “play” , but you could probably come up with a FilterObjects criteria based on minimum size or based on not keeping objects whose center is within 100 pixels of the image boundary, etc, to get rid of those.

Ah yes, I hadn’t thought of that yet. I’ll experiment with different approaches and see what works best.