error reading Philips dicom images

Search for matlab dicomread error I found only one post but no answer, so I ask the same question here.
Using this code:
My dicom image has only 3 slices.
for p=1:3 filename = sprintf('IM_0022.dcm', p); X(:,:,1,p) = dicomread(filename); end
error: ??? Assignment has more non-singleton rhs dimensions than non-singleton subscripts
I tried several modifications but still got the same error.
Please help and thanks for your time.

回答 (1 件)

Youssef  Khmou
Youssef Khmou 2013 年 8 月 15 日

0 投票

hi pom,
You mean that your samples are named : 'IM_0022.dcm1, 'IM_0022.dcm2, 'IM_0022.dcm3 ?
If this is the case then you have string concatenation rather than sprintf simply because the last function does not take the variable p as string :
try :
for p=1:3
filename=strcat('IM_0022.dcm',num2str(p));
X(:,:,1,p) = dicomread(filename);
end

カテゴリ

ヘルプ センター および File ExchangeDICOM Format についてさらに検索

質問済み:

pom
2013 年 8 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by