how to fix multibrandread function

2 views (last 30 days)
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?

Accepted Answer

Walter Roberson
Walter Roberson on 8 Feb 2021
dcm files are binary files with structured binary segments. . 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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!