New Modules and Help with Further Development

Howdy all,

I’m just getting my feet wet with Cell Profiler, but it’s been pretty neat so far. I’ve got a couple of modules so far. They’re very hackish. There’s no error checking whatsoever. And I’m not sure how generally useful they are, but I definitely felt like it would be useful for my particular workflow. If possible, I’d love to get some feedback on them in terms of how to make them more efficient or how to think more in line with the other development efforts.


Modules

  1. IdentifyCOISubregion.m (7.97 KB) - finds the center of intensity of each subregion you input, inherits the parent’s parents
  2. IdentifySecondaryBorderCleanObjects.m (7.54 KB) - excludes secondary objects that lie on the border of an image. Goes back and excludes the primary object as well. Also, inherits the parent’s parents
  3. RelateByOverlay.m (5.85 KB) - does the relate function except just by straight overlay (so not intelligently), but works in cases where you don’t want too much intelligence when employing relate (primary grouped two disperate objects that are close to each other in to a single object but it spans two containing objects or something like that)

General questions on design

  1. Is there a CPInherit function or something like that, that goes back and finds all the parents of the parent object and applies them to the child object? Is that necessary to do? Is it necessary to keep track of the number of child objects (will downstream modules look for this)?
  2. When are Parent and Child information looked at? Do the Calculate Math and Calculate Ratios programs look for things like that and use them intelligently?
  3. Was it even necessary to develop an IdentifySecondaryBorderCleanObjects module? I’ve looked around to try to find a better way, but it seemed like it could be something wanted.
  4. Not really a question, but that was fun.
  5. What next?

All right, well I think that about covers it for now. Just wanted to post up some development and say hello to everyone.

Cheers,

Peter

P.S. - Anyone at Stanford making modules?

My fault for not testing RelateByOverlay before posting. It obviously causes a fault that’s easily changed by renaming one of the parameters.

-Peter
RelateByOverlay.m (5.85 KB)

Neat!
It sounds to me like several, perhaps all, of these functionalities could be added as options to the relevant existing modules. CP team, what do you think? If so, let’s put them on our TODO list. We are applying for funding for the CellProfiler project in January, so we might be able to add features like this to the standard versions of modules. In the meantime, perhaps they will be useful as is to other users. Thanks for posting!

(And, I’ve not responded to your questions 1-3 - will leave that to someone else!)

Anne

Thanks for the input! If someone’s able to answer the first three questions, that would be extremely helpful for future development efforts. Anyways, on to measuring things. Is there anything out there that will just give a whole battery of measurements on objects? I’d like to try to take seemingly arbitrary measurements, do PCA analysis on the data points and see if I can automatically find good criteria for sorting phenotypes.

Cheers,

Peter

Hi Peter,

Thanks for all your hard work on putting those modules together. I thought I’d try to answer your earlier questions:

(1) No CPinherit function as yet. The parent/children relationship only extends to immediate family. :smiley: We do keep track of the number of child objects.

(2) This information can be used as a powerful means of filtering objects based on such relationships (e.g., ClassifyObjects, FilterByObjectMeasurement; see here for an example). These relationships are output as a Measurement in ExportToExcel/ExportToDatabase in case they are needed for further processing. CalculateMath and CalculateRatios should be able to use this like any other measurement, but I have not tested this functionality myself.

(3) I imagine that such a functionality would be useful, but I haven’t noticed user requests for it yet. I think Anne is right; it could probably be best be incorporated into the existing IDSecondary as an additional option.

Hope this helps! And thanks again!
-Mark

And regarding your question about measuring a battery of non-designed features, we do this all the time. Basically it involves identifying as many compartments of cells as you possibly can (including, for example, using Shrink/Expand + IdentifyTertiary to identify concentric rings around the nucleus, or the plasma membrane for example), then throwing every Measure module into the pipeline that you can think of: measuring size/shape for all compartments, and measuring intensity and texture for all compartments x all channels that are available. Have fun!
Anne

I feel like I’ve been through the bowels of CellProfiler and back, so I was thinking it might be time to update the modules above and spew out a couple more. I hope someone can find these useful and welcome constructive criticism on how the code is put together as well as if the modules were necessary in the first place (i.e. - am I missing some sort of design process inherent in how the other modules were shaped). The modules in their current state aren’t well documented, but if more documentation is needed it can surely be provided. Also, I haven’t done much error checking unfortunately. Also, an idea for a new module to do thresholding (i.e. Otsu or MOG within objects) - is that something being done or something that can already be done with existing functions (or even something needing to be done?)?

Cheers,

Peter

IdentifyCOISubregion - finds the center of intensity of each subregion as before

IdentifySecondaryBorderCleanObjects - excludes the secondary objects that lie on the border and creates new primary objects within that set of secondary objects - relates things back but seems to be causing problems with Cell Analyst importing - see the Cell Analyst help forum for more info and possible future solutions

RelateByOverlay - does the relate function except just by straight overlay (so not intelligently), but works in cases where you don’t want too much intelligence when employing relate (primary grouped two disperate objects that are close to each other in to a single object but it spans two containing objects or something like that).

MeasureRadialDistributionFixedSize - does an operation similar to measureradialdistribution but instead of totalling the intensities from the center of an object to the edge in relative bins, uses fixed bins. Some wierd coding was hacked so that the handles structure storage would work right so you have to specify maximum bins and it writes zeroes for unfilled bins.

MeasureStandardDeviationCurve - measures the standard deviation curves of each object given an intensity image. More info on this if needed.

SubtractBackground… - These could probably be all combined given another input and a test on which mode the user wanted the calculation done - basically, like the original subtract background, but instead of finding the tenth lowest pixels of an entire stack of images, it just does it for the single image (is this sound to do scientifically?).
Mean - take the mean pixel
Mode - the mode
Median - the median
Modified - lets the user choose exactly which pixel to take (like the 500th one or the 21st one)
Modules.zip (25.2 KB)

For those who are interested: CellProfiler 2.0 (available from our website) has improvements to the IdentifySecondary module which allow the user to remove secondary objects touching an edge, as well as the associated primary objects if desired (this corresponds to the IdentifySecondaryBorderCleanObjects module described by Peter).

Regards,
-Mark