We’re in the process of migrating our image segmentation tasks from our current home-built matlab code to CellProfiler. The primary reason for this is the flexibility that CP2 offers in identifying objects. I’ve been very impressed with CP2, so thank you. The interface is clean and intuitive, and the help manual is well documented. I have encountered a few issues, which I describe below. Some of these may be my mistakes.
I initially made the mistake of putting a hyphen in the “name this loaded image” field in the loadimages module. CellProfiler didn’t warn me (and I forgot) that hyphens aren’t allowed in the field name of a matlab struct. The pipeline even appears to run and a mat file is produced, so I didn’t discover the error until I loaded the mat file.
The command line capabilities are great, but there seems to be no built-in way to run the same pipeline on multiple folders in batch. Instead, I wrote a little python code to do this.
Suppose you have a single image that you want to use for correctilluminationapply against a long series of images. This process is inefficient in CP2 because rather than performing loadsingleimage once at the beginning of the analysis, CP2 performs loadsingleimage at every iteration.
I’m performing morphological opening on my nuclei, because identifyprimaryobjects sometimes gives jagged edges that aren’t in the actual image, despite my efforts playing around with the parameters. After I have my rough nuclei by identifyprimaryobjects, I use convertobjectstoimage, using type binary. Then I use morph (open with scale 3), then I use identifyprimaryobjects with a manual threshold between 0 and 1. Surprisingly (for me at least), the size of the (opened) nuclei now depends on the exact value of the manual threshold that I use, e.g., the objects are smaller with a manual threshold of 0.9 than with 0.5. A manual threshold of 0.5 seems to produce the correct size, which I suppose makes sense, but I did not expect such behavior.
When using saveimages and “select the type of image to save” is “objects”, there seems to be no option to specify saving the image as uint16 (suppose I may have more than 255 objects). Instead, I have to use convertobjectstoimages with uint16, followed by saveimages with tif (or tiff) and image bit depth of 16. Unfortunately, saving as 16-bit png is not possible, so each of my object images is 2 MB instead of 20 KB. I’m currently using imagemagick to batch convert all the tifs to pngs after each analysis finishes.
The trackobjects module leaves a bit to be desired, in my opinion. I know you’ve got the LAP algorithm in there, but its various parameters don’t seem very intuitive. At this point, we’re using CP2 to segment our images, measure intensities, etc., and spit out a mat file, then we use a separate particle tracking algorithm (physics.georgetown.edu/matlab/) to track our cells. I’ll naively suggest that you make that algorithm available in CP2.
Cellprofiler cannot handle the situation in which a “saveimages” module is followed by a “loadimages” module that will load the previously saved images, because the images don’t exist when the analysis is started. If the images exist from a previous analysis (even though they will be overwritten), it works. I realize this is not something you should usually have to do.