Mark and I were discussing the measurements made by the Matlab code and I am wondering whether it makes sense to implement similar measurements in CellProfiler instead of replicating the MeasurePopulationContext code as a piece. For instance, we could the Ripley K function which calculates the density of cells within a given radius, normalizing for total cell density. Similarly, a measure of distance to an edge would find a broader use if the inputs were the edges in any binary image (for instance, the output of ApplyThreshold) and any object set.
Population density is a very easy measurement to compute and one that would be appropriate to add to MeasureObjectNeighbors. Distance from an edge is also easy to compute, but I am less sure where it would be added - it could be a supplementary module in the plugins directory. Some of the other parts of the Matlab code are very difficult to implement in the context of CellProfiler - there is code that determines the microscope meander pattern to stitch all images in a well together and that might be specific to their setup or work under only certain conditions.
Which of the measurements output by their module would be the most use for you? I wouldn’t mind writing code for a measurement or two as a plugin with an eye to later integration.