Assignment has more non-singleton rhs dimensions than non-singleton subscripts

I get this error line (see subject) at the code line:
ct(:,:,i)=double(dicomread([folder , '/', files(strcmp(temp(i),inst)==1).name]));
Any help?

 채택된 답변

Walter Roberson
Walter Roberson 2018년 5월 7일
편집: Walter Roberson 2018년 5월 7일
dicomread() can return a 3 or even 4 dimensional array for some kinds of data. Your code assumes that it is returning a 2 dimensional array.
Your code uses the variable "ct", which hints that you might be reading CT datasets. CT datasets are often multiple slice, 3 dimensional.

댓글 수: 3

You are correct. This DICOM Viewer I use it works fine for CT dicom images but not for ultrasound. I try to load 30 ultrasound images and cannot recognize them as a series. Instead, it only sees them as separate images but not as a group. I need to make it sees them as a group
If you do
temp = dicomread([folder , '/', files(strcmp(temp(i),inst)==1).name]);
then what is size(temp) and class(temp) ?
Sorry. I changed code. Didn't keep this and lost it

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by