How to resize multiple dicom images in subfolders and save them?
5 次查看(过去 30 天)
显示 更早的评论
采纳的回答
yanqi liu
2022-3-25
fd = fullfile(pwd, 'dcms');
fs = ls(fullfile(fd, '*.dcm'));
for i = 1 : size(fs,1)
im = dicomread(fullfile(fd, strtrim(fs(i,:))));
im = imresize(im, [128 128], 'bilinear');
imwrite(im, fullfile(fd, [strtrim(fs(i,:))) '_128x128.dcm']));
end
11 个评论
Rik
2022-4-14
Your error seems due to your dicom file, so not something we can debug for you remotely. Unless you use a custom dicom reader and haven't told us yet.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!