MATLAB Answers

Dicom files to one 2d matrix

6 views (last 30 days)
Madi khad
Madi khad on 8 Jan 2020
Answered: Selva Karna on 9 Jan 2020
Hello ,
I have dicom files with 210 slices. I would like to use dicom read to read all slices then I would like to have a matrix with slice spacing in the y axe and all HU numbers in the width for each slice.
any help?
Thank you

Accepted Answer

Selva Karna
Selva Karna on 9 Jan 2020
clear all;
close all;
warning off
myFolder='your dicom root';
filePattern = fullfile(myFolder,'*.dcm');
dcmfiles = dir(filePattern);
for k = 1:flen
baseFileName =dcmfiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
a = dicomread(fullFileName);
%% To view 3d volume

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!