creatinng a 3D matrix
显示 更早的评论
I have around 696 dicom slices(23x56x696). I want to put them all in a single matrix (X) to calcul;ate the mean of the image. I used this code to do so
for i = 1:696
X(:,:,i) = dicomread(sprintf('boneMat1%010i.dcm',i));
end
meanval = mean2(X);
but getting an error message saying "Subscripted assignment dimension mismatch." can anybody please help me to write a script to get the mean value.? I will be thankful to you. Regards, Sumaira Nazir
5 个评论
According to the dicomread documentation there are several different image array dimensions: "For single-frame grayscale images, X is an M-by-N array. For single-frame true-color images, X is an M-by-N-by-3 array. Multiframe images are always 4-D arrays."
Do you have true grayscale images? Single frame? Are all of these slices saved in one file?
SUMAIRA NAZIR
2016-3-9
Stephen23
2016-3-9
Please tell us the size of one image:
size(dicomread(sprintf('boneMat1%010i.dcm',1)))
SUMAIRA NAZIR
2016-3-9
Jingyang Xie
2021-2-7
Hi Sumaira, have you solved this problem? Thanks!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 DICOM Format 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!