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?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 7 Mai 2018
Bearbeitet: Walter Roberson am 7 Mai 2018
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 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by