How can I segment cells from an image taken on a microscope, along the lines of what was done here in Matlab?
http://blogs.mathworks.com/steve/2006/06/02/cell-segmentation/
Also, if I take multiple image in different fluorescent channels (after staining the cells with some antibody/maker), how can I automatically quantitate the fraction of cells positive for each marker? Has anyone done something like this in Python? Or is there a library in Python that can be used to do this?
You can do this in Python using the OpenCV library.
In particular, you'll be interested in the following features:
cv.EqualizeHist
). This is missing from the current Python API, but if you download the latest SVN release of OpenCV, you can use it. This part is for display purposes only, not required to get the same resultcv.Watershed
-- it exists, but for some reason I can't find it in the manual)With that in mind, here's how I would use OpenCV to get the same results as in the matlab article:
cv.FindContours
imextendedmax
operation is doing)I haven't tried any of this (sorry, don't have the time now), so I can't show you any code yet. However, based on my experience with OpenCV, I'm confident that everything up to step 7 will work well. I've never used OpenCV's watershed transform before but I can't see a reason for it not to work here.
Try going through the steps I have shown and let us know if you have any problems. Be sure to post your source as that way more people will be able to help you.
Finally, to answer your question about staining cells and quantifying their presence, it's quite easy knowing the dyes that you are using. For example, to determine the cells stained with red dye, you'd extract the red channel from the image and examine areas of high intensity (perhaps by thresholding).