![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172627/image.png)
I want to extract skull from Brain MRI usinG MORPHOLOGICAL OPERATIONS . But i didnt get a useful output by using the following code..Please help me to solve this.s
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sam CP
am 7 Feb. 2017
Kommentiert: Image Analyst
am 25 Jul. 2020
clear all;
clc
[filename pathname] = uigetfile({'*.jpg';'*.bmp'},'Select MRI');
inputimage=strcat(pathname, filename);
I = imread(inputimage);
figure,imshow(I), title('input');
se = strel('disk',7);
closeBW = imclose(I,se);
figure, imshow(closeBW);title('close operation');
afterOpening = imopen(closeBW,se);
figure, imshow(afterOpening,[]);title('open operation');
J=I-afterOpening;
figure, imshow(J,[]);title('Skull of MRI');
K=I-J;
figure, imshow(K,[]);title('Skull removed MRI');
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 17 Feb. 2017
See attached m-file.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172627/image.png)
6 Kommentare
Magdalena Gierczynska
am 25 Jul. 2020
Hi, I'm writing my bachelor thesis and I tried use this code to skull removal but it doesn't work. I work on dicom files, but on .jpg it doesn't work too. Can u help me? What I do wrong?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/336931/image.png)
Image Analyst
am 25 Jul. 2020
Well it's nothing like my code. Anyway, you should threshold the image to find everything that's skull, then use that to erase the skull pixels.
skull = grayImage > someValue;
grayImage(skull) = 0;
There are a few other things you could do to make it better but that's basically it.
Weitere Antworten (1)
Manikandan R
am 6 Dez. 2018
where the m file is attached
2 Kommentare
Image Analyst
am 6 Dez. 2018
If you're asking me, my m-file is attached below the green checkmark that says Accepted Answer.
Siehe auch
Kategorien
Mehr zu MRI finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!