MATLAB Answers

Segmentation shoulder X-ray image

8 views (last 30 days)
Nurul Maulidiyah
Nurul Maulidiyah on 25 Nov 2019
I have humeral of shoulder x-ray image. I have segmented the original image to image segmentation as shown below by image segmenter matlab app.But I want segment like it automatically.
is there anyone can help me to segment the humeral only without background automatically?
00701447 NORCI.jpg to Picture1.jpg

  1 Comment

Rik
Rik on 25 Nov 2019
What steps did you use in the segmenter app? That is probably a strategy that would work if you can automate the user interaction.

Sign in to comment.

Answers (3)

Constantino Carlos Reyes-Aldasoro
Ok, here is the solution, following the ideas I had previously described. I downloaded your edges so it may not be exaclty the same as yours, I called that boneSegments:
boneSegments.jpg
Then I followed these steps
% label so that each segment can be identified
boneSegments_Lab = bwlabel(boneSegments);
% obtain the size of each segment
boneSegments_props = regionprops(boneSegments_Lab,'area');
% discard all those segments that are smaller than 200
contourBones = ismember(boneSegments_Lab,find([boneSegments_props.Area]>200));
% As the area is open in the bottom, add one line to create a closed region
contourBones(end,:) =1;
% clean by a) morphological closing to connect regions, b) thinning to keep a skeleton,
% c) removing spurious edges (the top)
contourBones_clean = bwmorph(bwmorph(imclose(contourBones,ones(3)),'thin','inf'),'spur',15);
% this can then be filled
fillBones = imfill(contourBones_clean,'holes');
% Display
imagesc(fillBones)
fillBones.jpg
Problem solved. Hope that helps.

  0 Comments

Sign in to comment.


Constantino Carlos Reyes-Aldasoro
Not trivial as the intensity is high on the top and right side of the image. Otherwise a thresholding after low pass filtering could be applied. Have you tried detecting edges with canny?
https://uk.mathworks.com/help/images/ref/edge.html?searchHighlight=edge&s_tid=doc_srchtitle

  5 Comments

Show 2 older comments
Nurul Maulidiyah
Nurul Maulidiyah on 28 Nov 2019
How to take he largest blobs (assuming that the contour is closed) and call imfill()?
Constantino Carlos Reyes-Aldasoro
If the contour is closed, then it is rather easy, but in this case, the contour is not closed. The sequence below would work without the contour being closed.
Image Analyst
Image Analyst on 28 Nov 2019
That edge detection is actually not bad. You can use bwareafilt() to keep only the longer segments, then close it with an edge-linking algorithm. There aren't any in MATLAB yet, but I'm working on one (it's not finished yet). Then call imfill(mask, 'holes').

Sign in to comment.


Constantino Carlos Reyes-Aldasoro
Ok, this is a good start, try the following, assuming that your image is a
b = edge(a,'Canny',[],3);
So what you showed was b. Then do
c = bwlabel(b);
d = regionprops(c,'area');
That should label all the edges and then get their length. Then you should be able to discard all the small edges by using ismember based on the regionprops.
Once you have only one or two, which are the boundary of the bone, then you can use cumsum along the horizontal dimension so that each line will be something like this
0 0 0 0 0 ... 1 1 1 1 1 1 ... 2 2 2 2
where 0 is the left side before the first edge, the 1 is the central region and the 2 is the right side after the second edge. Then select the region == 1 and you should have the bone region.

  0 Comments

Sign in to comment.

Sign in to answer this question.