error reading Philips dicom images

2 vues (au cours des 30 derniers jours)
pom
pom le 15 Août 2013
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.

Réponses (1)

Youssef  Khmou
Youssef Khmou le 15 Août 2013
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

Catégories

En savoir plus sur DICOM Format dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by