Object number and x-y-position



Hello, currently I am looking for two features of CellProfiler:

  1. Is it possible to disply the object number on the processed images (corresponding to the later data file)?
  2. Is it possible to calculate the x-y-position of each identified cell?

Martha, thanks a lot for your help,



Hello Dominik,
To answer your questions…

  1. You can use the DisplayDataOnImage module will display the data on your image. However, the only way to currently save the created image is to click File >> SaveAs on the figure window.

2)For calculating the x-y position, do you mean the location of the object identified? If so, you can use the MeasureObjectAreaShape module to locate the X and Y coordinates of each object identified. Be sure to add ExportToExcel at the end of the pipeline, or you will need to use “ExportData” in the “Data Tools” menu (in the main window of CellProfiler) to export your data.



I am still struggling with one part of this: while the DisplayDataOnImage module (or the corresponding data tool) lets me display the object area, intensity, major/minor axis, etc. on the image (currently the only measurement module that I have in my pipeline is MeasureObjectAreaShape), the one bit of data that I cannot figure out how to display on the image is the object number itself (i.e. the first cell labeled as “1”, and so on). So while the object number appears in the exported output, I would like to have it show up on the image so that each cell is more readily identifiable- I’m sure I’m missing something obvious, but if anyone can help me out, it would be much appreciated.


You cannot overlay the object number on the image, but data corresponding to that object. While in CellProfiler, click on the MeasureObjectAreaShape, then the ‘?’ (help ) button. This will give you a list of features that can be shown on the image. I know this is not ideal, but you can always look at the X,Y coordinates on the output file.



After trying (and failing) to add another column of data to the “Basic” matrix within the MeasureObjectAreaShape module, I wound up replacing the column of EulerNumber data with one that corresponds to the object number [1:size(Basic,2)], which I could then overlay onto an image, which seems to work. Thanks for taking the time to clear things up for me, though.


Another sneaky way of dealing with this issue (it’s a little complicated, but hopefully you can follow the reasoning)… would be to use ConvertToImage to convert the (label matrix) objects to an image, using the option where object number 1’s pixels are all replaced with 1’s and object #2’s pixels are replaced with 2’s and so on. Then you can use MeasureObjectIntensity to measure the mean intensity of this new image within the objects. Make sense? The mean intensity of each object will then be integers corresponding to the object’s number.

But in any event, your request to add this measurement as a real feature has been added to our TO DO list.