Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do this in Python using the <a href="http://opencv.willowgarage.com/documentation/python/index.html" rel="nofollow noreferrer">OpenCV</a> library.</p> <p>In particular, you'll be interested in the following features:</p> <ul> <li>histogram stretching (<code>cv.EqualizeHist</code>). This is <a href="https://code.ros.org/trac/opencv/ticket/544" rel="nofollow noreferrer">missing</a> 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 result</li> <li><a href="http://opencv.willowgarage.com/documentation/python/imgproc_miscellaneous_image_transformations.html?highlight=threshold#Threshold" rel="nofollow noreferrer">image thresholding</a></li> <li>morphological operations such as <a href="http://opencv.willowgarage.com/documentation/python/imgproc_image_filtering.html?highlight=erode#Erode" rel="nofollow noreferrer">erode</a> (also dilate, open, close, etc)</li> <li>determine the outline of a blob in a binary image using <a href="http://opencv.willowgarage.com/documentation/python/imgproc_structural_analysis_and_shape_descriptors.html?highlight=findcontours#FindContours" rel="nofollow noreferrer">cv.FindContours</a> -- see <a href="https://stackoverflow.com/questions/4785419/detection-of-coins-and-fit-ellipses-on-an-image/4788874#4788874">this question</a>. It's using C, not Python, but the APIs are virtually the same so you can learn a lot from there</li> <li>watershed segmentation (use <code>cv.Watershed</code> -- it <a href="http://www.seas.upenn.edu/~bensapp/opencvdocs/ref/opencvref_cv.htm" rel="nofollow noreferrer">exists</a>, but for some reason I can't find it in the manual)</li> </ul> <p>With that in mind, here's how I would use OpenCV to get the same results as in the matlab article:</p> <ol> <li>Threshold the image using an empirically determined threshold (or Ohtsu's method)</li> <li>Apply dilation to the image to fill in the gaps. Optionally, blur the image prior to the previous thresholding step -- that will also remove small "holes"</li> <li>Determine outlines using <code>cv.FindContours</code></li> <li>Optionally, <a href="http://opencv.willowgarage.com/documentation/python/core_drawing_functions.html?highlight=drawcontours#DrawContours" rel="nofollow noreferrer">paint the contours</a></li> <li>Using the blob information, iterate over each blob in the <strong>original</strong> image and apply a separate threshold for each blob to separate the cell nuclei (this is what their <code>imextendedmax</code> operation is doing)</li> <li>Optionally, paint in the nuclei</li> <li>Apply the watershed transform</li> </ol> <p>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.</p> <p>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.</p> <p>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).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload