Math features



Hi there, I have just started using cellprofiler and I was wondering if anyone can help me with a couple of aspects of the “CalculateMath” function?

Firstly, how do I export the results from the calculations as a spreadsheet? I have tens of images, with three CalculateMath commands per image, and I would like the results in a spreadsheet.

Secondly, is there a way to get a math result for each object? I have puncta, and I want it to calculate how many puncta each cell has, but at the moment I can only work out how to calculate the total number of puncta divided by the total number of cells to get the mean number of puncta per cell. I have tried dividing objects by other objects rather than images by images, and it doesn’t seem to do what I want to do.



Sorry, I have attached a pipeline and example image now. I think I have worked out where the data from calculate math exports too, but I would still like to know how to calculate number of puncta for each cell if possible.



rb594 ms488 puncta.cp (22.7 KB)


Hi Heather,

To calculate the number of puncta per cell, you first need to identify the cell body (or cytoplasm), as well as the puncta themselves; this, you’ve already done. The RelateObjects module then establishes the parent-child relationship between the cell objects and the puncta objects. An output of the RelateObjects module is the number of child objects per parent, so you actually already have all the pieces in place :smiley: The per-parent child count is stored in the parent object (i.e, cell) spreadsheet, as “Cells_Children_<puncta_object_name>_Count”.



Thanks Mark!


Hi! :slight_smile: I’m new on CellProfiler too, and I’m trying hard to export CalculateMath to spreadsheet… I’m calculating the percentage of cells which proliferate, and CalculateMath gives the answer correctly but it doesn’t export to spreadsheet, it only opens a new window of the program. Were you able to do that? Tks!



Is there an ExportToSpreadsheet module in your pipeline? If not, you can add one (in the FileProcessing section); if so, make sure when you run your pipeline that you’re in analysis mode, not test mode (if in analysis mode under the pipeline there are 2 buttons saying “Start Test Mode” and “Analyze Images” ; if in Test Mode there will be 4 buttons saying “Run” “Step” “Exit Test Mode” and “Next Image Set”. Hope that helps!