Save Object Numbers/Labels in Image

Dear CellProfiler users,

first of all many thanks for publicly providing this amazing software! It is user friendly and works highly accurate in my case. For quality control purposes, I would like to create an image which contains my primary object outlines together with the object numbers/labels. Is that possible? I looked through the manual and the forum, however I am so far only able to create the outline containing image but not with the object numbers/labels.

Many thanks and all the best,

Daniel

1 Like

Hi Daniel,

Glad CP is working well for you! Yes, you can save that info:
(1) In the Identify* module, be sure to “Retain outlines …”
(2) Use DisplayDataOnImage to plot the measurement “YourObjectName” > Number > Object_Number. (See screenshot.) And as long as the measurement is upstream from DisplayDataOnImage, you can plot any other measurement here, too.

Cheers,
David


Dear David,

many thanks for your reply. It works.

I would like to ask one more question: When exporting the data from MeasureObjectIntensity with the ExportToSpreadsheet module, I so far only get numbers (1, 2, 3, …) for the single Images (i.e. Image “1” with Labels “1, 2, 3, and so on” for the single cells). I would rather like to have the original Image name in the exported Spreadsheet. I expected this funtion in the ExportToSpreadsheet module, but I didn’t find it.

Many thanks again and all the best,

Daniel

Dear David,

I think I found the function: I have to define metadata from the filename, and then the exporttospreadsheet should automatically take the metadata instead of “1, 2, 3” and so on. However: Is there an easy regular expression to define metadata from the whole filename?

Example for one of my file names: IF140510_6G3 HS LMB siP C 1_z0_ch00.tif

I would be perfect if it takes the whole filename “IF140510_6G3 HS LMB siP C 1_z0_ch00”, replacing the “1” in the Spreadsheet.

Many thanks again and all the best,

Daniel

Sorry I did not mention that I got the metafile extraction in the meanwhile by using

^(?P.*)$

which works fine. However, for any reason I still get 1, 2, 3 … in my spreadsheet. I upload my pipeline in the attachment, so I hope there is a mistake somewhere.
pipeline.cppipe (15.3 KB)

Hi Daniel,

It sounds like extracting metadata is working fine for you, exactly as it should. Is it not, when you click “Update” in Metadata? You will always have a column titled “ImageNumber” in your PerImage table/spreadsheet which is an monotonically increasing integer, which is especially useful for database management. If one extracts metadata, you will get extra columns in your Per_Image table labeled “Image_Metadata_<YOUR_METADATA>”, but always in addition to the ImageNumber.

AH! Actually, I just looked at your pipeline and in ExportToSpreadsheet you don’t have “Image” chosen so I don’t think your Per_Image table will be exported, but only the couple Per_Object tables you chose. Add the “Image” table and you should see your Image_Metadata_* columns.

David

Dear David,

that worked! Thanks a lot!

All the best,

Daniel

Great! I love getting messages like this :smile:

[quote]that worked! Thanks a lot!
[/quote]