Is there a method to return the image of just one cell and make rest of the image white? I need to highlight a cell using a mouse click and show just the cell, it is surrounded by a boundary. Should I use bwperim?
This is the cell. it is surrounded by white pixels. I need to click on a seed point and return the cell image within the white boundary and discard the rest of the image to white. I have used ginput for the mouse click.
No products are associated with this question.
There are lots of ways. Probably the easiest is to label your binary image (the one you used to create the perimeter from). Then from ginput(), get the label at that point and use ismember(labeledImage, labelNumber) to extract that particular blob from the binary image of all the blobs. Then you can do whatever you want to do, such as measure that blob only, or use that blob as a mask to blacken the original gray scale image outside the blob, or whatever else you want to do. Your request to "return the cell image within the white boundary" is not detailed enough to know what you mean - it's ambiguous, and there are several things that that could mean. See if you can do it yourself. Here are the steps for you do complete: