How to save multiple dicom images in to a single mat file?
10 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
yanqi liu
2022 年 3 月 25 日
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 件のコメント
Rupika Raj
2022 年 9 月 26 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!