How to perform skull stripping using matlab?
Mostrar comentarios más antiguos
I would like to do a project on skull stripping. What is the effective method to perform skull stripping/removal? Could anyone help me in getting code for that?

This is my image sir.
2 comentarios
Matz Johansson Bergström
el 28 de En. de 2015
Editada: Matz Johansson Bergström
el 28 de En. de 2015
Maybe you should change the term "Skull stripping" to a more generic term like "3d slice visualization". You might get more help that way.
manasa
el 28 de En. de 2015
Respuesta aceptada
Más respuestas (4)
Alfonso Nieto-Castanon
el 28 de En. de 2015
5 votos
Assuming that you do not have simply that slice but the entire MRI scan (e.g. a filename.nii or filename.img file) I would suggest using SPM (this is Matlab software). Applying segmentation to your structural volume will generate a number of masks (files named c#filename.nii) indicating the different tissues of interest.
To perform skull-stripping you typically want to keep the grey-matter, white-matter, and CSF masks (masks c1filename.nii to c3filename.nii, respectively) and remove everything else. You can do this after segmentation simply using SPM 'imcalc' option and multiplying your original structural volume by the sum of these masks (c1- to c3).
Image Analyst
el 28 de En. de 2015
2 votos
To strip/remove the skull, look for my code and search for things like skull and brain in this Answers forum. I know I gave a demo for this some time back. A quick check didn't find my demo but I didn't look at a lot of questions on this, and there are a lot of them. I did find one answer I gave and it seems valid for your case.
To strip the skull you threshold it so that you get the skull separated - not connected to the brain. Then you label it with bwlabel() and then use ismember() to isolate the region with label 1, which should be the skull assuming it's the outermost object (no letters or annotation present in the image). Or you can use ismember to extract out everything with labels 2 and up to get everything except the skull.
Attach your image and attempt at coding that up for more help.
2 comentarios
Chandita Nath barbhuyan
el 2 de Mzo. de 2017
Editada: Image Analyst
el 2 de Mzo. de 2017

How to remove the white skull region outside?
Image Analyst
el 2 de Mzo. de 2017
Adapt my attached skull stripping demo.
Matz Johansson Bergström
el 28 de En. de 2015
Editada: Matz Johansson Bergström
el 28 de En. de 2015
1 voto
Magdalena Gierczynska
el 7 de Oct. de 2020
0 votos
Hi, I have a question. I understand everything to "%Erode away 15 layers of pixels.". You used erosion to reduce border pixels, but what exactly happen in "% Mask the gray image"? On the next image you show "skull stripped image", how? I don't understand this part of code. Can you explain me? I will be greatful.
5 comentarios
Magdalena Gierczynska
el 7 de Oct. de 2020
What mean "~" in your code?
Image Analyst
el 7 de Oct. de 2020
In code, ~ means inverse. So if the expression immediately after the ~ is false, using ~ will produce a true value. And vice versa
% Example 1
t = true;
f = ~t; % f will have a value of false
% Example 2
f = false;
t = ~f; % t will have a value of true
% Example 3
mask = grayImage < 100; % mask is true if pixels have values less than 100
invertedMask = ~mask; % invertedMask is true if pixels have a value >= 100
Ayush singhal
el 22 de Mayo de 2021
Hello, I have a simikar doubt reagarding this.
I have two images. one with stripes and another object with stripes. I would like to extract the object from these two images. These two are uint8 images. Also I want to find the depth of the object by showing images in the surf plot.
Could you give some hint?
I have used imsubtract but it won't give the desire results.
Pprs3 = imread('P1000571-min.JPG'); % Colour Image
Pprs1 = rgb2gray(Pprs3); % Grayscale Image
x = 0:size(Pprs1,2)-1;
y = 0:size(Pprs1,1)-1;
[X,Y] = meshgrid(x,y); % Coordinate Matrices (Not Necessary)
figure(1)
meshc(X, Y, Pprs1) % Mesh Plot
grid on
xlabel('X')
ylabel('Y')
zlabel('Intensity')
colormap(jet)
hold on
a = imread('P1000578-min.JPG'); % Colour Image
b = rgb2gray(a); % Grayscale Image
x = 0:size(b,2)-1;
y = 0:size(b,1)-1;
[X,Y] = meshgrid(x,y); % Coordinate Matrices (Not Necessary)
figure(2)
meshc(X, Y, b) % Mesh Plot
grid on
xlabel('X')
ylabel('Y')
zlabel('Intensity')
colormap(jet)
hold on
c = imsubtract(Pprs1,b);
x = 0:size(c,2)-1;
y = 0:size(c,1)-1;
[X,Y] = meshgrid(x,y); % Coordinate Matrices (Not Necessary)
figure(3)
meshc(X, Y, c) % Mesh Plot
grid on
xlabel('X')
ylabel('Y')
zlabel('Intensity')
colormap(jet)
In the attachment, images are given.
Image Analyst
el 22 de Mayo de 2021
@Ayush singhal, can you please start a new thread and I'll answer it there?
Ayush singhal
el 23 de Mayo de 2021
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
