필터 지우기
필터 지우기

How to change pixel values of background of an MRI Segmented result ?

조회 수: 1 (최근 30일)
Ynne
Ynne 2016년 11월 20일
답변: Image Analyst 2016년 11월 20일
Hi, I am trying to run a script for object segmentation based on GMM. As the example presented below the image is segmented into 3 classes. the problem is that the background of the image has the same pixel value of one of the segmented classes. If i change into 4 classes the segmentation result is worse. Is there any solution?

답변 (3개)

Walter Roberson
Walter Roberson 2016년 11월 20일
imclearborder -- unless the white part touches the border (if it does, then pad the image with a row of background before doing the clearing)

Ynne
Ynne 2016년 11월 20일
another example with this image, the black region within the brain is a class. So when i want toextract it from image it will be fused with the background of the image (because they have the same pixel value 0 in this case) Is there any solution to extract this class without the background ?
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 20일
Once you have cleared the border to black, you can imfill('holes') . That will get you an ROI mask.
The median of the outside edge values is probably going to be the border level. Pad the image with a row of that in case the real stuff touches the edge. imclearborder. imfile('holes')
But as for extracting: what data structure does your GMM segmentation need? Does it already handle being passed an ROI mask? Does it just want a vector of values? If it wants something 2D then you could extract down to a bounding box but you would still have problems.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 11월 20일
What function are you using to get the GMM model? gmdistribution() or fitgmdist() followed by cluster? You can make a vector of pixel values to assign a cluster label to. Then you make another N-by-2 array that has the locations (row, column) of all the pixels in the ROI. Then with that you can create a classified image, and assign the pixels outside the ROI to some class number that identifies them as not assigned, like 0 or -1 or whatever.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by