Intensity at center of mass

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Intensity at center of mass

MuchMaas
Trying to write a script that will identify the center of mass of a fluorescent foci, and give me an intensity at that point as well as an average intensity of the entire roi.

I can select all the foci present with a mask, split them into individual rois, then measure average intensity, area, and center of mass.

But I have no clue, after hours of searching, what to do with the XM and YM center of mass values. The best I can figure is they correspond to pixel coordinates relative to the selection and not to the image as a whole. In other words, when I try to use these coordinates to measure intensity at the center of my roi, the selection is in entirely the wrong part of the image.

Quite lost, quite frustrated.

Can anyone help me A)understand how to use the XM YM values, and B)write a simple for loop to find and measure intensities at the centers of all my rois?

Any thoughts would be greatly appreciated.

Reply | Threaded
Open this post in threaded view
|

Re: Intensity at center of mass

Rocco D'Antuono
Hi, to me seems that your problem in the macro is that you somehow call "Analyze Particles..." having a ROI  selected yet, so the coordinates XM and YM are relative to that selection.

Try by yourself to be sure about it: without using your macro, simply select a ROI in a picture, call "Analyze
Particles..." and check the coordinates with the pointer.

After this, duplicate the original part of the picture and you will see that the (XM,YM) are correct respect that subregion.

So when in your macro you call "Analyze particles...", be sure to deselect any eventual ROI.
Best regards,
Rocco  
Senior Microscopist
Crick Advanced Light Microscopy facility (CALM)
The Francis Crick Institute
1 Midland Road, NW1 1AT, London (UK)
https://roccodant.github.io/
Reply | Threaded
Open this post in threaded view
|

Re: Intensity at center of mass

MuchMaas
Thanks much. I went back and played around with it and realized that the issue was in the scale of the image, which was in microns. Thus I was getting XM and YM measurements in microns, which were being switched to pixels when I tried to use those coordinates in a macro. Removing the scale fixed this.
Thanks again.