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?

 Accepted Answer

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 Comments

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

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!