Reputation: 93
I have been given data to create spatial priors for GM WM and CSF for a project involving brain segmentation using the level set method.
I am currently stuck on how to remove the skull from Axial coronal and sagittal vies of the brain? essentially i want to extract the brain and just have the GM, WM and CSF intact.
I have attempted using thresholding and regionprops
in matlab but they leave a piece of the skull always and then remove some of the GM etc.
ideally i would like to make it a built in part of my final piece of code.
Thanks in advance for any advice or guidance on this.
The image below is similar to the data I have, except in my case the skull is not perfectly connected.
How would i extract the CSF and GM and WM from this? i am confused as to how to threshold the image for each type of tissue to create a sort of statistical map.
Upvotes: 1
Views: 3210
Reputation: 12689
Without seeing your image, it is hard to tell how and whether the extraction method fits in your case. Yet basically, I guess bwconncomp
/bwlabel
and ismember
are supposed to work.
One example:
I=imread('mri.jpg');
I=rgb2gray(I);
subplot(1,2,1)
imshow(I)
BW=im2bw(I,graythresh(I));
[L,n]=bwlabel(BW);
mask=ismember(L,2:n);
I1=I.*uint8(mask);
subplot(1,2,2)
imshow(I1)
Result (left is the original image, and right is the one after skull removal):
Upvotes: 1