Read DICOM images from folder and save them into .mat file?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Erfaneh
el 14 de Oct. de 2014
Comentada: Geoff Hayes
el 16 de Oct. de 2014
I want to read DICOM images from folder in directory and then save them into mat file in output path. Can any one help me?
0 comentarios
Respuesta aceptada
Geoff Hayes
el 15 de Oct. de 2014
Assuming you have the Image Processing Toolbox, use dicomread to read the data from file, and then save to save the data to a mat file. Something like
inputFilename = 'myDicomFile.dcm';
inputFolder = '/Users/somePath/dicomFiles';
% read the file
[X,map] = dicomread(fullfile(inputFolder,inputFilename));
% now write to a mat file
outputFilename = 'myMatFile.mat';
outputFolder = '/Users/somePath/matFiles';
save(fullfile(outputFolder,outputFilename),'X','map');
If you have several files to read and write, you can choose an appropriate outputFilename for each.
2 comentarios
Geoff Hayes
el 16 de Oct. de 2014
Yes, a loop would do. Why does your function not save all of them?
Más respuestas (0)
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!