Display outlined images for Classifier training?


I am having a difficult time getting CP to identify cell borders like I would if I were manually tracing cells. I would like to use CPA’s Classifier to separate properly traced from improperly traced cells. For instance, if I would manually trace 40 cells on an image, CP seems to get about 20-30 of them properly traced. The improperly traced cells are sometimes the ones even I may have a difficult time discerning where to properly trace thier boundaries, so I know there are limitations with what I can ask of CP. I am willing to lose the improperly traced cells and compensate by just acquiring more images. I would like to use CPA to do this sorting, but I need to be able to see the outlined images in classifier. Is there a way to do this? If I have outlined images saved, can I direct CPA to use them for display purposes without affecting measurement data? Here’s one of my images with some improperly traced cells circled. The cells with a very thin rim of cytoplasm are not pickup with this stain so I can easily have CPA sort them for me.


Hi Matt,

Yes, you can do this. Note that from a perceptual standpoint, we often suggest CPA users forgo using outlined images, because the additional “information” from the outlines might skew the user’s perception of the original object, and thus perhaps classify it differently than they would without the outlines. However, we understand that in some cases in which the segmentation is not great, like yours, viewing outlines are useful.

Use one (or more) of your channels in the CPA properties file to point to the column(s) in your image table which holds your outlined images. If these are not already in your database, make sure the setting in CellProfiler’s SaveImages to “Update filename within CellProfiler” = yes, and they will be added to the database if you run CP again. Or you can add these columns manually with MySQL. And if you define the non-outlined images on another channel, you can toggle between the “channels” to turn the outlines on or off. The measurements were taken from the non-outlined images, and so whatever channel you display in CPA’s Classifier, outlined or not, has no bearing on the actual classification.

Let us know how it goes.


Hi David-

Thanks for the reply. I tried it, but ran into some issues. I am using CP v 1.0.5811. The ExportToDatabase module has a bug where it drops the extensions for the image files (in my case, .tif). I have been using notepad’s replace all function to update my image file names in the .csv files prior to running SETUP.SQL. So I can’t use the the option in SaveImages that uses original filenames as a prefix for the traced images unless I want to go in and add .tif to all of the original filenames in the .csv file by hand. I have tried N and the option =DesiredFilename where DesiredFilename is traced. Both of these options returns an error (e.g. "…Matlab says the error is: Reference to non-existent field 'PathName=traced’. in the SaveImages module, which is module #17…).

The other bug that you mentioned in the other post with displaying cropping squares >100 is also an issue for me that makes classifier temporarily unusable. So, until some more bugs are fixed in the next versions of CP and CPA, I may be stuck.