How to save multiple dicom images in to a single mat file?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 100 MRI images in dicom format. How can I save all of them in a single .mat file? Thank you in advance.
0 Kommentare
Antworten (2)
yanqi liu
am 25 Mär. 2022
fd = fullfile(pwd, 'dcms');
fs = ls(fullfile(fd, '*.dcm'));
ims = [];
for i = 1 : size(fs,1)
im = dicomread(fullfile(fd, strtrim(fs(i,:))));
ims{i} = im;
end
save ims.mat ims
3 Kommentare
Rupika Raj
am 26 Sep. 2022
Hi, I made some changes in Yanqi Liu's answer. Try this!
fd = fullfile(pwd);
fs = ls(fullfile(fd, '*.dcm'));
ims = [];
for i = 1 : size(fs,1)
im = dicomread(fullfile(fd, strtrim(fs(i,:))));
ims(:,:,i) = im;
end
save ims.mat ims
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!