clustering based on area
Show older comments
i already measured the area on my sputum cell. now i want to cluster it based on area. area >2000 in figure 1 and area 2000< is in other figure 2. can i know the simple tutorial.? i dont want to use k mean clustering because it very complicated. i only want to cluster them as simple as i can

4 Comments
martin SALGADO
on 12 Nov 2015
Might uploading your code. I'm doing my memory on this topic and I would be very useful your code. Thank you
Image Analyst
on 12 Nov 2015
You can look at my Image Segmentation Tutorial here: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
No need to do it inefficiently like wil did below - you can simply use ismember() like I did.
martin SALGADO
on 12 Nov 2015
Your code Image Segmentation Tutorial is for segment images, but I want only one way clustering a set of points, and the area that contains the items is less than some value.
izyan hanum
on 3 Dec 2015
Accepted Answer
More Answers (2)
wil
on 23 Mar 2015
Hi,
k-means is probably the simplest method of clustering, but if you simply want to sort the regions based on their area, you can use logical indexing or the find() method.
It depends on they type of data your groups are, but if they are simply binary images you can use (assuming the cells are contained in a cell, change as appropriate)
vol = cells{i};
area(i) = numel(vol(vol ~= 0));
to get the area for each cell and sort them using
idxs_1 = find(area < 2000);
idxs_2 = find(area >= 2000);
cells_1 = cells(idxs_1);
cells_2 = cells(idxs_2);
The groups cells_1 and cells_2 now contain your grouped cells.
Hope this helps, let me know if anything needs clarifying.
Wil
1 Comment
izyan hanum
on 23 Mar 2015
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!