How to generate skull striped image for all slices ?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MMSAAH
am 13 Feb. 2018
Kommentiert: Image Analyst
am 13 Feb. 2018
Hello
I'm working on masking out the skull from original gray scale MR image for just one slice using the following code :
outputImage = grayImage; % Initialize
outputImage(binaryImage) = 0; % Mask out.
Now, I want to calculate it for all slices(slice 1 to slice 14 ), I've maked a loop for that but this doesn't work:
for j=1:14
outputImage(:,:,j) = grayImage(:,:,j); % Initialize
outputImage(binaryImage(:,:,j)) = 0; % Mask out
end
Could anyone help me please ?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 13 Feb. 2018
You need to do something like
[rows, columns, numSlices] = size(grayImage);
for k = 1 : numSlices
thisSlice = grayImage(:, :, k); % Extract one slice
skullStrippedImage = StripSkull(thisSlice); % Call function that strips skull off just one slice.
outputImage(:,:,k) = skullStrippedImage ;
end
2 Kommentare
Image Analyst
am 13 Feb. 2018
Then turn that code into a function called StripSkull
function skullStrippedImage = StripSkull(thisSlice)
% Code goes here....
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis 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!