Identify Primary Objects different than Object Number in Calculate Math


When running a pipeline for synapses, I identify primary objects. Since there is no way to automatically save that number of objects to a data sheet, I did Calculate Math from the same image for # of objects. This returns completely different numbers. Does anyone know why?

Picture on the right is the calculate math with the following settings:
Operation: None
Measurement Type: Object
(from IdentifyPrimaryObjects)
Category: Number
Measurement: Object_Number
Multiply: 1.0
Raise to the power: 1.0
Take log10: no
Add to the result: 0.0
Lower bound: no
Upper bound: no

Hello Climes,
Welcome to the forum!
1/ if you really want to use the CalculateMath module, then the settings should be the following:

Since what you’d like to get is the “Count” of “IdentifyPrimaryObjects” on the “Image”

2/ all the information can be automatically exported to a data sheet! So you don’t actually need the calculateMath module. You can use ExportToSpredsheet module…
If you select for example “Image” as data to export, then you’ll get a table with one line for each image, and it’ll contain the infos you require :wink:
Good luck !

1 Like

Thank you Fabien! “Image…” not object. of course. Thanks for your answer!

Hi Fabien

I hope you don’t mind me asking another question. My data isn’t being exported or saved even when clicking on either Image or the calculated math for the object number. Any recommendations on how to solve this?

Thank you!

Hi Climes,
At this point I guess it’d help if you can share your CP pipeline…

CLimes_TBI images_MAP2 synapses_test1.cpproj (1.1 MB)

I appreciate the help/advice!

Essentially I want to find the number of Homer spots that localize to MAP2 and then match the number of SYT1 that overlap with the Homer/MAP2 to = a synapse.

I’m not sure why all the data isn’t saving. Thank you so much!



Hi Colleen,
I tested your pipeline on a set of 3 of my pictures (one of them beeing actually MAP2 staining as well) :wink:
For me the pipeline is working as expected, generating at the end a set of 14 csv files.
The only thing I had to modify to achieve this was the naming of your image files, since your file names were apparently including colons?
Is that solving your issue ?

I’m so glad it worked for you - but I’m still running into issues. I renamed my files and I’m still only getting a subset of files (image 2) exported even though the “export to spreadsheet” module shows otherwise (image 1). The files being saved are also text files. Is there a setting I’m missing? (again thank you SO much for your help here)30%20AM 04%20AM

Hi again,
moving on step by step :wink:
Question: your txt files are empty or they contain data? I’ve never seen txt files generated like this…
Could you share a set of picts so that we can try a “real” analysis?
Have you tried ExportToDatabase instead of ExportToSpreadsheet? And another related question: You have just 1 set of picts to analyse or several (which would then require a proper extraction of metadata)

Thanks Fabien :raised_hands:

The text files do have data and I can do “open with Excel” to see them in spreadsheet format. Export to database shows an error.

I’ve have many many sets of images to analyze- so any advice for bulk processing and metadata will be appreciated! Control 1a Homer 6 c24 z612 Series011.tif (314.7 KB) Control 1a MAP2 6 c44 z612 Series011.tif (314.7 KB) Control 1a SYT1 6 c34 z612 Series011.tif (314.7 KB)

Ok let’s start by the beginning. Are you by any chance on a mac, linux, or a PC?
I’m on a PC and on my PC your pipeline works as expected on your image set, generating 14 csv files.
It seems like your path-filenames contain slash (/) whereas mine contains backslash (\). Maybe there’s something related to your settings of Default input / output folders and subfolders ?
Not sure about the slash and about the dot…

Hmmm - I’m on a mac. The file path is designated by the CellProfiler output folder search (the folder clicked blue in the image).

I’ve tried defining the folder in the export to spreadsheet by clicking Output “Elsewhere” and searching the computer for the folder. That didn’t work.

I’ve tried the output being the default export folder (image shown). Which is how it’s currently set.

There is also the “sub folder” option in export to spreadsheet… should I be doing that?

How have you designated where the output goes for both the “View Output settings” as well as the settings in “Export to Spreadsheet” ?

I removed the . in TBI vs. Control - still no luck :roll_eyes:

Is there a setting I’m missing on each analysis that says it should be exported?