From: Slava Chesnokov on
Hello.
There is a color image (I), which contains many cells, there is a binary mask of this image (bw).

Using text:
[bw1 num] = bwlabel (bw, 8);
feats = imfeature (bw1, 'Image', 8);
Image = feats (4). Image;

I've got to cut the mask "bw" and get in the "Image" image of all cells individually.

Question:
How to cut on the original image exactly the same pieces as in the mask. Ie on the mask, I marked out how to cut, but it should cut color image. As a result, should turn out of 1 image "I" a lot of small images, and each contains 1 cell?