This is what the result looks like for the first image using the code given above.
But a part of the first cell body is missing in the mask.
So I need help in extracting the exact shape of the cell body in the mask. How do I go about it ??

Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!