TrackObjects module IDs 2 segmented objects as 1, but downstream analysis is still of 2 (need it as 1)

cellprofiler
#1

Hello everyone,

I have created a pipeline (see attached image for outline of modules used) where I segment primary objects (my spheroids) and then I track these objects with the trackobject module and then I segment other primary objects (my T cells) and convert the objects into a binary image and at the end I use the measure object intensity module to measure the T cell image in my individual spheroid objects. The ultimate idea is to count the number of T cells inside my spheroids over time (these are movies that I have uploaded as individual planes and then organised it into movies with the groups module). My spheroids have heterogeneous GFP expression and are quite hard to segment which is why I thought that tracking them which supposedly gives them a unique ID would solve the problem of when my one spheroid is segmented as 2 objects but I need it to be counted as one. When the tracking image popped up it would label the 2 segmented objects as 1 because of the overlap criteria I set up, however I have now figured out that for all the downstream measurements (including counting of T cells inside spheroids) CP still uses the 1 spheroid segmented into 2 and treats the 2 halves as different objects despite them being tracked as a single object.
For now assume that although the root of the problem is the segmentation of the spheroids that we cant change that.
I have attached a sample image in which it shows the segmentation of spheroids (there should only be 2 spheroids but CP segments one of them into 2 giving a total of 3 spheroids), their tracking (the 2 spheroids are labelled as 1 and 2 which is why it surprised me that all of the analysis is still done on the original segmented image not the tracked one), and the T cell image (which isn’t that relevant for this but just thought I would include it to give you an idea of what it looks like).

My idea is to merge objects that have been tracked as one but segmented as 2 but I haven’t figure out how to do this yet. Let me know of any other ideas. I don’t need the tracking module for actual tracking, I just needed it to give my individual spheroids (there are several per image) unique IDs so I can then look at their individual T cell infiltration over time.

Thank you so much for your help in advance!

Best wishes,
Maria

CP%20pipeline%20outline

Images of type float must be between -1 and 1
#2

@masha1188,

the main reason, why you can’t get desired results, is that TrackObjects do not change the objects (similarly to our discussion at your other topic - none of modules change original objects/images), and furthermore it do not create objects. Hopefully it creates image, and you can try to use ConvertImageToObjects module to extract your merged spheroid from TrackObjects module. I’ve never used TrackObjects module, so I’ve no idea how this would work for time series, but works for single image.

Additionally, if I understand correctly, all this story with tracking objects is because of incorrect segmentation of your primary objects (spheroids), i.e. splitting of single spheroid in two objects. Right?
If so, I would suggest to play around with Smooth module (Median Filter with artifact diameter 50-75 seems to be a good starting point). After smoothing use Filtered Image for primary object identification (adjustment of some parameters might be required). Again, don’t know how it would works for whole image set, but on the single image from your other topic Median Filter with diameter 75 works okay.

Hope it helps.

1 Like
#3

Hi Oleg,

Yes, I have figured out the part about it not creating a new object after tracking. I will try and see if the ConvertImage to Object would work.

The smoothing situation is a bit more complicated than just segmentation of one object since I don’t want to smooth so much that 2 objects that are touching will be classed as one so it is a delicate balance. Could you explain to me how the smooth module is different to the smoothing included in the IDPrimaryObjects module? Because there is a section about automatically calculating the size of smoothing filter for declumping for example.

#4

The main difference between Smooth module and build-in smoothing is smoothing method. I don’t know which method used in Primary object identification, but in Smooth module there are several methods available, including conventional Median Filter and Gaussian Filter.

#5

So do you think if I smooth with the special module I shouldn’t include the automatic smoothing included in the ID primary objects?

#6

In the help section they said:

Smoothing is most likely not appropriate if the input image is binary, if it has already been smoothed or if it is an output of a pixel-based classifier.

Thus, you are correct, it meaningful to set it 0 (i.e. switch off). On the other hand, it is “most likely”, not “absolutely”. So, you can try both ways and pick, which one works better for your specific images.

1 Like