Analyze different images using the same ROIs

Hello, thanks for developing CellProfiler.

I have different immunofluorescence images of the same cells (all images stain nuclei (with six different colors)), and
I would like to analyze them using exactly the same ROIs (obtained from IdentifyPrimaryObjects of a single image),
instead of applying IdentifyPrimaryObjects to each image and getting slightly different ROI sets.

Is this possible?

Thank you in advance.

louispasteur

Hi,

I would suggest the following:

If you want to use an ROI for a single pipeline run: If you have the ROI as an object (which it seems that you do), you can use MaskImage using the ROI as a mask for each of the images in question. Crop can also be used for this purpose, but it is typically used for rectangular ROI shapes.
If you want to use an ROI across the pipeline runs: Save the ROI as a file, then use LoadSingleImage in a subsequent pipeline, perhaps binarize it using ApplyuThreshold and then follow the steps above (MaskImage and Crop can also be used with objects as a mask)

Hope this helps!
-Mark

Thank you for your prompt response.

If my understanding is correct, your suggestion seems to give a slightly different numbering of ROI sets for each image (see example below), with which I’m not very happy.

I attach an example:

  • Two images, both staining nuclei.
  • Image 1 gives ROI 1 (via IdentifyPrimaryObjects).
  • Using ROI 1 as a mask, image 2 gives ROI 2 (via IdentifyPrimaryObjects).
  • ROI 1 and ROI 2 have different ROIs and different numberings. (I would like them to be exactly the same.)

How can I resolve this?

cf. Measurement with the same ROIs is very easy and straightforward in ImageJ, for example, which allows you to “copy ROIs from one image to another” and “multi-measure” each ROI intensity. I hope the same is true for CellProfiler as well.

louispasteur







To make my point clearer I also attach a pipeline I’m using for obtaining ROI 1 from Image 1, as well as Image 3 I would also like to analyze. It seems impossible to me to obtain proper ROIs from Image 3 (via IdentifyPrimaryObjects), so external reference ROIs obtained from other images are necessary.

louispasteur
nucleusdetection.cp (11.8 KB)

Thanks for the clarification. The reason you are getting different object numbers is a mistake on my part. If the objects are touching, binarizing them obliterates the object segmentation, so some will be merged/split in ways they shouldn’t be when re-loaded.

To get around this, do the following:

  • In the ROI creation pipeline, in ConvertObjectToImage convert the ROI image to a uint16 image rather than a binary one. This preserves the individual object labeling.In SaveImages, save this image as 16-bit TIf rather than an 8-bit one.
  • In the ROI application pipeline, use LoadImages or LoadSingleImage to load this ROI image as an object rather than an image. You can then name these re-loaded objects as you wish, and take measurements of the objects against the image of choice are use them as masks without having to re-identify them in IdentifyPrimaryObjects first.

Hopefully this corrects your problem!
-Mark

Thanks so much. Your suggestion worked!

louispasteur

Hi,
First of all thank you for creating CP. I am currently using the software to analyze fluorescent vesicle uptake by liver cells. I am using three different(color) fluorescent dyes at different exposure times for each cell run. I am aiming to classify distinct fluorescent dye compartments as well as colocalisation studies between two dyes inside the cell. In this experiment, the primary objects are the vessicles inside the cells with the secondary objects being the cells. The problem is, the software is counting some background brightness as cells. I am using the watershed image to identify the secondary object(cells). Is there a way i could get a better qualification of cells in the analysis. Also i wanted to know if i could create a mask in a software such a metamorph, and apply to the analysis of cells and vesicles. Thank you.
I have attached sample images and my current pipeline for your consideration

Francis

Hi Francis,

First, it looks like there are some missing images, plus a pipeline?
And did you mean to start a new thread instead of adding to this one?

Thanks,
David

Hi David,
Sorry about that. Please find attached some images and the pipeline for consideration. I actually followed on this thread because some of the requests are quite similar to mine. This is an experiment on non-specific endocytosis of different colored markers. Cells were exposed to different colored dyes at different exposure times after which they were fixed and imaged under a fluorescent light microscope. The main problem is defining vesicles and cells in each image whilst confidently excluding the background. Thank you.

Francis






FrancisWorkingPipeline.cp (26.8 KB)

Hi Francis,

Sorry I was slow to respond – we had a software release and things have been busy! In any case, it was fine to post in this thread. Have you progressed in the meantime?

I updated the beginning of your pipeline to our newest CP release. I did this because a new thresholding method in IdentifyPrimaryObjects works pretty well here, and it is only available in the CP 2.1 release. Please see the attached project. Here are some notes/tips
(0) Launch the new CP 2.1.0, and load the attached project. In the Images module, drag your images for a site(s) into the window on the right to load them.
(1) I took out the ApplyThreshold modules. They don’t do any background correction per se, and they are unnecessary as far as I can tell since an IDPrimary with proper settings will provide the same functionality.
(2) One channel (at least) needs background correction (Blue). The CorrectIllumination* modules help here. You could apply duplicates for the other channels as well, if needed.
(3) IDPrimary: Your size range was too small for the objects. I am using “Automatic” which defaults to the new “MCT” method. I also removed any lower bounds that you had (0.50 I believe), which are dangerous especially when there is so much background and the hard threshold/lower limit is not usually robust across images/sites.

From here, you could add IDSecondary and all your Measure modules, etc, but I am not quite sure what you mean by vesicles vs. the 3 cells (nuclei?) that are the most obvious objects in these mages. If you need more help, please mark up an image to define what your compartments are in a sample image.

Cheers,
David
DL_project.cpproj (533 KB)

David,
Thank you. I will definitely get back in touch after i refine my pipeline and try the analysis one more time. I guess the right term to use for the vessicles is - accumulated dye(Since we are not using high resoultion fluorecent microscopy).I really appreciate your help.

Regards,
Francis

PS- the new CP profiler rocks. You guys have done a fantastic job.

Hi David,
Thank you for your pipeline. CP is now able to clearly pick out the cells even in nosiy images. My main objective however is to measure colocalization in the brighter spots(marked in red) inside the cells. I was hoping to use those as my primary objects(nucleus), and the cells as my secondary objects(seeds). My interest lies mainly in those diffuse areas of accumulation in each cell(you can see from the images that they do not show a clear pattern of localization). The only way to identify them is by their intensity(which looks about 2 times brighter than other areas inside the cells). Is there any way of picking those out, measuring colocalization in the different channels, and hopefully measuring areas(amounts) of these bright spots per cell. That should be great statistics for this experiment. I have attached the screenshot of what i mean with those bright areas inside cells(marked in red). I will continue playing around with till i hear from you again. Thank you.

Regards,
Francis.


Hi there,
Just a late follow-up: In fact, we have an example pipeline on co-localization here which also links to a longer written tutorial on colocalization. Does that help?

Cheers,
David