This is my output image imshow(imIDX,[]); .How can i read this image into variable and how can i make it a binary image?
2 views (last 30 days)
Show older comments
figure
imshow(imIDX,[]),title('Image after applying k-means Clustering Algorithm');
How can i read the image into a single variable ? how can i make it a binary image?
2 Comments
Accepted Answer
Image Analyst
on 26 Feb 2017
imIDX is already a variable. To create a binary (logical) image from it, or a processed/filtered version of it, you can threshold to get values above or below some special value
binaryImage = imIDX < someThreshold;
5 Comments
Image Analyst
on 26 Feb 2017
If you use kmeans, you're finding different gray level ranges all the time. So if you stripped off the skull and ignored the pure black mask, then you have normal gray and black in the brain, and possibly a tumor, but possibly not. So if you used a k of 3 and there was a big tumor, it could find it. However if there was no tumor, it will still find 3 classes. But unlike before, one of those classes will NOT be a tumor - it will be normal tissue. So now you're going to have to examine that class and see if that class is a real tumor or just normal tissue. For example, you could look at the absolute gray level and see if it's white or gray. Well, if you're going to do that, then why not just do that from the start and not do kmeans()? That said, I haven't read the paper and perhaps kmeans plays some role in the complete tumor segmentation process, I just don't know what it could be and still be robust enough to handle all cases from 0% tumor to 100% tumor.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!