and have been unsuccessful at getting it to run. I have tried to ensure that the directory is set properly, but when the figure comes up, it comes up empty which leads me to believe that the dicom files aren't being loaded in at all.
This is the code I try to run:
% Preallocate the 256-by-256-by-1-by-20 image array.
X = repmat(int16(0), [256 256 1 20]);
% Read the series of images.
for p=1:20
filename = sprintf('brain_%03d.dcm', p);
X(:,:,1,p) = dicomread(filename);
end