【发布时间】:2023-02-17 09:46:50
【问题描述】:
我想使用以下代码在 MATLAB 中读取 100 个不同的 MRI 图像:
% 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
% Display the image stack.
montage(X,[])
但出现此错误:
下标分配尺寸不匹配。
这段代码有什么问题?
【问题讨论】: