How to resize multiple dicom images in subfolders and save them?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shourya
am 24 Mär. 2022
Bearbeitet: Shourya
am 14 Apr. 2022
I have multiple subfolders with many MR dicom images with different size. How can I resize them into 128x128 and save them in the same subfolders at once? Thank you in advance!
0 Kommentare
Akzeptierte Antwort
yanqi liu
am 25 Mär. 2022
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 Kommentare
Rik
am 14 Apr. 2022
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu DICOM Format 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!