badger0053
badger0053

Reputation: 1209

Matlab segmentation of CT scan

I have an image similar to this: this http://bjr.birjournals.org/content/84/Special_Issue_3/S338/F9.large.jpg

I want to segment only the aorta(where the arrow is pointing) and get rid of the rest of the anatomy. I'm new to matlab and not sure how to start.

So far I have this:

clear all;
img = imread('~/Desktop/aorta.jpg');
img1 = rgb2gray(img);
imgh = histeq(img1);
bw = im2bw(imgh,.9);
remove = bwareaopen(bw,5000);
l = bwlabel(remove);
s = regionprops(l, 'perimeter');

My thought was to use the perimeter value to compare to the roundness and use ismember to exclude the rest, but I'm not sure how to implement that and I couldn't find any good examples explaining how to.

Can somebody explain how to do that? Also, is this strategy the best way to do this? Thanks!

Upvotes: 2

Views: 2814

Answers (2)

badger0053
badger0053

Reputation: 1209

For anyone that was curious, this is what I found to work. I first threshold the image, delete any small object smaller than 4000 pixels, create boundaries around any objects left, get the perimeter and area of the objects, set a threshold to compare to (1 would be a perfect circle), calculate how round the objects are, add items that are round according to the threshold to to an array, and finally get rid of the none round objects. Thanks for everybody that submitted links, they really helped me understand more of the process!

clear all;
img = imread('~/Desktop/aorta.jpg');
img1 = rgb2gray(img);
bw = im2bw(img,.5);
less = bwareaopen(bw, 4000);
[b,l] = bwboundaries(less,'noholes');
stats = regionprops(l,'area','perimeter');
threshold = .80;
perimeter = (4 * pi * [stats.Area]) ./ ([stats.Perimeter] .^ 2);
idx = find(perimeter>threshold);
bw2 = ismember(l,idx);
imshow(bw2);

Upvotes: 0

Leeor
Leeor

Reputation: 637

In medical imaging applications a very accurate segmentation is usually needed, run time is less important. If this is your case, I would suggest using active contours also called "snakes".

The idea behind this segmentation technique is to find an optimal segmentation that satisfies a strong edge (high gradient) and also a short (or smooth) curve. In the context of snakes these are the internal and external forces and the problem is posed as an optimization problem (of the Mumford-Shah functional). This is a region growing segmentation technique, it is a good place to start with CT images. The following code from the Matlab's filexchange is a great demo based on a great paper Active Contours without Edges.

Upvotes: 2

Related Questions