How to perform skull stripping using matlab?
古いコメントを表示
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 件のコメント
Matz Johansson Bergström
2015 年 1 月 28 日
編集済み: Matz Johansson Bergström
2015 年 1 月 28 日
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
2015 年 1 月 28 日
採用された回答
その他の回答 (4 件)
Alfonso Nieto-Castanon
2015 年 1 月 28 日
5 投票
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
2015 年 1 月 28 日
2 投票
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 件のコメント
Chandita Nath barbhuyan
2017 年 3 月 2 日
編集済み: Image Analyst
2017 年 3 月 2 日

How to remove the white skull region outside?
Image Analyst
2017 年 3 月 2 日
Adapt my attached skull stripping demo.
Matz Johansson Bergström
2015 年 1 月 28 日
編集済み: Matz Johansson Bergström
2015 年 1 月 28 日
1 投票
Magdalena Gierczynska
2020 年 10 月 7 日
0 投票
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 件のコメント
Magdalena Gierczynska
2020 年 10 月 7 日
What mean "~" in your code?
Image Analyst
2020 年 10 月 7 日
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
2021 年 5 月 22 日
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
2021 年 5 月 22 日
@Ayush singhal, can you please start a new thread and I'll answer it there?
Ayush singhal
2021 年 5 月 23 日
カテゴリ
ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
