I think line 102:

CenterLabels = full(sparse(Centroids(1,:), Centroids(2,:), 1:size(Centroids, 2), size(LabelMatrixImage, 1), size(LabelMatrixImage, 2)));

the Centroids needs to be capitalized as above. I believe they’re lowercase in the actual code. Also, is there error checking to catch cases where no cells are passed to the module? I think in this case I get a spare error about the index needed to be non-negative integer or something like that…




CenterLabels = full(sparse(Centroids(2,:), Centroids(1,:), 1:size(Centroids, 2), size(LabelMatrixImage, 1), size(LabelMatrixImage, 2)));

Also, because images are counterintuitive (at least for me), I think the labels of the centroids for your rox column indices needs to be reversed as above.



Hi Peter,

We found the capitalization issue a while back but not the row/column reversal. Thanks for catching this!




I recently downloaded and installed cellprofiler. I was attempted to use the measure radial distribution module and I get the error message for undefined function centroids. I tried to access the source code to make centroids capitalized, however I am unable to open to the code. How do I correct this problem so that I am able to get data for the radial distribution within an object?

Thank you,




If you’re using a compiled version of CellProfiler, you won’t be able to access the individual m-files that comprise the source code. The only way to actually change around the source code is to use the developer’s version of CellProfiler, but this requires that you have matlab. We’ve fixed this bug and the next compiled version will have a working MeasureRadialDistribution.




I downloaded the developer’s version and was able to correct the module MeasureRadialDistribution (line 102). However, I get a different error message now. It says there was an error using ==> sparse. Index into matrix must be an integer.

It says MeasureRadialDistribution.m(131)
AnalyzeImagesButton_callback in CellProfiler.m(4316)
gui.mainfcn in CellProfiler.m(6053)
cell profiler in CellProfiler.m(55)

Do you have any ideas as to why this occurs and how I can fix it? Thank you for your help.




You may want to take a look at this forum thread; I believe it describes what you’re experiencing.