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 日

1 投票

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 件のコメント

Stelios Fanourakis
Stelios Fanourakis 2018 年 5 月 7 日
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) ?
Stelios Fanourakis
Stelios Fanourakis 2018 年 5 月 7 日
Sorry. I changed code. Didn't keep this and lost it

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by