MATLAB Answers

Skull striping without affecting tumor region

59 views (last 30 days)
Sehrish
Sehrish on 5 Jul 2012
Commented: elif yoldas on 15 Apr 2016
Can anyone help me to remove the skull part of the brain image without effecting the tumor region? the image is http://imageshack.us/photo/my-images/196/img6oe.jpg/ Actually the intensity level of tumor as well as the skull part is really high and whatever i tried, it effects the tumor region as well. kindly help me regarding this:

  0 Comments

Sign in to comment.

Answers (3)

Matt Kindig
Matt Kindig on 5 Jul 2012
Edited: Matt Kindig on 5 Jul 2012
If you have the Image Processing Toolbox, you can use 'regionprops' to identify the various objects after your thresholding. For your particular image, I was able to identify the tumor using the following approach:
img = imread('/path/to/your/filename.jpg');
bw = (img > 0.5*255); %thresholded to remove background and white/gray matter
lbl = bwlabel(bw); %labelled regions
props = regionprops(lbl, 'Solidity', 'Area');
% solidity is the percentage "filled" of an area. For the skull,
%the solidity will be really low.
solidity = [props.Solidity];
area = [ props.Area];
hiSolid= solidity > 0.2; %get only high solidity objects
maxArea = max( area(hiSolid));
tumorLabel = find( area==maxArea); %label of tumor
tumor = ismember(lbl, tumorLabel); %b/w image of tumor
imshow(tumor); %this isolates tumor

  3 Comments

Sehrish
Sehrish on 5 Jul 2012
Thank you so much for the response.Is it possible that only the boundary line is removed while the inner gray matter and tumor remain intact. Actually i am new to matlab. I have to implement Kmeans after that.
Matt Kindig
Matt Kindig on 5 Jul 2012
Sure, one way is to first extract everything inside the skull, and then remove everything that is the skull itself. Something like this seems to work. Again, not necessarily a general solution, but it should give you an overview of some common image processing functions that can help.
insideSkull = (img > 0.3*255); %isolate all dense material
insideSkull = imfill(insideSkull, 'holes');
bw = (img > 0.4*255);
lbl = bwlabel(skull);
skull = find(Solidity < 0.2);
skull = ismember(lbl, skull);
skullOrBorder = skull | ~insideSkull;
noSkull = img;
noSkull(skullOrBorder)=0;
imshow(noSkull); %this only contains gray matter and tumor
You might need to adjust the thresholds to get better performance. Also, I would recommend looking at the Demos for the Image Processing Toolbox. You can access them from the Help browser using Help->Image Processing Toolbox->Demos.
Sehrish
Sehrish on 5 Jul 2012
its working but giving different results for different images. the problem is in threshhold values. How can i get automated threshholds?

Sign in to comment.


Felix
Felix on 5 Jul 2012
Edited: Felix on 5 Jul 2012
Unless you have a huge number of images, I think the best solution is to mask it manually, because no algorithm is as good as the eye. For example I use the program MIPAV, which can read many different scanner formats.

  0 Comments

Sign in to comment.


Anton Semechko
Anton Semechko on 5 Jul 2012
Edited: Anton Semechko on 5 Jul 2012
The simplest way to segment the tumor in the sample image would be to use region growing algorithm. There are a few implementations of this method on FEX, but for the following demo I used this one:
1) Download the function titled 'regiongrowing' from the link given above into your working directory.
2) Segment the tumor using pixel position [380 480] as the seed point:
% get the sample image
im=imread('http://desmond.imageshack.us/Himg196/scaled.php?server=196&filename=img6oe.jpg&res=landing');
% segment the ROI
thr=15; % intensity similarity tolerance
bw=regiongrowing(double(im),380,480,thr);
% fill in the holes
bw=imfill(bw,'holes');
% visualize the segmentation
r=im; g=im; b=im;
r(bw)=255; g(bw)=255;
rgb=cat(3,r,g,b);
figure, imshow(rgb)
clear r g b
You will get different results depending on the value of 'thr' parameter.
Hope this helps.

  9 Comments

Show 6 older comments
saranya
saranya on 30 Jan 2013
great work. thank you. it helped me a lot.am doing my final year project in brain tumor detection. the above code works only for this particular image http://desmond.imageshack.us/Himg196/scaled.php?server=196&filename=img6oe.jpg&res=landing how to implement the same code for other images that i have????? am new to matlab.....guide me pls....
Image Analyst
Image Analyst on 30 Jan 2013
You have to adapt it. That's what image processing is all about. Often people make an algorithm that works fine for just one image but is not robust enough for all similar images. That's where you skill as an image analyst comes in. You have to figure out what parameters need to be veried for the other images, for example, threshold values, minimum sizes, kernel width, etc. It's your project, and you have your images, so it's up to you, and perhaps the radiologist who's helping you that supplied you with the images.
elif yoldas
elif yoldas on 15 Apr 2016
code is not done work and image is not found :(

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!