how to fix multibrandread function

1 回表示 (過去 30 日間)
mohd akmal masud
mohd akmal masud 2021 年 2 月 8 日
回答済み: Walter Roberson 2021 年 2 月 8 日
Hi all,
i want to use multibrandread function, but got error. this is my dicom image 128ASTITR2SUB8.dcm
which is my image have Rows=130, Columss=130, numberofFrames =90
this is my coding.
SPECTinfo = dicominfo('128ASTITR2SUB8.dcm');
fixedVolume = multibandread('128ASTITR2SUB8.dcm',...
[SPECTinfo.Rows, SPECTinfo.Columns, SPECTinfo.NumberOfFrames],...
'uint16=>single', 0, 'bsq', 'ieee-be' );
but i got error
Index exceeds the number of array elements (15).
Error in multibandread>readDiskFile (line 269)
im(:,destNdx(2),destNdx(3)) = data(srcNdx{1}-kStart+1);
Error in multibandread (line 165)
im = readDiskFile(filename, info, ndx, readOrder);
What does means by Index exceeds the number of array elements (15).????
Anyone can help me?

採用された回答

Walter Roberson
Walter Roberson 2021 年 2 月 8 日
dcm files are binary files with structured binary segments. https://docs.fileformat.com/image/dcm/ . The first 128 bytes are reserved for comments, or binary 0 if unused. You are reading starting from byte 0, so you are reading the comments as-if they are data.
The easiest explanation for that error would be if SPECTinfo.Rows, SPECTinfo.Columns, and SPECTinfo.NumberOfFrames are all non-scalar.

その他の回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by