Reputation: 53
I have a 3d array (grayscale) and I would like to do segmentation. I am using Matlab for this and I found this documentation: https://nl.mathworks.com/help/images/color-based-segmentation-using-k-means-clustering.html
However, this is for a 2D RGB image, so I was wondering if there is a way to do this for a 3D array in grayscale, so clustering based on intensity instead of colors. Thanks in advance.
Upvotes: 0
Views: 216
Reputation: 1412
d = load('mri.mat');
D = squeeze(d.D);
numClusters = 3;
out = imsegkmeans3(D,numClusters);
figure
labelvolshow(out)
Upvotes: 1