3

I have a histology image like this:

binary histology image

From the image, we can observe there are two kinds of different cells.

cell type 1 and cell type 2

Is there any way that I can separate these two types of cells into two groups?

lennon310
12.7k11 gold badges46 silver badges63 bronze badges
asked Dec 19, 2013 at 19:49
1
  • I would suggest the tag 'image' for this kind of questions. Commented Dec 19, 2013 at 20:55

2 Answers 2

4

How about using your raw image and previous code to achieve this?

% % % your old code
I=imread(file);
t1=graythresh(I);
k1=im2bw(I,t1);
k1=~k1;
se = strel('disk',1);
k0=imfill(~k1,'holes'); 
cc = conncomp(k0); 
k0(cc.PixelIdxList{1})=0; 
k1=imfill(k1,'holes');
mask=k0 | k1;
%%%%%%%%%%%%%%%%%%

This will give you:

enter image description here

I=rgb2hsv(I); 
I=double(I);
I1=I(:,:,1); % again, the channel that can maximizing the margin between donut and full circle
Imask=(I1-0.2).*(I1-0.9)<0;
k2=mask-Imask;
k2=bwareaopen(k2,100);

This will give you:

enter image description here

k2=mask-Imask;
I2=zeros(size(I1,1),size(I1,2),3);
I2(:,:,1)=(k2==1)*255;
I2(:,:,3)=((I1-0.2).*(I1-0.9)<0)*255;
imshow(I2)

will finally give you (the two types are stored in two channels in the rgb image):

enter image description here

answered Dec 20, 2013 at 1:44
Sign up to request clarification or add additional context in comments.

Comments

2

I would use regionprops

props=regionprops(YourBinaryImage, 'Solidity');

The objects with a high solidity will be the disks, those with a lower solidity will be the circles.

(Edit) More formally:

I=imread('yourimage.jpg');
Bw=~im2bw(I, 0.5);
BWnobord = imclearborder(Bw, 4); % clears the partial objects
Props=regionprops(BWnobord, 'All');
solidity=cell2mat({Props.Solidity});
Images={Props.Image}; 

Access the elements of Images where the value in solidity is higher than 0.9 and you get your disks. The circles are the other ones.

Hope it helps

answered Dec 19, 2013 at 20:14

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.