ximgrescd=zeros(512,512,512);
for j=1:9
dicomFileName=strcat('CT-000',num2str(j),'.dcm')
ximglayer=dicomread(dicomFileName)
info=dicominfo(dicomFileName)
ximgrescd(:,:,j) = ximglayer * info.RescaleSlope + info.RescaleIntercept;
end
for j=10:99
dicomFileName=strcat('CT-00',num2str(j),'.dcm')
ximglayer=dicomread(dicomFileName)
info=dicominfo(dicomFileName)
ximgrescd(:,:,j) = ximglayer * info.RescaleSlope + info.RescaleIntercept;
end
for j=100:511
dicomFileName=strcat('CT-0',num2str(j),'.dcm')
ximglayer=dicomread(dicomFileName)
info=dicominfo(dicomFileName)
ximgrescd(:,:,j) = ximglayer * info.RescaleSlope + info.RescaleIntercept;
end
Best Answer