Converting Multiple Dicom Images into Jpeg
Ältere Kommentare anzeigen
Hi,
Im trying to convert multiple Dicom Files into Jpeg files instead of doing it manually. Most of the Dicom files I have are labeled with numbers such as '000001, 0000002.... and so on' without the .dcm ( for example pdf files has a .pdf).
input = '/Users/brianngo/Desktop/CT-imaging/';
output = '/Users/brianngo/Desktop/CT-imaging-Jpeg/';
filePattern = fullfile(input, '\d');
FileList = dir(filePattern);
N = size(FileList,1);
for k = 1:N
filename = FileList(k).name;
if (~any(filename == '.'))
X = dicomread([input, filename]);
out_filename = [filename, '.', 'jpg'];
imwrite(X, [outdir, out_filename]);
end
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Medical Physics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!